Added: 1 year ago
From: ChenZheChina
Views: 2,685
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (5)

Sign In or Sign Up now to post a comment!
  • ok I've thought an easy way, the ddx cross! ddy could be calculated in the vertex through a shift of a pixel(texcoord.xy) and a minus of the two plus a subsequent normalization, could be?

  • @xdxxdy For each vertex in a triangle, I passed x coord, y coord and height value of other two vertices into vertex shader. Therefore, when the vertex shader calculates normal for a vertex, it first calculates exact positions of all three vertices of the triangle, and then calculate the normal by crossing v0v1 and v0v2.

  • hi, I'm interested about the method you have uset to calculate the normals in the vertex shader(dx9? 10? 11?), I've tried tex2Dlod to manipulate the position.z but have no idea about the method used to obtain a normal, in the pixel shader could be made by ddx(dot)ddy. If you have a method to interpolate the calculated normals in the vertex shader please reply.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more