1

I have been reading through a bunch of tutorials and when I came across one about fog in OpenGL it mentioned the built in variable gl_FogParameters. Is this something that is set in the application and then accessible through the shader.

In other words, do you set the various fog variables up the same way:

glFogi(GL_FOG_MODE, GL_LINEAR);
glFogf(GL_FOG_START, 10.f);
glFogf(GL_FOG_END, 40.f);

or is it actually a uniform you send to the shader?

1 Answer 1

3

All of the uniforms that start with gl_ track some specific part of OpenGL's fixed-function state. They get their value from GL's fixed-function state. The specification states exactly which state maps to exactly which variables.

Sign up to request clarification or add additional context in comments.

1 Comment

Also don't forget that fixed function is deprecated and hence those variables are not allowed for OpenGL-3 core profile or later.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.