Jump to content

ROP File Output: Render png or tiff with alpha channel (Instead of transparency)


Recommended Posts

Hi there !

I have in my houdini file a COP2 network making some changes to textures on my hard-drive, and then outputting those textures with a ‘ROP File Output’ node.
Those textures are actually a set of Masks, each channel is a different mask (R=Metallic,G=AO,B=Emisside and A=Smoothness)

This is working nicely, but here is the issue:
Those outputted .png or .tif files are using the alpha channel as transparency, and if I open them with Photoshop, there is no accessible alpha channel, and instead all my RGB channels are displayed with transparency.
Basically, I cannot use those textures as they are, they are completely impossible for an artist to author in Photoshop.

Is there any way to export/render a COP network into a .png or tiff file, and keep a clear visible alpha channel, accessible in Photoshop ?

Link to comment
Share on other sites

Consider using EXR file format and apply your custom channels but not in RGBA plane but make your custom channels like Metallic, AO, Emmis, Smooth etc. EXR can handle any number of custom channels.  Every software which can open EXR allows you to pick any of your custom channel and operate with it like you would do with any grayscale image.  

If you really want  PNG or TIF you have to render files without premultiplication (premultiplication will multiply each R,G and B by Alpha and that's not what you want) and store all 4 channels in RGBA.

In general, Color plane is not good way  for exporting custom data (masks are ok) because color plane uses gamma curve which is applied to data, also it clamps negative range etc        

Link to comment
Share on other sites

Thank you for your answer djiki !

I really want to avoid using EXR, those files are meant to be used by a game engine that does not digest EXR very well. Also, the generated files are meant to be distributed as a package on the web, and EXR files are really heavy.

Could you give me a clue as to how to proceed, to get a png/tif file that is not pre-multiplied ?
When exporting in those formats,"C A" is the only plane scope that the ROP File Output is allowing me to use, so I can rename my channels the way I want, they are always exported as Color+Alpha.
I also tried selecting "Unpremultiplied" as the PNG Premultiplication in the matadata tab of the ROP File Output, but without success.

Also a note, these customs data come from existing textures, generator by other softwares, that I am basically re-packing and modifying (Changing uvs of geometry, etc), and I have disabled all gamma alteration of the imported data, so I should get outputted values identical to the inputted ones.

Link to comment
Share on other sites

  • 3 years later...

I also tried selecting "Unpremultiplied" as the PNG Premultiplication in the matadata tab of the ROP File Output, but without success.

Late to reply on this but I ran into the same issues and I think this is worth posting as otherwise COPS becomes a dead end for game artists...

I was caught with the same problem and the unpremultiplied option on the metadata tab worked for me. When importing to confirm on the file node you also need to set Premultiply to Leave Unpremultiplied. If you do this you should get the same result from before you export in the file node. ie the alpha is present on its own channel your individual channels should look the same as pre export, not multiplied by the alpha. You can also confirm this by bringing the image into Nuke or in an engine like Unity. In my case Im happy that COPs can export unpremultiplied .png. with the setting on the metadata tab and I have got what I need in engine.  

However when I bring the png into Photoshop my unpremultiplied .png a transparent background does not have a seperate alpha ie it is premultiplied on import. I am not sure how to get around this or if there is a way to import into PS while treating the alpha as a channel, much like the way we get with .exr

I suspect that this is a more general issue with how PS handles alpha channels/transparency. There have been various disagreements on adobe forums involving vfx/game professional running into issues with how alphas are handled for .png. For example https://community.adobe.com/t5/photoshop-ecosystem-discussions/png-not-opening-with-alpha-channel/m-p/9844587 and I remember another one a few years back around the way .exr alpha was handled which resulted in the little pop up you get on import with .exr for how to treat the alpha. 

As am afterthought I exported .tga with the setting above, Unpremultiplied in the metadata tab and in the file node set to Leave Unpremultiply and this works fine. 

Then brought the .tga into Photoshop and this comes in with a seperate alpha! So perhaps .tga could be a work around for some people. 

 

 

 

 

 

FileunpreMult.jpg

unpremult.jpg

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...