Jump to content
  • Advertisement
Sign in to follow this  
muku

Parser for a cg or hlsl shader file

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

Hello,

I'm trying to build a parser for cg or hlsl shaders but I'm not very experienced in shading languages. What I need from the parser is to scan the whole file and get the names of the variables used for passing the shader's parameters from an XNA application. The problem is that I'm not sure which keywords I should search for. Declaring a variable like this for example "float4 var" outside of any struct means that it's definitely gonna be used to pass parameters in the shader? A shader isn't using any global variables internally? Generally speaking which keywords should I search for in the lines i read? Any suggestions on the steps I should make for the development of the parser?

Also what are the "< >" operators are used for in the following example?


float gSceneIntensity <
string UIName = "Scene Intensity";
string UIWidget = "slider";
float UIMin = 0.0f;
float UIMax = 2.0f;
float UIStep = 0.1f;
> = 0.5f;


Share this post


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

  • 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!