Jump to content

  • Log In with Google      Sign In   
  • Create Account

50CoL

Member Since 21 Dec 2011
Offline Last Active Dec 28 2012 12:17 AM

Topics I've Started

How to deal with the cube map in irradiance environment map precalculation?

12 December 2012 - 08:22 PM

Hello guys,

Currently, I'm working on sth about irradiance environment map ( generates diffuse/specular map from a

given cubemap ). As I need to calculate the diffuse and specular factors from the cubemap, I need to

know how to get every pixel on each side of the cubemap. But I cant figure it out.

How can I unwrap the cubemap and render it on the screen ( Like post process ) or there are other ways

to achieve this?

Does it possible to write a "Global Shader"?

04 September 2012 - 09:29 PM

Hello its me again.
Im wondering if there can be a global shader that works to everything, such as fog, ambient lighting or sth else..
Im a beginer of GLSL. I dont know how to let the fog shader work to every objects on the scene, because some of the objects are being rednered by different shaders.
So does it possible to write a Global shader? Or I need to edit every shader?
Thanks

Problem of GLSL Multitexturing

03 September 2012 - 09:06 PM

Hey guysPosted Image
Im working on a water effect demo these days, and there is a problem that the fragment shader cant load the normal texture for the water surface ( the reflection texture works fine) .
Im sure that both the vertex shader and fragment shader are correct because they work fine in the ShaderMaker. So I guess the problem comes from my C++ codes, and here are the codes:

_waterShader->Use();
glActiveTexture(GL_TEXTURE1);
glEnable(GL_TEXTURE_2D);
_ReflectionTex->Bind();
glUniform1i( glGetUniformLocation( _waterShader->GetHandler(),"reflectTex"),1);

glActiveTexture(GL_TEXTURE2);
glEnable(GL_TEXTURE_2D);
_WaterNorTex->Bind();
glUniform1i( glGetUniformLocation( _waterShader->GetHandler(),"bumpTex"),2);

// uniform values
...
// draw a plane
...

What's wrong with my codes? Posted Image
sorry for my poor English
Thanks!

Problem with glGenTexture(). Need Help :D

21 December 2011 - 09:31 PM

Hello guys, I got a problem with the method glGenTexture().
Here is the code:

GLuint sky[5];
glGenTexture(5,&sky);

When I putted these lines in a class's construction function, they didn't work.
The values in the array sky[5] are all 0 after the code above being runed.
But They supposed to be 0,1,2,3,4 as the indexes of textures right ?



PARTNERS