Jump to content

Bake normals


Recommended Posts

Hi! I have a problem with normal map baking. I want to bake normals to texture. Then I want to load this tex by point sop to restore them from texture.

1. I'm fiting N to 0 -1 and transfering N to Cd

2. Then I'm rendering Cd to float tex by mantra -u mode without dithering and with pixel filter minmax edge

3. Than I'm loading this texture into point sop into normal fields by such expression: tex(chs("$HOME/Desktop/testPoint.tiff"), $MAPU, $MAPV, D_CR) for the X channel. And so on for Y and Z.

4. Than i'm simply fitting normal range to -1 - 1 values.

But normals are going to be mad!

What's wrong? Thanks

Edited by Nasyrov
Link to comment
Share on other sites

Hi! I have a problem with normal map baking. I want to bake normals to texture. Then I want to load this tex by point sop to restore them from texture.

1. I'm fiting N to 0 -1 and transfering N to Cd

2. Then I'm rendering Cd to float tex by mantra -u mode without dithering and with pixel filter minmax edge

3. Than I'm loading this texture into point sop into normal fields by such expression: tex(chs("$HOME/Desktop/testPoint.tiff"), $MAPU, $MAPV, D_CR) for the X channel. And so on for Y and Z.

4. Than i'm simply fitting normal range to -1 - 1 values.

But normals are going to be mad!

What's wrong? Thanks

You're rendering normals in camera space and apply them in object space... before saving normals in shader in Cd you should do something like:

oN = ntransform("space:object", N);

Also keep in mind that applying colors to points is a way faster vis VOPs rather than expressions, what could make a difference for you in case of bigger geometry.

Hope this helps.

sy.

PS I hope you aren't computing this way basic normals for your geometry ;)

Edited by SYmek
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...