Real time lighting

Blitz3D Forums/Blitz3D Programming/Real time lighting

Craig H. Nisbet(Posted 2004) [#1]
Can someone tell me why this doesn't work. The light in this scene(the sphere) is right next to the ground, well within the range of the light, only there is no light affecting the ground. Is this a limitation of real-time 3d or am I missing something?

Graphics3D 640,480,32
SetBuffer BackBuffer()

;Make the ground
plane = CreatePlane()

;Make the light
AmbientLight 0,0,0
LRange# = 7 ;light range

light = CreateLight(2)
PositionEntity light,0,1,0
RotateEntity light,90,0,0
LightRange light,LRange#

LightSphere = CreateSphere(4,light)
EntityColor lightsphere,255,255,255
EntityFX lightsphere,1
ScaleEntity lightsphere,.2,.2,.2

;Make the camera
Camera = CreateCamera()
PositionEntity Camera,0,4,-10
RotateEntity Camera,30,0,0

While Not KeyDown(1)
UpdateWorld
RenderWorld
Flip
Wend


fredborg(Posted 2004) [#2]
The Blitz lights only affect vertices, and a plane (like your ground) only has vertices at the corners of it. You can make it work by using CreatePlane(10), but it won't be pretty :)


Matty(Posted 2004) [#3]
I guess that would be the reason why my low polygon models I make with Milkshape end up not looking right at certain angles when lights are used.


poopla(Posted 2004) [#4]
They would if you used Dot3 lighting. However we still need a stronger implementation of it to have full control over how things look.


Matty(Posted 2004) [#5]
What is Dot3 Lighting?


sswift(Posted 2004) [#6]
Dot 3 = Normal maps = A texture where each texel contains the angle of the surface at that location. This allows you to make a flat surface appear to have more polygons than it really does.

it's like bumpmapping, but better. And Blitz doesn't support it well enough at the moment to concern yourself with. It's an effect for advanced users anyhow and requires special programs to generate the maps, and high detail geometry for reference. Just make your floors have more polygons. Or look up how to use lightmaps. Dynamic lightmapping is what games like Unreal use. They don't use vertex lighting except for lighting the characters.


Ruz(Posted 2004) [#7]
why can't we have dynamic lightmapping in blitz? that would be ace or is there an implemenation of this already?


jhocking(Posted 2004) [#8]
Mark is working on it. There is basic functionality already in Blitz3D but it isn't really useful for much right now.


Genexi2(Posted 2004) [#9]
Anyone mind explanin' what dynamic lightmapping is btw?


jhocking(Posted 2004) [#10]
Wait, I didn't read the word correctly when I replied. It sounds like it refers to lightmaps which are calculated on the fly. Is that right? In which case, how is that an advantage?


Ruz(Posted 2004) [#11]
well from what i was readin about it, it is kind of a lightmap for non static objects like characters etc.

http://www.flipcode.com/tutorials/tut_advlightmaps.shtml


Rob(Posted 2004) [#12]
Check out demo 2 in my sig.


Ruz(Posted 2004) [#13]
damn this pc, can't play stuff with it. its a good pentium 4, but it has a really old 8mb vid card.

I will test it on my other one today