Jump to content
  • Advertisement
Sign in to follow this  
JulianAssange

OpenGL OpenGL ES Fog

This topic is 2561 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 have a problem where the fog works like intended on a desktop program (PC) using OpenGL but the same fog doesn't work like it should on an Android device (using OpenGL ES).

OpenGL (PC):

YQcR1.png

OpenGL ES (Android):

ywWqS.png

The code is a exact duplicate, it looks like this:




// OpenGL ES Init
gl.glClearColor(0.5f, 0.5f, 0.5f,
1.0f);
float fogColor[] = {0.5, 0.5, 0.5,
1.0};
// Fog color to mFogBuffer...

gl.glEnable(GL10.GL_FOG);
gl.glFogfv(GL10.GL_FOG_COLOR,
mFogBuffer);
gl.glFogf(GL10.GL_FOG_DENSITY, 0.04f);




// OpenGL Init
glClearColor(0.5,
0.5, 0.5, 1.0);
float fogColor[] = {0.5, 0.5, 0.5,
1.0};
glEnable(GL_FOG);

glFogfv(GL_FOG_COLOR, fogColor);
glFogf(GL_FOG_DENSITY,
0.04f);



But I can't get the OpenGL fog work exactly the same on my Android device. I have tested `glShadeModel()`'s attributes and so on.

The area that should fog is totally white and it is basically a quad (built by triangles).
I have done some `gluLookAt()` transformations, but it shouldn't affect the fog.

Any ideas?

Thanks in advance!

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!