Bump mapping and light

Blitz3D Forums/Blitz3D Programming/Bump mapping and light

Tabb(Posted 2014) [#1]
Hi all,

I just succeded to bump map a asteroid. But the light is weird. The sun light is lighting it fine, but the ship projector light is not lighting it on the opposite side of the sun.
I can't figure out why. I tried to add a lightmap texture but the result is the same. Maybe I have to use diferrent values of TextureBlend ? ...

You will find below the program. Keys are explained in the readme file.
Download here

Thank you for your help.


videz(Posted 2014) [#2]
Hey Tabb,

I see you're using cubemapping to achieve your normal maps. I have not tried this method yet but you can start with a simple example to isolate the issue.

BTW, where did you get your reference to come up with this solution? There are other normal examples there that you can also try, maybe it could work with your game. You can also post your feature reference links here like normalmapping specular, etc.. so others can try and maybe help each other out.


Tabb(Posted 2014) [#3]
videz,

I found this method here, the second link to normalmapping1.zip.

I tried others examples first but I couldn't understand them enough to make them work :(


videz(Posted 2014) [#4]
It looks like the cubmapping example is a good one. But I will try to simplify the code to make a good piece.

With the other examples, its very simple, the same procedure of course w/o the cubemapping but using EntityColor and angles to update or correct the normal mapping depending on your view..

i.e.

Function update_floor()
	tempy=EntityYaw(cam)
	tempy=tempy-90
	r=128*(Cos(-tempy)+1)
	g=128*(Sin(-tempy)+1)
	
	tempx#=EntityPitch(cam)
	b=184+(tempx/2)
	
	EntityColor ground,r,g,b
End Function


The problem with this is you need to update all entities you need to correct the normal view so I guess the better solution between the two is the cubemapping one which pretty much is the new method afaik.

I still think the normal demo that I posted is your best solution cause its using pointlights like you need for your ship project light.

More reference:
http://www.blitzbasic.com/Community/posts.php?topic=56374
http://www.blitzbasic.com/Community/posts.php?topic=39655&hl=specular%20map


RemiD(Posted 2014) [#5]
There was the possibility to create good render with bump mapping effect with xors3d, but unfortunately xors3d is dead...

Have you tried with the dx9 engine that Ploppy is working on ?