The input consists of all of the maps from the material, already with texture/color adjustments applied, along with a few extra pieces of information and utilities (like noise). The output structure simply contains all of the possible RGBA outputs (up to 16). The packing process tries to be as smart as possible when writing out the textures. r, you will get a grayscale/luminance texture. Rgba, you will get a full 4 channel texture on disk. In this example texture packer, we will write color and opacity into one texture, and normal and gloss into another. Our game requires normal maps with green flipped the other way from the SpeedTree Modeler (which is a common change to make). The XML file that describes this texture packer should be saved into a file called “Example.xml” in the /texture_packing directory. It describes the two textures that will be written, and also points to the shader to be used to fill them up. The shader itself should be saved into a file called “Example.fx” to match the filename declared in the XML file. The green channel of the normal map is flipped before saving. SInput.m_vNormal.b = 1.0 - sInput.m_vNormal.b // flipped green from the Modeler SOutput.m_vTexture0 = float4(LinearTosRgb(sInput.m_vColor), sInput.m_fOpacity) Void TexturePacking(STexturePackingInput sInput, inout STexturePackingOutput sOutput) Additionally, all processing in the Modeler is done in linear color space, so we must convert the color to sRGB color space before saving by using the LinearTosRgb utility function.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |