Announcement

Collapse
No announcement yet.

Help with setting up Custom Texture Packer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with setting up Custom Texture Packer

    I am trying to create a custom texture with AO in the Blue channel and roughness in the Green channel. I am new to coding and I tried playing around with the Texture Packer .fx and .xml files but couldnt get either to work.
    In my best attempt I managed to get the AO in the Red channel and the specular in Blue and Green.

    How can I control which channel each texture is going into when baking?

    This is the custom Texture .fx and .xml code. I am using the specular texture slot for my roughness since there was no slot for roughness.

    // specular/ao
    sOutput.m_vTexture2 = float4(LinearTosRgb(sInput.m_fAmbientOcclusion), (sInput.m_fAmbientOcclusion), sInput.m_vSpecularColor);

    <Texture2 Suffix="_SpecularColor" />
    Attached Files

  • #2
    Hello,

    Gloss and roughness are opposites (though sometimes squared). You can use gloss in the Modeler so it renders correctly, and then just convert it in the texture packer. The UE4 packer does this, if you want to take a look at that.

    You only need to convert colors to sRGB, not any of the grayscale values like AO or gloss/roughness.

    This should do what you want, though you can also put something in red and alpha if you wish.

    sOutput.m_vTexture2.g = 1.0 - sInput.m_fGloss;
    sOutput.m_vTexture2.b = sInput.m_fAmbientOcclusion;

    Comment


    • #3
      Thank you, this is exactly what I needed!

      Much appreciated

      Comment

      Working...
      X