Jump to content
  • Advertisement
Sign in to follow this  
GuyWithBeard

Game engine architecture question

This topic is 3969 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I am planning a new game engine that would be written in C# and use DX9 through SlimDX. I would like to implement lighting and shadowing through shaders but I cannot figure out how to fit the shaders into the engine. Let's assume I have a scene class that has lists of objects (meshes) and lights. When I add a new light to the scene I want the objects to be lit by it and cast shadows onto the other objects in the scene. But, what kind of shader system works with this approach? Do I have to write some kind of shader standard, e.g. certain variables that always need to be included in all shaders, that the engine passes values to? Or is there another way to make this work? Are there any good tutorials on lighting and shadowing with HLSL on the net? Thanks for your time! //chinc

Share this post


Link to post
Share on other sites
Advertisement
Have you checked the real time lighting demo that comes with the DirectX SDK?

It uses a vertex shader that writes data to a stencil area in the Z buffer, that it then checks against the back buffer too see if the pixel is lit or dark...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!