Getting proper normals on a grid mesh with vertex offsets?

Discussion in 'Rendering Technology and APIs' started by BannedFromTheRanch, Apr 24, 2013.

  1. BannedFromTheRanch

    Newcomer

    Joined:
    Apr 24, 2013
    Messages:
    1
    Likes Received:
    0
    Hey all, newbie here and I have a quick question for anyone interested in aiding an answer. I am working on a Gerstner wave vertex shader based off this paper:

    http://http.developer.nvidia.com/GPUGems/gpugems_ch01.html

    I am trying to keep it simple at first by just dealing with vertex offsets and normals of one wave, not summed ones. It looks as though I have all of the vertex position offsets working as well as the computations for the normals, binormals, and tangent vectors (equations 9-12).

    The part I am a little stuck on is getting my subdivided grid to display the proper normal direction based on the wave.Currently, my code just offsets the vertex positions and keeps the normals all pointing in the up-vector (0,0,1) which prevents proper lighting. Has anyone here worked on this type of shader and can possibly help point me towards a proper solution? I think the problem possibly has to do with world transformations and some other math but again, am a little lost after this point.

    cheers
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...