Jump to content
  • Advertisement
Sign in to follow this  
shoez

Using effects question

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

Could anyone give a brief description of How i should view what an effect file as....like what is the idea behind it? i know its more then just a place to HOUSE your shader code. Also what is the idea behind a technique as well? thanks

Share this post


Link to post
Share on other sites
Advertisement
It's a place to house your shader code for most, but it has some added facilities which compile the shaders for you and allow you to setup renderstates. The techniques allow you to implement several versions of you shader for different configurations.

Share this post


Link to post
Share on other sites
an effect file stores the shader language code that your geometry and everything you display on your screen is run through. You could look at it like a tunnel (pipeline), where all the stuff you want to display goes through it. The simplest shader will basically just pass your stuff on without doing anything to it (some things will still be done in the non programmable parts, like the rasterizer which does interpolation, so that the values of each vertex is "interpolated" or spread across the triangle). A more advanced shader will do different effects to the geometry you pass through, like lighting for a simple example, but of course there are many different effects you could do to your geometry, such as even changing your geometry which the geometry shader does, or adding new geometry which is what the tesselator does.

A technique is a specific effect that you can use on your geometry. A simple effect file might just have a single technique, which might pass on your geometry and colors. You could add another technique for objects that want lighting, so you first run the geometry through the first technique, then run it through the second technique to add lighting to the objects that need it. You might have an extra technique that makes an object look "wavy", for when your looking at the object through a fire or something. The tecninque is basically just different combinations of shaders you have. for example, the first technique just passes through your geometry and colors with the the regular vertex shader, then goes to the pixel shader. the second technique implements lighting, so it uses the same vertex shader, but a different pixel shader. (you wouldn't usually need to send the geometry through a simple technique, then through a second technique just to do lighting, because you could just send it through the lighting technique to get the same effect, it was only an example)

maybe a simple visual

Regular_VertShader{}

Regular_PixelShader{}

Special_PixelShader{}

Techinique1{
Regular_VertShader{}
Regular_PixelShader{}
}

Technique2{
Regular_VertShader{}
Special_PixelShader{}
}

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!