scene/records/materials.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-License-Identifier: BSD-3-Clause | ||
| 2 | #pragma once | ||
| 3 | |||
| 4 | #include "chrono_batch_render/stage/schema/types.h" | ||
| 5 | |||
| 6 | namespace chrono::batch_render { | ||
| 7 | |||
| 8 | static const uint kDefinitionDiffuse = 0; | ||
| 9 | static const uint kDefinitionPreviewConstant = 1; | ||
| 10 | static const uint kDefinitionPreviewTextured = 2; | ||
| 11 | static const uint kDefinitionPlaceholder = 3; | ||
| 12 | static const uint kDefinitionHapke = 4; | ||
| 13 | static const uint kDefinitionLommelSeeliger = 5; | ||
| 14 | static const uint kDefinitionLunarLambert = 6; | ||
| 15 | static const uint kDefinitionOrenNayar = 7; | ||
| 16 | |||
| 17 | CHRONO_BATCH_RENDER_ENUM(TextureChannel){ | ||
| 18 | Rgb, | ||
| 19 | R, | ||
| 20 | G, | ||
| 21 | B, | ||
| 22 | A, | ||
| 23 | }; | ||
| 24 | |||
| 25 | CHRONO_BATCH_RENDER_ENUM(PreviewInput){ | ||
| 26 | DiffuseColor, | ||
| 27 | EmissiveColor, | ||
| 28 | SpecularColor, | ||
| 29 | Metallic, | ||
| 30 | Roughness, | ||
| 31 | Clearcoat, | ||
| 32 | ClearcoatRoughness, | ||
| 33 | Opacity, | ||
| 34 | Occlusion, | ||
| 35 | Normal, | ||
| 36 | DetailNormal, | ||
| 37 | DetailAlbedo, | ||
| 38 | Displacement, | ||
| 39 | }; | ||
| 40 | |||
| 41 | static const uint kPreviewInputs = 13; | ||
| 42 | |||
| 43 | struct MaterialRecord { | ||
| 44 | uint definition; | ||
| 45 | uint words; | ||
| 46 | uint previousDefinition; | ||
| 47 | uint previousWords; | ||
| 48 | }; | ||
| 49 | |||
| 50 | CHRONO_BATCH_RENDER_CHECK_SIZE(MaterialRecord, 16); | ||
| 51 | |||
| 52 | struct TextureInput { | ||
| 53 | uint64_t handle; | ||
| 54 | uint channel; | ||
| 55 | uint spectrum; | ||
| 56 | Float4 scale; | ||
| 57 | Float4 bias; | ||
| 58 | }; | ||
| 59 | |||
| 60 | CHRONO_BATCH_RENDER_CHECK_SIZE(TextureInput, 48); | ||
| 61 | |||
| 62 | struct MappingRecord { | ||
| 63 | uint projection; | ||
| 64 | uint projectionSpace; | ||
| 65 | uint uvPrimvar; | ||
| 66 | float tileSize; | ||
| 67 | float triplanarBlend; | ||
| 68 | Float2 uvScale; | ||
| 69 | Float2 uvOffset; | ||
| 70 | float uvRotation; | ||
| 71 | uint hexTiling; | ||
| 72 | float hexTilingContrast; | ||
| 73 | float hexTilingRotation; | ||
| 74 | uint padding0; | ||
| 75 | uint padding1; | ||
| 76 | uint padding2; | ||
| 77 | }; | ||
| 78 | |||
| 79 | CHRONO_BATCH_RENDER_CHECK_SIZE(MappingRecord, 64); | ||
| 80 | |||
| 81 | struct DetailRecord { | ||
| 82 | Float3 normal; | ||
| 83 | float normalStrength; | ||
| 84 | Float3 detailNormal; | ||
| 85 | float detailNormalStrength; | ||
| 86 | Float3 detailAlbedo; | ||
| 87 | float detailAlbedoStrength; | ||
| 88 | Float2 detailScale; | ||
| 89 | Float2 detailOffset; | ||
| 90 | float detailRotation; | ||
| 91 | uint detailHexTiling; | ||
| 92 | uint enableDetail; | ||
| 93 | uint padding0; | ||
| 94 | }; | ||
| 95 | |||
| 96 | CHRONO_BATCH_RENDER_CHECK_SIZE(DetailRecord, 80); | ||
| 97 | |||
| 98 | struct PreviewParams { | ||
| 99 | Float3 diffuseColor; | ||
| 100 | uint useSpecularWorkflow; | ||
| 101 | Float3 emissiveColor; | ||
| 102 | float metallic; | ||
| 103 | Float3 specularColor; | ||
| 104 | float roughness; | ||
| 105 | float ior; | ||
| 106 | float clearcoat; | ||
| 107 | float clearcoatRoughness; | ||
| 108 | float opacity; | ||
| 109 | MappingRecord mapping; | ||
| 110 | DetailRecord detail; | ||
| 111 | TextureInput inputs[kPreviewInputs]; | ||
| 112 | }; | ||
| 113 | |||
| 114 | CHRONO_BATCH_RENDER_CHECK_SIZE(PreviewParams, 832); | ||
| 115 | |||
| 116 | static const uint kPlanetaryInputs = 7; | ||
| 117 | static const uint kPlanetaryValues = kPlanetaryInputs - 1; | ||
| 118 | static const uint kDetailInputs = 3; | ||
| 119 | |||
| 120 | struct PlanetaryParams { | ||
| 121 | Float3 albedo; | ||
| 122 | uint textured; | ||
| 123 | float values[kPlanetaryValues]; | ||
| 124 | uint padding0; | ||
| 125 | uint padding1; | ||
| 126 | MappingRecord mapping; | ||
| 127 | DetailRecord detail; | ||
| 128 | TextureInput inputs[kPlanetaryInputs]; | ||
| 129 | TextureInput details[kDetailInputs]; | ||
| 130 | }; | ||
| 131 | |||
| 132 | CHRONO_BATCH_RENDER_CHECK_SIZE(PlanetaryParams, 672); | ||
| 133 | |||
| 134 | 7701 | struct RadioRecord { | |
| 135 | uint kind; | ||
| 136 | uint valid; | ||
| 137 | float rmsHeight; | ||
| 138 | float correlationLength; | ||
| 139 | Float4 data; | ||
| 140 | }; | ||
| 141 | |||
| 142 | CHRONO_BATCH_RENDER_CHECK_SIZE(RadioRecord, 32); | ||
| 143 | |||
| 144 | struct CheckerRecord { | ||
| 145 | Float3 colorA; | ||
| 146 | uint enabled; | ||
| 147 | Float3 colorB; | ||
| 148 | float size; | ||
| 149 | uint axis; | ||
| 150 | uint padding0; | ||
| 151 | uint padding1; | ||
| 152 | uint padding2; | ||
| 153 | }; | ||
| 154 | |||
| 155 | CHRONO_BATCH_RENDER_CHECK_SIZE(CheckerRecord, 48); | ||
| 156 | |||
| 157 | } | ||
| 158 |