|
1 | | -[nzsl_version("1.0")] |
| 1 | +[nzsl_version("1.1")] |
2 | 2 | module TSOM.BlockPBR; |
3 | 3 |
|
4 | 4 | import InstanceData from Engine.InstanceData; |
@@ -28,31 +28,33 @@ option HasNormalTexture: bool = false; |
28 | 28 | option HasRoughnessTexture: bool = false; |
29 | 29 | option HasSpecularTexture: bool = false; |
30 | 30 |
|
| 31 | +const InvalidLoc = u32.Max; |
| 32 | + |
31 | 33 | // Billboard related options |
32 | 34 | option Billboard: bool = false; |
33 | | -option BillboardCenterLocation: i32 = -1; |
34 | | -option BillboardColorLocation: i32 = -1; |
35 | | -option BillboardSizeRotLocation: i32 = -1; |
| 35 | +option BillboardCenterLocation: u32 = InvalidLoc; |
| 36 | +option BillboardColorLocation: u32 = InvalidLoc; |
| 37 | +option BillboardSizeRotLocation: u32 = InvalidLoc; |
36 | 38 |
|
37 | 39 | // Vertex declaration related options |
38 | | -option VertexColorLoc: i32 = -1; |
39 | | -option VertexNormalLoc: i32 = -1; |
40 | | -option VertexPositionLoc: i32; |
41 | | -option VertexTangentLoc: i32 = -1; |
42 | | -option VertexUvLoc: i32 = -1; |
| 40 | +option VertexColorLoc: u32 = InvalidLoc; |
| 41 | +option VertexNormalLoc: u32 = InvalidLoc; |
| 42 | +option VertexPositionLoc: u32 = InvalidLoc; |
| 43 | +option VertexTangentLoc: u32 = InvalidLoc; |
| 44 | +option VertexUvLoc: u32 = InvalidLoc; |
43 | 45 |
|
44 | | -option VertexJointIndicesLoc: i32 = -1; |
45 | | -option VertexJointWeightsLoc: i32 = -1; |
| 46 | +option VertexJointIndicesLoc: u32 = InvalidLoc; |
| 47 | +option VertexJointWeightsLoc: u32 = InvalidLoc; |
46 | 48 |
|
47 | | -option MaxLightCount: u32 = u32(3); //< FIXME: Fix integral value types |
| 49 | +option MaxLightCount: u32 = 3; |
48 | 50 |
|
49 | | -const HasNormal = (VertexNormalLoc >= 0); |
50 | | -const HasVertexColor = (VertexColorLoc >= 0); |
| 51 | +const HasNormal = (VertexNormalLoc != InvalidLoc); |
| 52 | +const HasVertexColor = (VertexColorLoc != InvalidLoc); |
51 | 53 | const HasColor = (HasVertexColor || Billboard); |
52 | | -const HasTangent = (VertexTangentLoc >= 0); |
53 | | -const HasUV = (VertexUvLoc >= 0); |
| 54 | +const HasTangent = (VertexTangentLoc != InvalidLoc); |
| 55 | +const HasUV = (VertexUvLoc != InvalidLoc); |
54 | 56 | const HasNormalMapping = HasNormalTexture && HasNormal && HasTangent && !DepthPass; |
55 | | -const HasSkinning = (VertexJointIndicesLoc >= 0 && VertexJointWeightsLoc >= 0); |
| 57 | +const HasSkinning = (VertexJointIndicesLoc != InvalidLoc && VertexJointWeightsLoc != InvalidLoc); |
56 | 58 |
|
57 | 59 | [layout(std140)] |
58 | 60 | struct MaterialSettings |
|
0 commit comments