Original Post
🔒 Locked
Terrain Lighting?
Advertisement
Why didn''t Direct3D lighting cut it?
You could also use light maps/shadow maps, depending on the characteristics of your terrain.
--Hoozit.
You could also use light maps/shadow maps, depending on the characteristics of your terrain.
--Hoozit.
Read thorugh this tutorial twice:
http://www.gamedev.net/reference/programming/features/shadows/page4.asp
Now rip the ShadowVolume class from the directx sdk stencilbuffer->shadowvolume sample.
I just did it, and it looks great when my spaceship flies over my generated terrain
.Pangis
http://www.gamedev.net/reference/programming/features/shadows/page4.asp
Now rip the ShadowVolume class from the directx sdk stencilbuffer->shadowvolume sample.
I just did it, and it looks great when my spaceship flies over my generated terrain
.Pangis
Well, shadow mapping doesn''t allow for realtime effects. I am looking for something I can alter in realtime without much fuss and computational expense. The Directx lighting I was using, used normals to compute the ligting, it wasn''t true lighting, it didn''t cast shadows, it just shadded polygons that faced away from the light source, this isn''t what Im looking for. Would stencil buffers work, I haven''t read to much into stencil buffers, but I know they can be used for shadows. Would this be a fast realively fast approach or not? If so, do you know of any good tutorials on how to use stencil buffers for shadowing? If you could help I would really appreciate it..
Thanks in advance.
Later,
James
Thanks in advance.
Later,
James
Read these great articles on Gamasutra. One explains stencil buffers, and the other explains the use of shadow volumes to create realtime shadows.
http://www.gamasutra.com/features/19991115/bestimt_freitag_01.htm
http://www.gamasutra.com/features/20000807/kovach_01.htm
After you''ve read them, study the SDK tutorial on shadow volumes. (Source: (SDK root) \Samples\Multimedia\Direct3D\StencilBuffer\ShadowVolume)
In answer to your question about speed, that depends on your implementation. The first thing you''ll notice when you filch the SDK sample''s code for your own project is how slow it runs. This is because the sample is creating/deleting heap memory every frame of animation, and also locking/unlocking the vertex buffer once per object.
With a little creativity you can speed shadowing of this type up quite a bit. I''m using shadow volumes for my demo, and it hauls pretty well.
Ganbatte kudasai (good luck).
--Hoozit.
http://www.gamasutra.com/features/19991115/bestimt_freitag_01.htm
http://www.gamasutra.com/features/20000807/kovach_01.htm
After you''ve read them, study the SDK tutorial on shadow volumes. (Source: (SDK root) \Samples\Multimedia\Direct3D\StencilBuffer\ShadowVolume)
In answer to your question about speed, that depends on your implementation. The first thing you''ll notice when you filch the SDK sample''s code for your own project is how slow it runs. This is because the sample is creating/deleting heap memory every frame of animation, and also locking/unlocking the vertex buffer once per object.
With a little creativity you can speed shadowing of this type up quite a bit. I''m using shadow volumes for my demo, and it hauls pretty well.
Ganbatte kudasai (good luck).
--Hoozit.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement