Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


HLSL in a Graphics engine

This topic is 5368 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

Ok well I am a serious nuub to HLSL and just have a conceptual thing I need to sort out. Can you apply HLSL directly to a specfic mesh or is it a post render type effect using the stencil buffer? Example of Assumed flow: 1. Begin Draw 2. Draw all objects that are solid and have no effects on them 3. Draw all Objects that are transparent 4. Render HLSL effects for each mesh 5. Render UI 6. End Draw Anyhelp is much appreciated and many thanks in advance for any help.

Share this post

Link to post
Share on other sites
HLSL Shaders are blocks of code which control how the object is rendered, for example of you have a vertex shader which deforms a mesh, before rendering the mesh you would tell D3D (he assumes) that you want to use this vertex shader on the following vertices, D3D then tells the gpu thats what you want to use and for every vertex submitted that code gets run.

For pixel shaders its about the same, when you render the mesh you tell D3D that you want to use that pixel shader and D3D then tell the gpu that. Then, for each fragment which is rendered, the pixel shader code is run on the gpu and the effect applied

Your assumed flow is pretty much spot on, when things are rendered they are generaly grouped by things such as shaders and which textures they will be using, in order to avoid unwanted switches.
However, transprant objects are rendered last due to the way the alpha blending works, so put 3 after 4 in your list and that pretty much does it.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!