Category : glsl

Good morning! Does anyone have a software trilinear interpolation function that I can use? I have a function that returns a vec3 for an ivec3 location. vec3 GetLighting(ivec3 P) { return DoShit(); } Now, I’d like to get a nice smooth interpolated color for a location vec3 v. If possible, please provide me a handy-function. ..

Read more

I’m working on a deferred shading pipeline, and i stored some information into a texture, and this is the texture attached to my gbuffer // objectID, drawID, primitiveID glGenTextures(1, &_gPixelIDsTex); glBindTexture(GL_TEXTURE_2D, _gPixelIDsTex); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB32UI, _width, _height, 0, GL_RGB_INTEGER, GL_UNSIGNED_INT, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); And this ..

Read more

I am new to OpenGL and Shaders. I want to write a toon shader. I have this OpenGL code: void display() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); float black[] = { 0.0, 0.0, 0.0, 1.0 }; float red[] = { 1.0, 0.0, 0.0, 1.0 }; float green[] = { 0.0, 1.0, 0.0, 1.0 }; float blue[] ..

Read more