meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
texturepacking [2020/08/10 11:29] – croft | texturepacking [2023/04/03 18:39] (current) – steph.jorgensen | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ======Texture | + | ======Texture |
During [[expgame|game format exporting]], | During [[expgame|game format exporting]], | ||
Line 5: | Line 5: | ||
The Modeler comes with a number of different texture packers for various engines, depending on which version of the Modeler you are using. You can edit these or even make your own if you need something different. | The Modeler comes with a number of different texture packers for various engines, depending on which version of the Modeler you are using. You can edit these or even make your own if you need something different. | ||
- | {{ ::texture_packing.png? | + | {{texture_packing.png? |
Line 16: | Line 16: | ||
| < | | < | ||
- | | | MipGenerationFlag - Can be " | + | | | Type - The type of data to write to disk or in the mesh/ |
- | | | Skip - Skip this texture entirely. Omitting a Texture* tag will also skip it. | | + | | | MipGenerationFlag - Can be " |
+ | | | Skip - Skip this texture entirely. Omitting a Texture tag will also skip it. | | ||
Line 72: | Line 73: | ||
}; | }; | ||
- | =====Custom Example===== | + | =====Custom |
+ | |||
+ | 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 <app install>/ | ||
+ | |||
+ | <?xml version=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | |||
+ | |||
+ | The shader itself should be saved into a file called " | ||
+ | |||
+ | void TexturePacking(STexturePackingInput sInput, inout STexturePackingOutput sOutput) | ||
+ | { | ||
+ | // color/ | ||
+ | sOutput.m_vTexture0 = float4(LinearTosRgb(sInput.m_vColor), | ||
+ | |||
+ | // normal/ | ||
+ | sInput.m_vNormal.b = 1.0 - sInput.m_vNormal.b; | ||
+ | sOutput.m_vTexture1 = float4(sInput.m_vNormal, | ||
+ | } | ||
+ | |||
+ | |||
+ | Once these files are saved, the new " | ||
+ | |||
+ | {{texture_packing_gui.png? | ||
+ | |||