Solved by snapping to integer coordinates. Apparently, you can't trust GL_NEAREST.
...
vec2 Fraction = fract(Dimensions * TexCoord.xy);
TexCoord.xy -= Fraction / Dimensions; // <--
...
Type: Posts; User: Sunray
Solved by snapping to integer coordinates. Apparently, you can't trust GL_NEAREST.
...
vec2 Fraction = fract(Dimensions * TexCoord.xy);
TexCoord.xy -= Fraction / Dimensions; // <--
...
I did a bilinear filter for shadow maps, which I've also done quite a few times before over the years. But this time around I got some weird seams. Is there someone who has a sensible explanation for...
Since texture filtering is a part of the texture state I'm sure you would have to do the filtering yourself.
I'm pretty sure that GLSL doesn't define any > operator for vec3, so if the NVIDIA...
texture(), the actual texture type is already known from the input sampler type.
This is how I do it, and it works fine on ATI.
First of all I use strictly UBO since the rendering API must be compatible with DX10/DX11. For all dynamic uniforms (those who are updated every...
I current have huge problems with dynamic VBO:s on Radeon cards. I do a lot of GUI rendering and for this I have a Vertex Buffer Pool from which the rendering code is allocating from. This pool...
I believe I asked Humus this once at my previous work. He said it was purely a driver restriction and has nothing to do with the hardware.
Doesn't work on ATI (results in garbage on screen). I've sent them a bug report few months ago.
Thumbs up for AMD.
mix(a, b, c)
I guess they have to if they want support games running id tech 5 (Rage, Doom 4).
Question: Is it possible to use ATI Fetch4 for shadow maps in OpenGL? I find zero info on the net.
This should work: gl_ProjectionMatrix[3].z/(Z * -2.0 + 1.0 - gl_ProjectionMatrix[2].z)
It seems to work. My graphics engine relies on FBO with stencil and at first it didn't work at all with R4850. Then I added an additional color target to store and sample depth from and made the...
I've noticed that you can't sample from a 24 bit depth texture (GL_DEPTH_COMPONENT24, GL_DEPTH24_STENCIL8) on Radeon 4850. All you get is random values. However DEPTH_COMPONENT16/32 works fine.
Try "zOverW = zOverW * 2.0 - 1.0". This should be the exact same thing as I wrote. However I forgot to divide pos by pos.w. :)
In normalized device coordinateds (NDC) x,y,z are in the range [-1, 1].
It should be something like this:
VertexShader:
ClipPos = gl_Position;
FragmentShader:
A simpler way (IMO) to calculate the view space position is "Position = gl_ProjectionMatrixInverse * Ndc" where Ndc is known from gl_Position.xy/gl_Position.w and the sampled depth value. It's...
I guess you want to find all pixels that are intersecting a convex volume? If so, this is the same problem as stencil shadow volumes. Look up z-fail shadow volumes.
Aren't normal maps RGBA8 already? So how can fetching normals from a RGBA8 texture, rotating them to world space and storing them in a RGBA8 texture, loose precision?
Maybe I'm missing something...
Is that per-vertex specular?
#ifdef should work in GLSL iirc.
Cascade shadow maps are probably the easiest and most stable method IMO. Very easy to implement, no bad worst cases, only poor (but not that poor) performance. :)
Have you read the compile and link info logs?
The popping that occurs comes from phong (or gouraud if someone uses that :) ) shading, since it also illuminate backfaces. There are a few ways to deal with it.
1) N.L^value, to "narrow" the...