Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Search:

Type: Posts; User: karx11erx

Page 1 of 8 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,606

    Retrieve frstum corners with gluUnProject?

    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)
    {
    ...
  2. Re: Avoiding state switch when changing blend function

    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...
  3. Re: Avoiding state switch when changing blend function

    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...
  4. Re: Avoiding state switch when changing blend function

    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...
  5. Re: Avoiding state switch when changing blend function

    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...
  6. Re: Avoiding state switch when changing blend function

    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...
  7. Re: Avoiding state switch when changing blend function

    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...
  8. Re: Avoiding state switch when changing blend function

    I know all that. I was just playing around with it a bit because it seemed to work.
  9. Re: Avoiding state switch when changing blend function

    Ah ok, that makes sense. Thanks!

    Blend function is controlled via gl_Color.a (as already stated above).
  10. Re: Avoiding state switch when changing blend function

    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...
  11. Avoiding state switch when changing blend function

    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...
  12. Re: Compute eye space coord from clip space coord?

    Thanks to everybody who has helped me with understanding this. :)
  13. Re: Compute eye space coord from clip space coord?

    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...
  14. Re: Compute eye space coord from clip space coord?

    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;
  15. Re: Compute eye space coord from clip space coord?

    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...
  16. Re: Compute eye space coord from clip space coord?

    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...
  17. Re: Compute eye space coord from clip space coord?

    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...
  18. Re: Compute eye space coord from clip space coord?

    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...
  19. Re: Compute eye space coord from clip space coord?

    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...
  20. Re: Compute eye space coord from clip space coord?

    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...
  21. Re: Compute eye space coord from clip space coord?

    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...
  22. Re: Compute eye space coord from clip space coord?

    I was wrong about lightWinPos. Since the bias matrix has been applied, gl_TextureMatrix [2] * cameraClipPos does indeed yield the light window space coordinate.
  23. Re: Compute eye space coord from clip space coord?

    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.
    ...
  24. Re: Compute eye space coord from clip space coord?

    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...
  25. Re: Compute eye space coord from clip space coord?

    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...
Results 1 to 25 of 187
Page 1 of 8 1 2 3 4