Which coordinates do I have to pass to gluUnProject to retrieve the frustum corners as world space coordinates? Whatever I tried doesn't seem to work:
void CFrustum::Compute (void)
{
...
Type: Posts; User: karx11erx
Which coordinates do I have to pass to gluUnProject to retrieve the frustum corners as world space coordinates? Whatever I tried doesn't seem to work:
void CFrustum::Compute (void)
{
...
I don' think there is only "(one and only) right way" to do this (or other code), and apparently hardware vendors do not just optimize texture array accesses, but also condition handling and code...
On my current development hardware (Core i7 920 @ 3.6 GHz, 6 GB RAM 1800 MHz, Geforce GTX 470) I couldn't find a speed difference between binding each texture separately to a TMU and using a texture...
I don't consider my proposition hackery. It may be less performant on certain hardware, but that doesn't make it hackery. It will pretty likely still be more performant than to flush the current...
I don't think it's even NVIDIA-only. The EXT_texture_array extension suggests that it could be possible in a future extension, but they don't say that they will support it. Only that they could...
Dark Photon,
I looked texture arrays up and it says that this wouldn't not be supported by the fixed function pipeline. NVidia proposes extensions to use them with glEnable and glDisable, but is...
Is there a way to avoid a state change when needing to change a texture (besides putting several textures in a bigger one and using texture coordinates to address them)?
I wish the client array...
I know all that. I was just playing around with it a bit because it seemed to work.
Ah ok, that makes sense. Thanks!
Blend function is controlled via gl_Color.a (as already stated above).
I supposed it's undefined, but as it works I tried to exploit it just for the heck of it. I am not insisting on this method to reduce state changes though - if somebody has more insight into this...
Following scenario: I am rendering a lot of particles, some to be blended additively, some via alpha. Right now I have to change the blend function every time the particle type changes. My idea was...
Thanks to everybody who has helped me with understanding this. :)
Thanks. Knowing all that I have been able to make the shader work using shadow2DProj.
Here's the vertex shader code:
uniform sampler2D sceneColor;
uniform sampler2D sceneDepth;
uniform...
Ack, that's because I forgot the brackets around (w * 2.0). They are present in my code though.
vec3 lightWinPos = lightClipPos.xyz / (lightClipPos.w * 2.0) + 0.5;
Thanks. I know that, but my shader doesn't even work when using texture2DProj instead of computing everything manually, and it also doesn't work right when comparing the depth value from the scene...
Swimming fixed: Yes
shadow2DProj working: No
You may need to ponder a little on the implementation details of the following code, but it shouldn't be too hard to understand.
OpenGL matrix...
Thanks for your input. I am doing this similarly, I just compute the vertex in the shader for now. I have been considering storing camera space coordinates in a second render target when rendering my...
BionicBytes,
I don't know whether you have read the entire thread, but I am trying to render a shadow into a frame buffer as post process. So I render the shadow map as depth only in one render...
I have bound the current scene's color and depth buffers and the shadow map (need the color buffer because the shader outputs scene + shadow).
So shadow2DProj compares scene depth to shadow depth...
I was using lightNDC.z in the comparison. The GLSL compiler automatically casts non-vec2 parameters to texture2D to vec2 and issues a warning about it. I only see the warnings when I actually have...
I just mentioned that to explain why I am making such stupid mistakes. It's hard to think when you're tired and your head hurts. :)
Thank you very much for your help so far.
I am not comparing...
I was wrong about lightWinPos. Since the bias matrix has been applied, gl_TextureMatrix [2] * cameraClipPos does indeed yield the light window space coordinate.
It was 2:30 am for me when I posted this, and I've got a particular bad case of influenza.
Here is the magic:
I forgot to mention the bias matrix in my erroneous post, but it is involved.
...
gl_TextureMatrix [2] contains light projection * light model view * inverse camera model view * inverse camera projection. That's how I directly get from camera to light clip coordinates.
I am...
The latter happens. It looks like the shadow by and by moves through the solid geometry and disappears behind it (so to speak) as the shadow caster approaches it.
Z near and Z far never change in...