Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Surface curvature in fragment shader

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2001
    Location
    Sunnyvale
    Posts
    28

    Surface curvature in fragment shader

    hi everyone !

    Is there a way to find the curvature of a surface being rendered at the fragment level (in the fragment shader) ?
    In the fragment shader the only surface information i can access is the (interpolated)normal so it would be very helpfull to have access to the non-interpolated normal from the 3 vertex of the triangle in order to compute the curvature.

    thx for any help

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,704

    Re: Surface curvature in fragment shader

    The best you can do is the dFdx() and dFdy() functions. They will tell you how much the normal will move over to the next fragment sample location, which might be enough for what you need.
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •