[2.x] About custom_materialBuffer
Posted: Fri Mar 09, 2018 10:27 am
Hi!
In Structs_piece_vs_piece_ps.hlsl, The material is declared as follows:
However, the indices are commented out in OgreHlmsPbsDatablock.h, so my new members are added directly after "reserved". But the size in C++ side is still
So I had to move @insertpiece thing BEFORE uint4 indices0_3 to make it work.
Is it intentional? Or we can simply remove indices0_3 and indices4_7 in the shader's struct and adjust MaterialSizeInGpu in C++ code?
Thanks!
In Structs_piece_vs_piece_ps.hlsl, The material is declared as follows:
Code: Select all
struct Material
{
...
float4 emissive; //emissive.w contains mNormalMapWeight.
float4 reserved[3];
uint4 indices0_3;
uint4 indices4_7;
@insertpiece( custom_materialBuffer )
};
Code: Select all
const size_t HlmsPbsDatablock::MaterialSizeInGpu = 64 * 4 + NUM_PBSM_TEXTURE_TYPES * 2;
Is it intentional? Or we can simply remove indices0_3 and indices4_7 in the shader's struct and adjust MaterialSizeInGpu in C++ code?
Thanks!