Jump to content
  • Advertisement
Sign in to follow this  
giugio

OpenGL opengl cg or glsl

This topic is 2325 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 creating a little opengl engine for my little tests and for a commercial use.
Now i wish choose to using cg or glsl.
I see that directx hlsl has a reflection for enumerate variables and and texture used by the shader program.
Is possible do something of similar in cg or glsl?
In wild magic(the 3d engine)there is a parsing of compiled cg shader for that ,is the only method?
is possible using the same technique in glsl?
And ... What do you recommend ?use cg or glsl?
also for portability and ,may be ,using it in tablet or smartphones

Share this post


Link to post
Share on other sites
Advertisement
If you are going to release for tablets and phones, your only option currently is GLSL for OpenGLES.

For OpenGLES you can query active uniforms with glGetActiveUniform and glGetProgram

Share this post


Link to post
Share on other sites

If you are going to release for tablets and phones, your only option currently is GLSL for OpenGLES.

For OpenGLES you can query active uniforms with glGetActiveUniform and glGetProgram


i see that glGetActiveUniform and glGetProgram are compatible also with glsl (not glsl for opengl es,opengl 3 or 4 ,is correct?) then thanks of all , i choose glsl

Share this post


Link to post
Share on other sites
I'm not sure what you ask if anything...

These glGet-commands are available in all OpenGL-versions that support a programmable pipeline. (GLES 2.0+, GL 3.0+)

Its not part of GLSL spec, its part of the OpenGL spec, they are used to communicate with the GLSL code from your application code.

GLSL is a separate specification, and GLSL ES v1.0 is the one you use with OpenGL ES 2.0.
GLSL ES v1.0 is roughly equivalent to GLSL v1.2 used in PCs

If you want to run the same code on both platforms, I'd recommend making it work on GLES first, since its (more or less) a subset of GL

Share this post


Link to post
Share on other sites


i see that glGetActiveUniform and glGetProgram are compatible also with glsl (not glsl for opengl es,opengl 3 or 4 ,is correct?) then thanks of all , i choose glsl


Compatible? What does that mean?
These are function that are part of the OpenGL spec. glGetProgram is available since GL 2.0.
glGetActiveUniform is available since GL 2.1.

You have the GL 2.1 references pages here http://www.opengl.org/sdk/docs/man/
and a lot of documentation in the documentation section here http://www.opengl.org/

For GL ES, you need to get the spec from khronos.org

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.

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!