Results 1 to 7 of 7

Thread: simple reflection question

  1. #1
    Senior Member Frequent Contributor
    Join Date
    Oct 2009
    Posts
    592

    simple reflection question

    I wonder if it might be possible to adapt the simple shadow matrix algorithm (from the Blinn's article) to cast reflections also. I know, I know I shouldn't have asked without trying it out myself first, but, if I am wrong, are what are the other simple algorithms for reflection?

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    992

    Re: simple reflection question

    Yes, in fact you can use a similarly constructed matrix to create reflections on a planar surface.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Oct 2009
    Posts
    592

    Re: simple reflection question

    But how about the depthbuffer? Things will overlap on the planar surface I suppose. References?

    You probably had RTT in mind and projective texturing. But I had something else in mind. Is the stencil buffer approach really the simplest one?

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    992

    Re: simple reflection question

    No, I'm not talking about RTT+projective texturing. You have to properly configure your depth and stencil test to make things working.

    There is the good old dinosaur sample which shows planar shadows and reflection. If you haven't checked it out then it's about time:
    http://www.opengl.org/resources/code...lectLight.html
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  5. #5
    Senior Member Frequent Contributor
    Join Date
    Oct 2009
    Posts
    592

    Re: simple reflection question

    Yeah, I know the dino tut, but, he just flips the dino below the reflecting rect, doesn't do anything else. Not only this, he does not support arbitrary plane reflection, only the infinite z plane, I believe. The matrix is not similar either, it is a reflection transformation matrix, but Blinn's is a projection transformation matrix.

    I am hunting for a projection example, if it exists, but I suppose the depth buffer prohibits it, fragments get bumped on one another. I was thinking of "mostly" projecting vertices onto a plane, with a slight offset, so the depth buffer would be pleased and only the closer fragments would show.

  6. #6
    Senior Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    992

    Re: simple reflection question

    Ah, now I know what you mean. Actually Don't really understand why you want to go with a projective solution if a simple reflection to arbitrary plane would just work fine.
    Projection in fact introduce the problem of Z fighting so you definitely cannot 1-to-1 map shadow projection for reflection.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  7. #7
    Senior Member Frequent Contributor
    Join Date
    Oct 2009
    Posts
    592

    Re: simple reflection question

    I want to know, because I don't know and I want to experiment. Reflection is fascinating, even though the RTT approach implementation is different than the stencil approach, they are in a way similar. I can't believe there are no other solutions.

Similar Threads

  1. Reflection / glTexGeni Question (with Image)
    By DerTherion in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 01-18-2009, 03:33 PM
  2. How to apply reflection effect to a simple cube?
    By powervr in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 11-19-2004, 08:34 PM
  3. simple mirror reflection procedure
    By candy in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 04-10-2004, 07:13 PM
  4. Question concerning the reflection
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-07-2004, 01:25 AM
  5. Reflection Question
    By Jan in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 02-19-2004, 10:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean