Jump to content
  • Advertisement
Sign in to follow this  
TheMan22

OpenGL OpenGl shading language commands

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

I can't see the OpenGl shading language commands in any of these libraries : Tao.OpenGl; Tao.Platform.Windows; Tao.FreeGlut; When i type in c#, Gl or Glut or and then dot, there are no things like : attribute varying uniform or : in out inout But it contains all the shading language commands like this : #region How to install a shader object in OpenGl // Notes : Creating and installing shaders in current GL state // Create shader object and load code as string,then compile it //Gl.glCreateShaderObjectARB(Gl.GL_VERTEX_PROGRAM_ARB); //Gl.glShaderSource(); // Gl.glCompileShader(); // Once compiled, next you need to attach it to program object.First create the program object. //Gl.glCreateProgramObjectARB(); // Then attach the shader to the program object and link //Gl.glAttachObjectARB(); //Gl.glLinkProgramARB(); // Now you have shader executable and you need to install it as current GL state //Gl.glUseProgramObjectARB(); // After this step the graphics primitives will be rendered using the shader program #endregion I tried Gl.uniform or Gl.gluniform , but no does not exist like thet either Where are those specifiers ? If i type just uniform for example and then float and so on i get errors. Thanks

Share this post


Link to post
Share on other sites
Advertisement
in/out/attribute/varying etc. are all keywords you use in your actual shader source (typically in a separate file, or embedded in your app as a string) rather than things you'd use in your application code (which is what your GL etc. commands are).

Typically you load your shader source from a text file and pass the contents into glShaderSource().

Share this post


Link to post
Share on other sites
Wow thanks a lot :) Hard to find people that do the shading language in opengl

One more question, what editor do you use for writing vertex/fragment programs and do you use a keyword list for highlighting and auto drop down menus?

And yeah can you point me too some vertex/fragment examples, maybe some that you have written ?

Thanks a million again, ok back to reading :)

Share this post


Link to post
Share on other sites
http://ozone3d.net/
and
http://lighthouse3d.com/

You can use any editor you like, the code is read as an ANSI string. The Code::Blocks editor comes with a GLSL lexer, but it's a bit broken in places. Also, you can use shader IDE's like ATI's RenderMonkey to preview your shader without having to write a full program.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!