I am baking some textures using the “Bake Texture” node.
The problem is that I get textures with very jagged edges. Also, it looks like the jagged edges have no opacity (i.e. I can see through to what is behind). I have not set any opacity.
I thought that I could by setting additional pixels at border…
http://www.sidefx.com/docs/houdini/nodes/out/baketexture.html#vm_uvpostprocess [www.sidefx.com]
Or by setting anti-aliasing…
http://www.sidefx.com/docs/houdini/nodes/out/baketexture.html#vm_dorayvariance [www.sidefx.com]
But neither seems to solve the problem.
Any suggestions?
Baking textures creates jagged edges
3767 2 2- phtj
- Member
- 224 posts
- Joined: 6月 2009
- Offline
- phtj
- Member
- 224 posts
- Joined: 6月 2009
- Offline
I made some progress… It is do do with using PNG format.
If I open the .rat file in MPlay, I can look at the different image planes
If I go to “bascolor” plane, and save as PNG and switch on “Convert to Image Format's Colorspace”, then actually all the extra pixels around each texture around the border of the textures get remove. Even though I set Alpha=none in Mplay export settings, it seems there is still an alpha being applied. This is a little confusing why this is happening.
If in MPlay export I switch off the “Convert to Image Format's Colorspace”, then the extra pixels are kept, and as a result, when the textures are applied to the model, there are no more jagged edges.
I am assuming that when the “Bake Texture” node exports these textures, it is also automatically converting to the PNG colorspace, resulting in the jagged edges.
Another solution is to use JPG instead of PNG, which also solves the problem… the “Bake Texture” node then exports the correct image for texturing.
If I open the .rat file in MPlay, I can look at the different image planes
If I go to “bascolor” plane, and save as PNG and switch on “Convert to Image Format's Colorspace”, then actually all the extra pixels around each texture around the border of the textures get remove. Even though I set Alpha=none in Mplay export settings, it seems there is still an alpha being applied. This is a little confusing why this is happening.
If in MPlay export I switch off the “Convert to Image Format's Colorspace”, then the extra pixels are kept, and as a result, when the textures are applied to the model, there are no more jagged edges.
I am assuming that when the “Bake Texture” node exports these textures, it is also automatically converting to the PNG colorspace, resulting in the jagged edges.
Another solution is to use JPG instead of PNG, which also solves the problem… the “Bake Texture” node then exports the correct image for texturing.
Patrick
- dlee
- スタッフ
- 442 posts
- Joined: 9月 2016
- Offline
Hi. the issue here is likely due to alpha getting premultiplied when the .png images are being loaded (the border expansion post process do not apply to alpha). If you open up the .png images in COP and set premultiply option to “leave unpremultiplied” you'll see that RGB channels have expanded borders. You can opt not store alpha channel on select image planes in Bake Texture ROP by changing “Copy Alpha to Planes” parameter (under Advanced->Driver tab).
-
- Quick Links