Tag Info

Hot answers tagged

4

It would be nice if I could retrieve the values from memory after the the shader has calculated them but it doesn't seem possible - or advisable But, it IS possible, and I would advise it: https://www.opengl.org/wiki/Transform_Feedback


4

Khronos provides a reference GLSL compiler. It is capable of validating GLSL up to version 3.50 (full support) and up to 4.50 (partial support). It also handles ESSL (OpenGL ES's GLSL). The tool verifies that the shader conforms to the GLSL specification. This does not necessarily guarantee that it works with all drivers but it does guarantee that the ...


3

try using a multiplicative "bias" instead of additive: shadowCoordinate.z *= 0.98; If you're doing the sampling yourself rather than using the shadow comparator interpolating the shadow map helps reduce acne a lot. There shouldn't be any shadow visible behind the object as the light should not affect it with the light being completely occluded by the ...


1

The issue was with the loading. I'm not sure what exactly the problem was, because I changed the code significantly, but it's working now. EDIT Current loading code: GLuint getShaders(const char *vertexpath, const char *fragmentpath) { printf("****************** Loading Shaders ******************\nVertex: %s\nFragment: %s\n\n", vertexpath, fragmentpath); ...


1

You are using GL_DEPTH_COMPONENT24 which is a fixed-point format clamped to the range [0, 1] inclusively. The floating point formats are GL_DEPTH_COMPONENT32F and DEPTH32F_STENCIL8. glTexImage2D GL_TEXTURE_2D 0 GL_DEPTH_COMPONENT32F shadowMapResolution shadowMapResolution 0 ...


1

The reason is due to a bug in the driver (or an overlooked gotcha in the GLSL language?). Your vertex shader uses some of the struct members, your fragment shader uses a different set of the struct members, and the drivers ends up creating 2 different types by independently eliminating the unused uniforms from the struct type in both shaders which cause them ...


1

I think you would do to keep your GPUVec3 and your vec3 as two separate classes, not one containing the other. Here's an example: struct vec3 { float x,y,z; }; struct GPUVec3 { float x,y,z, pad; GPUVec3() { } GPUVec3( float x, float y, float z ) { } GPUVec3( const vec3 & v ) { } operator vec3 const & () const { return ...


1

The basic cause of the problem was that my value for screenY (2D location of mouseclick on Y-axis) was incorrect and so passing it to any valid picking ray function returned invalid results. My old working project got the mouse position values from the org.lwjgl.input.Mouse class whereas the new project is using java.awt.event.MouseListener. The lwjgl ...


1

Check if you have mipmaps enabled on the texture samplers ( GL_LINEAR_MIPMAP_LINEAR, etc ). If the texture is incomplete (only 1 mipmap level is rendered to by the FBO at a time) and mipmaps are enabled on the sampler you'll get white textures. Switch to GL_LINEAR or GL_NEAREST set GL_TEXTURE_MAX_LEVEL​ to 0 so it only use the first mipmap (same as no ...



Only top voted, non community-wiki answers of a minimum length are eligible