Datasets:
Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +4 -0
- objects/appleseed_endtable/materials/omniverse/simready_content/materials/SimPBR.mdl +562 -0
- objects/appleseed_endtable/materials/omniverse/simready_content/materials/SimPBR_Model.mdl +212 -0
- objects/appleseed_endtable/materials/omniverse/simready_content/materials/baking_annotations.mdl +38 -0
- objects/av_book_01/av_book_01.usd +0 -0
- objects/av_book_33/av_book_33.usd +0 -0
- objects/av_book_51/av_book_51.usd +0 -0
- objects/av_book_51/materials/omniverse/ArchVis/Residential/Decor/Books/Textures/Cover_51.png +3 -0
- objects/av_book_51/materials/omniverse/ArchVis/Residential/Decor/Books/Textures/Cover_Full_ORM.png +3 -0
- objects/av_book_51/materials/omniverse/ArchVis/Residential/Decor/Books/Textures/Side_Pages.jpg +3 -0
- objects/av_book_66/av_book_66.usd +0 -0
- objects/av_book_77/av_book_77.usd +0 -0
- objects/av_book_99/av_book_99.usd +0 -0
- objects/av_eraser/av_eraser.usd +0 -0
- objects/av_eraser/materials/omniverse/ArchVis/Residential/Misc/Supplies/textures/Eraser_BaseColor.tga +3 -0
- objects/av_eraser/materials/omniverse/ArchVis/Residential/Misc/Supplies/textures/Eraser_Metalness.tga +3 -0
- objects/av_eraser/materials/omniverse/ArchVis/Residential/Misc/Supplies/textures/Eraser_Normal.tga +3 -0
- objects/av_eraser/materials/omniverse/ArchVis/Residential/Misc/Supplies/textures/Eraser_Roughness.tga +3 -0
- objects/av_photoalbum_closed/av_photoalbum_closed.usd +0 -0
- objects/av_photoalbum_closed/materials/omniverse/ArchVis/Residential/Decor/Books/Textures/PhotoAlbum_Closed_BaseColor.png +3 -0
- objects/av_photoalbum_closed/materials/omniverse/ArchVis/Residential/Decor/Books/Textures/PhotoAlbum_Closed_Normal.png +3 -0
- objects/av_photoalbum_closed/materials/omniverse/ArchVis/Residential/Decor/Books/Textures/PhotoAlbum_Closed_ORM.png +3 -0
- objects/av_stawberry/materials/omniverse/ArchVis/Residential/Food/Berries/Textures/P_Strawberry_BaseColor.png +3 -0
- objects/av_stawberry/materials/omniverse/ArchVis/Residential/Food/Berries/Textures/P_Strawberry_Normal.png +3 -0
- objects/av_stawberry/materials/omniverse/ArchVis/Residential/Food/Berries/Textures/P_Strawberry_ORM.png +3 -0
- objects/av_stawberry/materials/omniverse/ArchVis/Residential/Food/Berries/Textures/P_Strawberry_Roughness.png +3 -0
- objects/avocado01/materials/robolab/objects/fruits_veggies/materials/SimPBR.mdl +562 -0
- objects/avocado01/materials/robolab/objects/fruits_veggies/materials/SimPBR_Model.mdl +212 -0
- objects/avocado01/materials/robolab/objects/fruits_veggies/materials/baking_annotations.mdl +38 -0
- objects/blue_block/blue_block.usd +0 -0
- objects/brick/materials/robolab/objects/ycb/textures/obj_000021.png +3 -0
- objects/contemporary_lockedstorage/materials/omniverse/simready_content/materials/SimPBR.mdl +562 -0
- objects/contemporary_lockedstorage/materials/omniverse/simready_content/materials/SimPBR_Model.mdl +212 -0
- objects/contemporary_lockedstorage/materials/omniverse/simready_content/materials/baking_annotations.mdl +38 -0
- objects/contemporary_lowfulldesk/materials/omniverse/simready_content/materials/SimPBR.mdl +562 -0
- objects/contemporary_lowfulldesk/materials/omniverse/simready_content/materials/SimPBR_Model.mdl +212 -0
- objects/contemporary_lowfulldesk/materials/omniverse/simready_content/materials/baking_annotations.mdl +38 -0
- objects/fork_big/materials/robolab/objects/vomp/fork_big/textures/Fork_Big_Metallic.png +3 -0
- objects/fstylejug_a01/materials/omniverse/simready_content/common_assets/props/fstylejug_a01/textures/T_Plastic_Glossy_White_A_Albedo.png +3 -0
- objects/fstylejug_a01/materials/omniverse/simready_content/common_assets/props/fstylejug_a01/textures/T_Plastic_Glossy_White_A_Normal.png +3 -0
- objects/fstylejug_a01/materials/omniverse/simready_content/common_assets/props/fstylejug_a01/textures/T_Plastic_Glossy_White_A_ORM.png +3 -0
- objects/fstylejug_a02/materials/omniverse/simready_content/common_assets/props/fstylejug_a02/materials/Natural_Plastic_E.mdl +171 -0
- objects/fstylejug_a02/materials/omniverse/simready_content/common_assets/props/fstylejug_a02/materials/Plastic_Glossy_White_A.mdl +36 -0
- objects/glasses/materials/robolab/objects/hot3d/textures/obj_000023.png +3 -0
- objects/ketchup_bottle/materials/robolab/objects/hope/textures/obj_000011.png +3 -0
- objects/lime01/materials/robolab/objects/fruits_veggies/materials/SimPBR.mdl +562 -0
- objects/lime01/materials/robolab/objects/fruits_veggies/materials/baking_annotations.mdl +38 -0
- objects/orange_02/materials/robolab/objects/fruits_veggies/materials/SimPBR.mdl +562 -0
- objects/orange_02/materials/robolab/objects/fruits_veggies/materials/SimPBR_Model.mdl +212 -0
- objects/orange_02/materials/robolab/objects/fruits_veggies/materials/baking_annotations.mdl +38 -0
.gitattributes
CHANGED
|
@@ -58,3 +58,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
# Video files - compressed
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
+
objects/av_eraser/materials/omniverse/ArchVis/Residential/Misc/Supplies/textures/Eraser_Normal.tga filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
objects/av_eraser/materials/omniverse/ArchVis/Residential/Misc/Supplies/textures/Eraser_BaseColor.tga filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
objects/av_eraser/materials/omniverse/ArchVis/Residential/Misc/Supplies/textures/Eraser_Metalness.tga filter=lfs diff=lfs merge=lfs -text
|
| 64 |
+
objects/av_eraser/materials/omniverse/ArchVis/Residential/Misc/Supplies/textures/Eraser_Roughness.tga filter=lfs diff=lfs merge=lfs -text
|
objects/appleseed_endtable/materials/omniverse/simready_content/materials/SimPBR.mdl
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*****************************************************************************
|
| 2 |
+
* Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
******************************************************************************
|
| 4 |
+
|
| 5 |
+
MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
|
| 6 |
+
WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
|
| 7 |
+
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 8 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
| 9 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
| 10 |
+
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
|
| 11 |
+
CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
|
| 12 |
+
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
| 13 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
| 14 |
+
THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
|
| 15 |
+
THE MDL MATERIALS.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
mdl 1.4;
|
| 19 |
+
|
| 20 |
+
import ::df::*;
|
| 21 |
+
import ::state::*;
|
| 22 |
+
import ::math::*;
|
| 23 |
+
import ::base::*;
|
| 24 |
+
import ::tex::*;
|
| 25 |
+
import ::anno::*;
|
| 26 |
+
|
| 27 |
+
import ::nvidia::core_definitions::file_texture;
|
| 28 |
+
import ::nvidia::core_definitions::normalmap_texture;
|
| 29 |
+
|
| 30 |
+
using .::SimPBR_Model import *;
|
| 31 |
+
using .::baking_annotations import *;
|
| 32 |
+
|
| 33 |
+
export material SimPBR(
|
| 34 |
+
// -------------------- DIFFUSE REFLECTION ----------------------
|
| 35 |
+
color diffuse_color_constant = color(0.2f)
|
| 36 |
+
[[
|
| 37 |
+
anno::display_name("Albedo Base Color"),
|
| 38 |
+
anno::description("The base albedo color to use if no texture is specified"),
|
| 39 |
+
anno::in_group("Diffuse")
|
| 40 |
+
]],
|
| 41 |
+
uniform texture_2d diffuse_texture = texture_2d()
|
| 42 |
+
[[
|
| 43 |
+
anno::display_name("Albedo Map"),
|
| 44 |
+
anno::description("The texture specifying the albedo value to use"),
|
| 45 |
+
anno::in_group("Diffuse")
|
| 46 |
+
]],
|
| 47 |
+
uniform color diffuse_tint = color(1.0f)
|
| 48 |
+
[[
|
| 49 |
+
anno::display_name("Albedo Tint"),
|
| 50 |
+
anno::description("This tints the albedo color or texture contant"),
|
| 51 |
+
anno::in_group("Diffuse")
|
| 52 |
+
]],
|
| 53 |
+
uniform bool enable_transmission = false
|
| 54 |
+
[[
|
| 55 |
+
anno::display_name("Enable Diffuse Transmission"),
|
| 56 |
+
anno::description("Enables the diffuse transmission of light through thin diffuse scattering layer"),
|
| 57 |
+
anno::in_group("Diffuse")
|
| 58 |
+
]],
|
| 59 |
+
uniform float opacity_ratio = 1.f
|
| 60 |
+
[[
|
| 61 |
+
anno::enable_if("enable_transmission == true"),
|
| 62 |
+
anno::display_name("Opacity Ratio"),
|
| 63 |
+
anno::description("Amount of opacity"),
|
| 64 |
+
anno::in_group("Diffuse")
|
| 65 |
+
]],
|
| 66 |
+
uniform color opacity_tint = color(1.0f)
|
| 67 |
+
[[
|
| 68 |
+
anno::enable_if("enable_transmission == true"),
|
| 69 |
+
anno::display_name("Diffuse transmission tint"),
|
| 70 |
+
anno::description("Base diffuse transmission color"),
|
| 71 |
+
anno::in_group("Diffuse")
|
| 72 |
+
]],
|
| 73 |
+
uniform float opacity_multiplier = 1.f
|
| 74 |
+
[[
|
| 75 |
+
anno::enable_if("enable_transmission == true"),
|
| 76 |
+
anno::display_name("Diffuse transmission multiplier"),
|
| 77 |
+
anno::description("Base diffuse transmission multiplier"),
|
| 78 |
+
anno::in_group("Diffuse")
|
| 79 |
+
]],
|
| 80 |
+
|
| 81 |
+
// -------------------- SPECULAR REFLECTION ----------------------
|
| 82 |
+
float reflection_roughness_constant = 0.5f
|
| 83 |
+
[[
|
| 84 |
+
anno::display_name("Roughness Amount"),
|
| 85 |
+
anno::hard_range(0.0,1.),
|
| 86 |
+
anno::description("Higher roughness values lead to more blurry reflections"),
|
| 87 |
+
anno::in_group("Specular")
|
| 88 |
+
]],
|
| 89 |
+
uniform float reflection_roughness_texture_influence = 0.0f
|
| 90 |
+
[[
|
| 91 |
+
anno::display_name("Roughness Map Influence"),
|
| 92 |
+
anno::hard_range(0.0, 1.),
|
| 93 |
+
anno::description("Blends between the constant value and the lookup of the roughness texture"),
|
| 94 |
+
anno::in_group("Specular")
|
| 95 |
+
]],
|
| 96 |
+
uniform texture_2d reflectionroughness_texture = texture_2d()
|
| 97 |
+
[[
|
| 98 |
+
anno::display_name("Roughness Map"),
|
| 99 |
+
anno::in_group("Specular")
|
| 100 |
+
]],
|
| 101 |
+
|
| 102 |
+
float anisotropy_constant = 0.0f
|
| 103 |
+
[[
|
| 104 |
+
anno::display_name("Anisotropy Amount"),
|
| 105 |
+
anno::hard_range(-1.,1.),
|
| 106 |
+
anno::description("0 for isotropic, extents of -1 to 1 for anisotropy"),
|
| 107 |
+
anno::in_group("Specular")
|
| 108 |
+
]],
|
| 109 |
+
uniform float anisotropy_texture_influence = 0.0f
|
| 110 |
+
[[
|
| 111 |
+
anno::display_name("Anisotropy Map Influence"),
|
| 112 |
+
anno::hard_range(0.0, 1.),
|
| 113 |
+
anno::description("Blends between the constant value and the lookup of the anisotropy texture"),
|
| 114 |
+
anno::in_group("Specular")
|
| 115 |
+
]],
|
| 116 |
+
uniform texture_2d anisotropy_texture = texture_2d()
|
| 117 |
+
[[
|
| 118 |
+
anno::display_name("Anisotropy Map"),
|
| 119 |
+
anno::in_group("Specular")
|
| 120 |
+
]],
|
| 121 |
+
|
| 122 |
+
float metallic_constant = 0.f
|
| 123 |
+
[[
|
| 124 |
+
anno::display_name("Metallic Amount"),
|
| 125 |
+
anno::hard_range(0.0,1.),
|
| 126 |
+
anno::description("Metallic Material"),
|
| 127 |
+
anno::in_group("Specular")
|
| 128 |
+
]],
|
| 129 |
+
uniform float metallic_texture_influence = 0.0f
|
| 130 |
+
[[
|
| 131 |
+
anno::display_name("Metallic Map Influence"),
|
| 132 |
+
anno::hard_range(0.0, 1.),
|
| 133 |
+
anno::description("Blends between the constant value and the lookup of the metallic texture"),
|
| 134 |
+
anno::in_group("Specular")
|
| 135 |
+
]],
|
| 136 |
+
uniform texture_2d metallic_texture = texture_2d()
|
| 137 |
+
[[
|
| 138 |
+
anno::display_name("Metallic Map"),
|
| 139 |
+
anno::in_group("Specular")
|
| 140 |
+
]],
|
| 141 |
+
|
| 142 |
+
float specular_constant = 1.f
|
| 143 |
+
[[
|
| 144 |
+
anno::display_name("Specular amount"),
|
| 145 |
+
anno::hard_range(0.0, 1.0),
|
| 146 |
+
anno::description("Scale of the specular component"),
|
| 147 |
+
anno::in_group("Specular")
|
| 148 |
+
]],
|
| 149 |
+
uniform texture_2d specular_texture = texture_2d()
|
| 150 |
+
[[
|
| 151 |
+
anno::display_name("Specular Map"),
|
| 152 |
+
anno::in_group("Specular")
|
| 153 |
+
]],
|
| 154 |
+
|
| 155 |
+
// -------------------- ORM ----------------------
|
| 156 |
+
uniform bool enable_ORM_texture = true
|
| 157 |
+
[[
|
| 158 |
+
anno::display_name("Enable ORM Texture"),
|
| 159 |
+
anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
|
| 160 |
+
anno::in_group("Reflectivity")
|
| 161 |
+
]],
|
| 162 |
+
uniform texture_2d ORM_texture = texture_2d()
|
| 163 |
+
[[
|
| 164 |
+
anno::display_name("ORM Map"),
|
| 165 |
+
anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
|
| 166 |
+
anno::in_group("Reflectivity")
|
| 167 |
+
]],
|
| 168 |
+
|
| 169 |
+
// -------------------- Clearcoat ----------------------
|
| 170 |
+
uniform bool enable_clearcoat = false
|
| 171 |
+
[[
|
| 172 |
+
anno::display_name("Enable Clearcoat Layer"),
|
| 173 |
+
anno::description("Adds a clearcoat layer on top of the material when enabled"),
|
| 174 |
+
anno::in_group("Clearcoat")
|
| 175 |
+
]],
|
| 176 |
+
color clearcoat_tint = color(1.0f)
|
| 177 |
+
[[
|
| 178 |
+
anno::display_name("Clearcoat Tint"),
|
| 179 |
+
anno::description("Clearcoat is tinted and affects the underlying material"),
|
| 180 |
+
anno::in_group("Clearcoat")
|
| 181 |
+
]],
|
| 182 |
+
float clearcoat_transparency = 1.0f
|
| 183 |
+
[[
|
| 184 |
+
anno::display_name("Clearcoat Transparency"),
|
| 185 |
+
anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
|
| 186 |
+
"covering the underlying layer"),
|
| 187 |
+
anno::in_group("Clearcoat")
|
| 188 |
+
]],
|
| 189 |
+
float clearcoat_reflection_roughness = 0.0f
|
| 190 |
+
[[
|
| 191 |
+
anno::display_name("Clearcoat Roughness"),
|
| 192 |
+
anno::description("Higher roughness values lead to more blurry reflections"),
|
| 193 |
+
anno::hard_range(0.0f, 1.0f),
|
| 194 |
+
anno::in_group("Clearcoat")
|
| 195 |
+
]],
|
| 196 |
+
float clearcoat_weight = 1.0f
|
| 197 |
+
[[
|
| 198 |
+
anno::display_name("Clearcoat Weight"),
|
| 199 |
+
anno::description("Sets the weight for clearcoat layer"),
|
| 200 |
+
anno::hard_range(0.0f, 1.0f),
|
| 201 |
+
anno::in_group("Clearcoat")
|
| 202 |
+
]],
|
| 203 |
+
float clearcoat_flatten = 1.0f
|
| 204 |
+
[[
|
| 205 |
+
anno::display_name("Clearcoat Flatten"),
|
| 206 |
+
anno::description("Flattens the clearcoat to even out the underlying bump maps"),
|
| 207 |
+
anno::hard_range(0.0f, 1.0f),
|
| 208 |
+
anno::in_group("Clearcoat")
|
| 209 |
+
]],
|
| 210 |
+
float clearcoat_ior = 1.56f
|
| 211 |
+
[[
|
| 212 |
+
anno::display_name("Clearcoat IOR"),
|
| 213 |
+
anno::description("Sets the Index of refraction for the clearcoat layer"),
|
| 214 |
+
anno::soft_range(1.0f, 4.0f),
|
| 215 |
+
anno::in_group("Clearcoat")
|
| 216 |
+
]],
|
| 217 |
+
uniform float clearcoat_bump_factor = 1.f
|
| 218 |
+
[[
|
| 219 |
+
anno::display_name("Clearcoat Normal Map Strength"),
|
| 220 |
+
anno::description("Strength of normal map."),
|
| 221 |
+
anno::in_group("Clearcoat")
|
| 222 |
+
]],
|
| 223 |
+
|
| 224 |
+
float3 clearcoat_normal_input = float3(0.0, 0.0, 0.0),
|
| 225 |
+
uniform texture_2d clearcoat_normalmap_texture = texture_2d()
|
| 226 |
+
[[
|
| 227 |
+
anno::display_name("Clearcoat Normal Map"),
|
| 228 |
+
anno::description("Enables the usage of the normalmap texture"),
|
| 229 |
+
anno::in_group("Clearcoat")
|
| 230 |
+
]],
|
| 231 |
+
|
| 232 |
+
uniform bool clearcoat_flip_tangent_u = false
|
| 233 |
+
[[
|
| 234 |
+
anno::display_name("Clearcoat Normal Map Flip U Tangent"),
|
| 235 |
+
anno::in_group("Clearcoat")
|
| 236 |
+
]],
|
| 237 |
+
uniform bool clearcoat_flip_tangent_v = true
|
| 238 |
+
[[
|
| 239 |
+
anno::display_name("Clearcoat Normal Map Flip V Tangent"),
|
| 240 |
+
anno::in_group("Clearcoat")
|
| 241 |
+
]],
|
| 242 |
+
|
| 243 |
+
|
| 244 |
+
// -------------------- REFLECTIVITY ----------------------
|
| 245 |
+
uniform bool enable_retroreflection = false
|
| 246 |
+
[[
|
| 247 |
+
anno::display_name("Enable Retroreflection"),
|
| 248 |
+
anno::in_group("Reflectivity")
|
| 249 |
+
]],
|
| 250 |
+
color retroreflection_tint = color(.182,.800,.000)
|
| 251 |
+
[[
|
| 252 |
+
anno::display_name("Retro-reflection tint"),
|
| 253 |
+
anno::description("The tint of the retroreflection"),
|
| 254 |
+
anno::in_group("Reflectivity")
|
| 255 |
+
]],
|
| 256 |
+
uniform float normal_reflectivity = 0.5
|
| 257 |
+
[[
|
| 258 |
+
anno::display_name("Retro-reflection weight facing"),
|
| 259 |
+
anno::hard_range(0.0,1.),
|
| 260 |
+
anno::description("Reflectivity control for geometry facing the viewer"),
|
| 261 |
+
anno::in_group("Reflectivity")
|
| 262 |
+
]],
|
| 263 |
+
uniform float grazing_reflectivity = 1.0
|
| 264 |
+
[[
|
| 265 |
+
anno::display_name("Retro-reflection weight edge"),
|
| 266 |
+
anno::hard_range(0.0,1.),
|
| 267 |
+
anno::description("Reflectivity control for the reflectivity at geometry edges"),
|
| 268 |
+
anno::in_group("Reflectivity")
|
| 269 |
+
]],
|
| 270 |
+
|
| 271 |
+
// -------------------- AMBIENT OCCLUSION ----------------------
|
| 272 |
+
float ao_to_diffuse = 0.0
|
| 273 |
+
[[
|
| 274 |
+
anno::display_name("AO to Diffuse"),
|
| 275 |
+
anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
|
| 276 |
+
anno::in_group("AO")
|
| 277 |
+
]],
|
| 278 |
+
float ao_input = float(1.0),
|
| 279 |
+
uniform texture_2d ao_texture = texture_2d()
|
| 280 |
+
[[
|
| 281 |
+
anno::display_name("Ambient Occlusion Map"),
|
| 282 |
+
anno::description("The Ambient Occlusion texture for the material"),
|
| 283 |
+
anno::in_group("AO")
|
| 284 |
+
]],
|
| 285 |
+
|
| 286 |
+
// -------------------- EMISSIVE ----------------------
|
| 287 |
+
uniform bool enable_emission = false
|
| 288 |
+
[[
|
| 289 |
+
anno::display_name("Enable Emission"),
|
| 290 |
+
anno::description("Enables the emission of light from the material"),
|
| 291 |
+
anno::in_group("Emissive")
|
| 292 |
+
]],
|
| 293 |
+
uniform color emissive_color = color(1.0, 0.1, 0.1)
|
| 294 |
+
[[
|
| 295 |
+
anno::enable_if("enable_emission == true"),
|
| 296 |
+
anno::display_name("Emissive Color"),
|
| 297 |
+
anno::description("The emission color"),
|
| 298 |
+
anno::in_group("Emissive")
|
| 299 |
+
]],
|
| 300 |
+
|
| 301 |
+
color emissive_mask_input = color(1.0),
|
| 302 |
+
uniform texture_2d emissive_mask_texture = texture_2d()
|
| 303 |
+
[[
|
| 304 |
+
anno::enable_if("enable_emission == true"),
|
| 305 |
+
anno::display_name("Emissive Mask Map"),
|
| 306 |
+
anno::description("The texture masking the emissive color"),
|
| 307 |
+
anno::in_group("Emissive")
|
| 308 |
+
]],
|
| 309 |
+
uniform float emissive_intensity = 40.f
|
| 310 |
+
[[
|
| 311 |
+
anno::enable_if("enable_emission == true"),
|
| 312 |
+
anno::display_name("Emissive Intensity"),
|
| 313 |
+
anno::description("Intensity of the emission"),
|
| 314 |
+
anno::in_group("Emissive")
|
| 315 |
+
]],
|
| 316 |
+
uniform bool enable_emissive_flipbook = false
|
| 317 |
+
[[
|
| 318 |
+
anno::display_name("Enable Flipbook for emission"),
|
| 319 |
+
anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
|
| 320 |
+
anno::in_group("Emissive")
|
| 321 |
+
]],
|
| 322 |
+
uniform int2 flipbook_dim = int2(1,1)
|
| 323 |
+
[[
|
| 324 |
+
anno::enable_if("enable_emissive_flipbook == true"),
|
| 325 |
+
anno::display_name("Flipbook Rows/Columns"),
|
| 326 |
+
anno::description("How many rows and columns are in the flipbook?"),
|
| 327 |
+
anno::in_group("Emissive")
|
| 328 |
+
]],
|
| 329 |
+
uniform int target_fps = 1
|
| 330 |
+
[[
|
| 331 |
+
anno::enable_if("enable_emissive_flipbook == true"),
|
| 332 |
+
anno::display_name("Flipbook Target FPS"),
|
| 333 |
+
anno::description("Playback speed in frames per second"),
|
| 334 |
+
anno::in_group("Emissive")
|
| 335 |
+
]],
|
| 336 |
+
|
| 337 |
+
// -------------------- ALPHA ----------------------
|
| 338 |
+
uniform bool enable_opacity = false
|
| 339 |
+
[[
|
| 340 |
+
anno::display_name("Enable Opacity"),
|
| 341 |
+
anno::description("Enables or disables alpha functionality"),
|
| 342 |
+
anno::in_group("Alpha")
|
| 343 |
+
]],
|
| 344 |
+
float alpha_constant = 1.0
|
| 345 |
+
[[
|
| 346 |
+
anno::enable_if("enable_opacity == true"),
|
| 347 |
+
anno::display_name("Opacity Fallback Constant"),
|
| 348 |
+
anno::hard_range(0.0, 1.0),
|
| 349 |
+
anno::description("The base alpha constant to use if no texture is specified"),
|
| 350 |
+
anno::in_group("Alpha")
|
| 351 |
+
]],
|
| 352 |
+
uniform texture_2d opacity_texture = texture_2d()
|
| 353 |
+
[[
|
| 354 |
+
anno::enable_if("enable_opacity == true"),
|
| 355 |
+
anno::display_name("Opacity Map"),
|
| 356 |
+
anno::description("The texture specifying the opacity value to use"),
|
| 357 |
+
anno::in_group("Alpha")
|
| 358 |
+
]],
|
| 359 |
+
uniform bool enable_opacity_cutout = false
|
| 360 |
+
[[
|
| 361 |
+
anno::enable_if("enable_opacity == true"),
|
| 362 |
+
anno::display_name("Enable Alpha Cutout"),
|
| 363 |
+
anno::description("Enables or disables alpha cutout functionality"),
|
| 364 |
+
anno::in_group("Alpha")
|
| 365 |
+
]],
|
| 366 |
+
uniform float alpha_cutout_cutoff = 1.f
|
| 367 |
+
[[
|
| 368 |
+
anno::enable_if("enable_opacity == true"),
|
| 369 |
+
anno::enable_if("enable_opacity_cutout == true"),
|
| 370 |
+
anno::hard_range(0.0, 1.0),
|
| 371 |
+
anno::display_name("Alpha Cutout Cutoff"),
|
| 372 |
+
anno::description("The cutoff value to to render as transparent up to and opaque past"),
|
| 373 |
+
anno::in_group("Alpha")
|
| 374 |
+
]],
|
| 375 |
+
|
| 376 |
+
// -------------------- NORMAL ----------------------
|
| 377 |
+
uniform float bump_factor = 1.f
|
| 378 |
+
[[
|
| 379 |
+
anno::display_name("Normal Map Strength"),
|
| 380 |
+
anno::description("Strength of normal map."),
|
| 381 |
+
anno::in_group("Normal")
|
| 382 |
+
]],
|
| 383 |
+
|
| 384 |
+
float3 normal_input = state::normal(),
|
| 385 |
+
uniform texture_2d normalmap_texture = texture_2d()
|
| 386 |
+
[[
|
| 387 |
+
anno::display_name("Normal Map"),
|
| 388 |
+
anno::in_group("Normal")
|
| 389 |
+
]],
|
| 390 |
+
uniform bool flip_tangent_u = false
|
| 391 |
+
[[
|
| 392 |
+
anno::display_name("Normal Map Flip U Tangent"),
|
| 393 |
+
anno::in_group("Normal")
|
| 394 |
+
]],
|
| 395 |
+
uniform bool flip_tangent_v = true
|
| 396 |
+
[[
|
| 397 |
+
anno::display_name("Normal Map Flip V Tangent"),
|
| 398 |
+
anno::in_group("Normal")
|
| 399 |
+
]],
|
| 400 |
+
|
| 401 |
+
// -------------------- UV ADJUSTMENTS ----------------------
|
| 402 |
+
uniform bool project_uvw = false
|
| 403 |
+
[[
|
| 404 |
+
anno::display_name("Enable Project UVW Coordinates"),
|
| 405 |
+
anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
|
| 406 |
+
anno::in_group("UV")
|
| 407 |
+
]],
|
| 408 |
+
uniform bool world_or_object = false
|
| 409 |
+
[[
|
| 410 |
+
anno::enable_if("project_uvw == true"),
|
| 411 |
+
anno::display_name("Enable World Space"),
|
| 412 |
+
anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
|
| 413 |
+
anno::in_group("UV")
|
| 414 |
+
]],
|
| 415 |
+
uniform float2 texture_translate = float2(0.0f)
|
| 416 |
+
[[
|
| 417 |
+
anno::display_name("Texture Translate"),
|
| 418 |
+
anno::description("Controls position of texture."),
|
| 419 |
+
anno::in_group("UV")
|
| 420 |
+
]],
|
| 421 |
+
uniform float2 texture_scale = float2(1.0f)
|
| 422 |
+
[[
|
| 423 |
+
anno::display_name("Texture Tiling"),
|
| 424 |
+
anno::description("Controls repetition of the texture."),
|
| 425 |
+
anno::in_group("UV")
|
| 426 |
+
]],
|
| 427 |
+
uniform float2 texture_speed = float2(0.0f)
|
| 428 |
+
[[
|
| 429 |
+
anno::display_name("Texture Speed"),
|
| 430 |
+
anno::description("Scrolling texture animation speed in UVs per sec."),
|
| 431 |
+
anno::in_group("UV")
|
| 432 |
+
]]
|
| 433 |
+
)
|
| 434 |
+
[[
|
| 435 |
+
anno::display_name("Sim PBR"),
|
| 436 |
+
anno::description("Supports the opaque alpha cutout material model of the Sim Renderer"),
|
| 437 |
+
anno::in_group("SimReady"),
|
| 438 |
+
anno::version( 1, 0, 0),
|
| 439 |
+
anno::author("NVIDIA CORPORATION"),
|
| 440 |
+
anno::key_words(string[]("Sim", "PBR", "opaque", "alpha", "cutout", "omniverse", "generic"))
|
| 441 |
+
]]
|
| 442 |
+
= let {
|
| 443 |
+
base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
|
| 444 |
+
|
| 445 |
+
base::texture_coordinate_info uvw = project_uvw ?
|
| 446 |
+
base::coordinate_projection(
|
| 447 |
+
coordinate_system: the_system,
|
| 448 |
+
texture_space: 0,
|
| 449 |
+
projection_type: base::projection_cubic
|
| 450 |
+
) : base::coordinate_source(
|
| 451 |
+
coordinate_system: base::texture_coordinate_uvw,
|
| 452 |
+
texture_space: 0
|
| 453 |
+
);
|
| 454 |
+
|
| 455 |
+
// Need to use a small value so the compiler doesnt optimize out this var...
|
| 456 |
+
float t = 0.00000001;//state::animation_time();
|
| 457 |
+
base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
|
| 458 |
+
transform: base::rotation_translation_scale(
|
| 459 |
+
scaling: float3(texture_scale.x, texture_scale.y, 1.0),
|
| 460 |
+
rotation: float3(0.0, 0.0, 0.0 ),
|
| 461 |
+
translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
|
| 462 |
+
coordinate: uvw
|
| 463 |
+
);
|
| 464 |
+
float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
|
| 465 |
+
|
| 466 |
+
// Diffuse Color Lookup and AO
|
| 467 |
+
float4 base_lookup = tex::texture_isvalid(diffuse_texture) ? tex::lookup_float4(tex: diffuse_texture, coord: uv) : float4(1, 1, 1, 1);
|
| 468 |
+
|
| 469 |
+
float opacityValue = tex::texture_isvalid(opacity_texture) ? tex::lookup_float4(tex: opacity_texture, coord: uv).w : alpha_constant;
|
| 470 |
+
|
| 471 |
+
// Normal calculations
|
| 472 |
+
float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
|
| 473 |
+
base::tangent_space_normal_texture(
|
| 474 |
+
texture: normalmap_texture,
|
| 475 |
+
factor: bump_factor,
|
| 476 |
+
uvw: transformed_uvw,
|
| 477 |
+
flip_tangent_u: flip_tangent_u,
|
| 478 |
+
flip_tangent_v: flip_tangent_v
|
| 479 |
+
) : normal_input;
|
| 480 |
+
|
| 481 |
+
float3 clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ?
|
| 482 |
+
base::tangent_space_normal_texture(
|
| 483 |
+
texture: clearcoat_normalmap_texture,
|
| 484 |
+
factor: clearcoat_bump_factor,
|
| 485 |
+
uvw: uvw,
|
| 486 |
+
flip_tangent_u: clearcoat_flip_tangent_u,
|
| 487 |
+
flip_tangent_v: clearcoat_flip_tangent_v
|
| 488 |
+
) : clearcoat_normal_input;
|
| 489 |
+
|
| 490 |
+
float3 flattened_clearcoat_normal = ::math::lerp(normal_lookup, ::state::normal(), clearcoat_flatten);
|
| 491 |
+
float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? clearcoat_normal : flattened_clearcoat_normal;
|
| 492 |
+
|
| 493 |
+
float ao_lookup = tex::texture_isvalid(ao_texture) ? tex::lookup_float4(tex: ao_texture, coord: uv).x : ao_input;
|
| 494 |
+
|
| 495 |
+
color diffuse_color = tex::texture_isvalid(diffuse_texture) ? color(base_lookup.x, base_lookup.y, base_lookup.z) : diffuse_color_constant;
|
| 496 |
+
|
| 497 |
+
float3 ORM_lookup = tex::lookup_float3(
|
| 498 |
+
tex: ORM_texture,
|
| 499 |
+
coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
|
| 500 |
+
);
|
| 501 |
+
|
| 502 |
+
float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
|
| 503 |
+
tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
|
| 504 |
+
float anisotropy_lookup = tex::texture_isvalid(anisotropy_texture) ?
|
| 505 |
+
(tex::lookup_float4(tex: anisotropy_texture, coord: uv).x * 2.0f - 1.0f) : anisotropy_constant;
|
| 506 |
+
float metallic_lookup = tex::texture_isvalid(metallic_texture) ?
|
| 507 |
+
tex::lookup_float4(tex: metallic_texture, coord: uv).x : metallic_constant;
|
| 508 |
+
float specular_lookup = tex::texture_isvalid(specular_texture) ?
|
| 509 |
+
tex::lookup_float4(tex: specular_texture, coord: uv).x : specular_constant;
|
| 510 |
+
|
| 511 |
+
float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup;
|
| 512 |
+
float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup;
|
| 513 |
+
float ao = enable_ORM_texture ? ORM_lookup.x : ao_lookup;
|
| 514 |
+
|
| 515 |
+
float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
|
| 516 |
+
float anisotropy = math::lerp(anisotropy_constant, anisotropy_lookup, anisotropy_texture_influence);
|
| 517 |
+
float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
|
| 518 |
+
|
| 519 |
+
int rows = flipbook_dim.x;
|
| 520 |
+
int columns = flipbook_dim.y;
|
| 521 |
+
int numFrames = rows * columns;
|
| 522 |
+
varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
|
| 523 |
+
varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
|
| 524 |
+
varying float2 emissiveUV = enable_emissive_flipbook ?
|
| 525 |
+
((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
|
| 526 |
+
|
| 527 |
+
color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
|
| 528 |
+
tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : emissive_mask_input;
|
| 529 |
+
|
| 530 |
+
} in SimPBR_Model(
|
| 531 |
+
diffuse_color: diffuse_color,
|
| 532 |
+
diffuse_tint: diffuse_tint,
|
| 533 |
+
roughness: reflection_roughness,
|
| 534 |
+
anisotropy: anisotropy,
|
| 535 |
+
metallic: metallic,
|
| 536 |
+
specular: specular_lookup,
|
| 537 |
+
normal: normal_lookup,
|
| 538 |
+
enable_clearcoat: enable_clearcoat,
|
| 539 |
+
clearcoat_tint: clearcoat_tint,
|
| 540 |
+
clearcoat_transparency: clearcoat_transparency,
|
| 541 |
+
clearcoat_reflection_roughness: clearcoat_reflection_roughness,
|
| 542 |
+
clearcoat_weight: clearcoat_weight,
|
| 543 |
+
clearcoat_ior: clearcoat_ior,
|
| 544 |
+
clearcoat_normal: final_clearcoat_normal,
|
| 545 |
+
enable_retroreflection: enable_retroreflection,
|
| 546 |
+
retroreflection_tint: retroreflection_tint,
|
| 547 |
+
normal_reflectivity: normal_reflectivity,
|
| 548 |
+
grazing_reflectivity: grazing_reflectivity,
|
| 549 |
+
ao_to_diffuse: ao_to_diffuse,
|
| 550 |
+
ao: ao,
|
| 551 |
+
enable_emission: enable_emission,
|
| 552 |
+
emissive_color: emissive_color,
|
| 553 |
+
emissive_mask: emissive_mask,
|
| 554 |
+
emissive_intensity: emissive_intensity,
|
| 555 |
+
enable_opacity: enable_opacity,
|
| 556 |
+
alpha: opacityValue,
|
| 557 |
+
enable_opacity_cutout: enable_opacity_cutout,
|
| 558 |
+
alpha_cutout_cutoff: alpha_cutout_cutoff,
|
| 559 |
+
opacity_ratio: enable_transmission ? opacity_ratio : 1.0,
|
| 560 |
+
opacity_tint : opacity_tint,
|
| 561 |
+
opacity_multiplier : opacity_multiplier
|
| 562 |
+
);
|
objects/appleseed_endtable/materials/omniverse/simready_content/materials/SimPBR_Model.mdl
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*****************************************************************************
|
| 2 |
+
* Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
******************************************************************************
|
| 4 |
+
|
| 5 |
+
MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
|
| 6 |
+
WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
|
| 7 |
+
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 8 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
| 9 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
| 10 |
+
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
|
| 11 |
+
CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
|
| 12 |
+
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
| 13 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
| 14 |
+
THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
|
| 15 |
+
THE MDL MATERIALS.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
mdl 1.4;
|
| 19 |
+
|
| 20 |
+
import ::df::*;
|
| 21 |
+
import ::state::*;
|
| 22 |
+
import ::math::*;
|
| 23 |
+
import ::base::*;
|
| 24 |
+
import ::tex::*;
|
| 25 |
+
import ::anno::*;
|
| 26 |
+
|
| 27 |
+
using .::baking_annotations import *;
|
| 28 |
+
|
| 29 |
+
base::texture_return multiply_colors(
|
| 30 |
+
color color_1 = color(1.0, 1.0, 1.0),
|
| 31 |
+
color color_2 = color(.5, .5, .5),
|
| 32 |
+
float weight = 1.0
|
| 33 |
+
)
|
| 34 |
+
[[
|
| 35 |
+
anno::hidden()
|
| 36 |
+
]]
|
| 37 |
+
{
|
| 38 |
+
return base::blend_color_layers(
|
| 39 |
+
layers: base::color_layer[](
|
| 40 |
+
base::color_layer(
|
| 41 |
+
layer_color: color_2,
|
| 42 |
+
weight: weight,
|
| 43 |
+
mode: base::color_layer_multiply
|
| 44 |
+
)
|
| 45 |
+
), base: color_1
|
| 46 |
+
);
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
export material SimPBR_Model(
|
| 50 |
+
color diffuse_color = color(0.2f) [[ target_baked_argument("diffuse_texture", "diffuse_color_constant", "RGBA8_UNORM") ]],
|
| 51 |
+
uniform color diffuse_tint = color(1.0f),
|
| 52 |
+
float roughness = 0.5f [[ target_baked_argument("reflectionroughness_texture", "reflection_roughness_constant", "R8_UNORM") ]],
|
| 53 |
+
float anisotropy = 0.0f [[ target_baked_argument("anisotropy_texture", "anisotropy_constant", "R8_SNORM") ]],
|
| 54 |
+
float metallic = 0.f [[ target_baked_argument("metallic_texture", "metallic_constant", "R8_UNORM") ]],
|
| 55 |
+
float specular = 1.f [[ target_baked_argument("specular_texture", "specular_constant", "R8_UNORM") ]],
|
| 56 |
+
float3 normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("normalmap_texture", "normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
|
| 57 |
+
uniform bool enable_clearcoat = false,
|
| 58 |
+
color clearcoat_tint = color(1.0f),
|
| 59 |
+
float clearcoat_transparency = 1.0f,
|
| 60 |
+
float clearcoat_reflection_roughness = 0.0f,
|
| 61 |
+
float clearcoat_weight = 1.0f,
|
| 62 |
+
float clearcoat_ior = 1.56f,
|
| 63 |
+
float3 clearcoat_normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("clearcoat_normalmap_texture", "clearcoat_normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
|
| 64 |
+
uniform bool enable_retroreflection = false,
|
| 65 |
+
color retroreflection_tint = color(.182,.800,.000),
|
| 66 |
+
uniform float normal_reflectivity = 0.5,
|
| 67 |
+
uniform float grazing_reflectivity = 1.0,
|
| 68 |
+
float ao_to_diffuse = 0.0,
|
| 69 |
+
float ao = 1.0f [[ target_baked_argument("ao_texture", "ao_input", "R8_UNORM") ]],
|
| 70 |
+
uniform bool enable_emission = false,
|
| 71 |
+
uniform color emissive_color = color(1.0, 0.1, 0.1),
|
| 72 |
+
color emissive_mask = color(1.0, 0.1, 0.1) [[ target_baked_argument("emissive_mask_texture", "emissive_mask_input", "R8_UNORM") ]],
|
| 73 |
+
uniform float emissive_intensity = 40.f,
|
| 74 |
+
uniform bool enable_opacity = false,
|
| 75 |
+
float alpha = 1.0,
|
| 76 |
+
uniform bool enable_opacity_cutout = false,
|
| 77 |
+
uniform float alpha_cutout_cutoff = 1.f,
|
| 78 |
+
uniform float opacity_ratio = 1.f,
|
| 79 |
+
uniform color opacity_tint = color(1.0f),
|
| 80 |
+
uniform float opacity_multiplier = 1.f
|
| 81 |
+
)
|
| 82 |
+
[[
|
| 83 |
+
target_material_model(),
|
| 84 |
+
target_material_rendering("..::SimPBR::SimPBR")
|
| 85 |
+
]]
|
| 86 |
+
= let {
|
| 87 |
+
color base_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint;
|
| 88 |
+
color ao_weighted_base_color = multiply_colors(base_color, color(ao), ao_to_diffuse).tint;
|
| 89 |
+
|
| 90 |
+
float squared_roughness = roughness * roughness;
|
| 91 |
+
float roughness_u = squared_roughness * (1 + anisotropy);
|
| 92 |
+
float roughness_v = squared_roughness * (1 - anisotropy);
|
| 93 |
+
|
| 94 |
+
color diffuse_transmission_color = base_color * opacity_tint * opacity_multiplier;
|
| 95 |
+
|
| 96 |
+
bsdf diffuse_bsdf = df::weighted_layer(
|
| 97 |
+
weight: opacity_ratio,
|
| 98 |
+
layer: df::diffuse_reflection_bsdf(
|
| 99 |
+
tint: ao_weighted_base_color,
|
| 100 |
+
roughness: 0.0f
|
| 101 |
+
),
|
| 102 |
+
base: df::diffuse_transmission_bsdf(tint: diffuse_transmission_color),
|
| 103 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 104 |
+
);
|
| 105 |
+
|
| 106 |
+
bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
|
| 107 |
+
roughness_u: roughness_u,
|
| 108 |
+
roughness_v: roughness_v,
|
| 109 |
+
tint: color(1.0, 1.0, 1.0),
|
| 110 |
+
mode: df::scatter_reflect
|
| 111 |
+
);
|
| 112 |
+
|
| 113 |
+
bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
|
| 114 |
+
normal_reflectivity: 0.03,
|
| 115 |
+
grazing_reflectivity: 1.0,
|
| 116 |
+
exponent: 5.0,
|
| 117 |
+
weight: specular,
|
| 118 |
+
layer: ggx_smith_bsdf,
|
| 119 |
+
base: diffuse_bsdf,
|
| 120 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 121 |
+
);
|
| 122 |
+
|
| 123 |
+
//
|
| 124 |
+
// Begin RETROREFLECTION SUPPORT
|
| 125 |
+
//
|
| 126 |
+
color final_retroreflection_color = multiply_colors(retroreflection_tint, base_color, 1.0).tint;
|
| 127 |
+
bsdf backscattering_glossy_bsdf = df::backscattering_glossy_reflection_bsdf(
|
| 128 |
+
tint: final_retroreflection_color,
|
| 129 |
+
roughness_u: squared_roughness
|
| 130 |
+
);
|
| 131 |
+
|
| 132 |
+
/*bsdf retroreflection_bsdf = df::custom_curve_layer(
|
| 133 |
+
normal_reflectivity: 1.-normal_reflectivity,
|
| 134 |
+
grazing_reflectivity: 1.-grazing_reflectivity,
|
| 135 |
+
base: backscattering_glossy_bsdf,
|
| 136 |
+
layer: custom_curve_layer_bsdf,
|
| 137 |
+
normal: enable_clearcoat ? normal_lookup : state::normal()
|
| 138 |
+
);*/
|
| 139 |
+
|
| 140 |
+
// if normal_reflectivity and grazing_reflectivity are 1 and weight is 1, just the layer is used
|
| 141 |
+
bsdf opt_retroreflection_bsdf = df::custom_curve_layer(
|
| 142 |
+
normal_reflectivity: enable_retroreflection ? 1.-normal_reflectivity : 1,
|
| 143 |
+
grazing_reflectivity: enable_retroreflection ? 1.-grazing_reflectivity : 1,
|
| 144 |
+
base: backscattering_glossy_bsdf,
|
| 145 |
+
layer: custom_curve_layer_bsdf,
|
| 146 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 147 |
+
);
|
| 148 |
+
|
| 149 |
+
//
|
| 150 |
+
// End RETROREFLECTION SUPPORT
|
| 151 |
+
//
|
| 152 |
+
|
| 153 |
+
bsdf directional_factor_bsdf = df::directional_factor(
|
| 154 |
+
normal_tint: ao_weighted_base_color,
|
| 155 |
+
grazing_tint: color(1.0, 1.0, 1.0),
|
| 156 |
+
exponent: 5.0f,
|
| 157 |
+
base: ggx_smith_bsdf
|
| 158 |
+
);
|
| 159 |
+
|
| 160 |
+
// CLEARCOAT
|
| 161 |
+
bsdf omni_PBR_bsdf = df::weighted_layer(
|
| 162 |
+
weight: metallic,
|
| 163 |
+
layer: directional_factor_bsdf,
|
| 164 |
+
base: opt_retroreflection_bsdf, //enable_retroreflection ? retroreflection_bsdf : custom_curve_layer_bsdf,
|
| 165 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 166 |
+
);
|
| 167 |
+
|
| 168 |
+
bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
|
| 169 |
+
roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
|
| 170 |
+
roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
|
| 171 |
+
tint: color(1.0f),
|
| 172 |
+
mode: df::scatter_reflect
|
| 173 |
+
);
|
| 174 |
+
|
| 175 |
+
// bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
|
| 176 |
+
// normal_reflectivity: clearcoat_reflectivity * 0.08,
|
| 177 |
+
// grazing_reflectivity: 1.0,
|
| 178 |
+
// weight: clearcoat_weight,
|
| 179 |
+
// layer: clearcoat_bsdf,
|
| 180 |
+
// base: omni_PBR_bsdf,
|
| 181 |
+
// normal: final_clearcoat_normal
|
| 182 |
+
// );
|
| 183 |
+
|
| 184 |
+
bsdf opt_opaque_clearcoat = df::weighted_layer(
|
| 185 |
+
weight: enable_clearcoat ? clearcoat_transparency : 1,
|
| 186 |
+
layer: ::df::tint(tint: enable_clearcoat ? clearcoat_tint : color(1), base: omni_PBR_bsdf),
|
| 187 |
+
base: ::df::diffuse_reflection_bsdf(tint: clearcoat_tint)
|
| 188 |
+
);
|
| 189 |
+
|
| 190 |
+
bsdf opt_omni_PBR_coated_bsdf = df::fresnel_layer(
|
| 191 |
+
ior: clearcoat_ior,
|
| 192 |
+
weight: enable_clearcoat ? clearcoat_weight : 0,
|
| 193 |
+
layer: clearcoat_bsdf,
|
| 194 |
+
base: opt_opaque_clearcoat,
|
| 195 |
+
normal: clearcoat_normal
|
| 196 |
+
);
|
| 197 |
+
|
| 198 |
+
bsdf final_bsdf = opt_omni_PBR_coated_bsdf;
|
| 199 |
+
} in material(
|
| 200 |
+
thin_walled: false,
|
| 201 |
+
surface: material_surface(
|
| 202 |
+
scattering: final_bsdf,
|
| 203 |
+
emission: material_emission(
|
| 204 |
+
df::diffuse_edf(),
|
| 205 |
+
intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
|
| 206 |
+
)
|
| 207 |
+
),
|
| 208 |
+
geometry: material_geometry(
|
| 209 |
+
normal: enable_clearcoat ? state::normal() : normal,
|
| 210 |
+
cutout_opacity: enable_opacity ? (enable_opacity_cutout ? (alpha < alpha_cutout_cutoff ? 0.0 : 1.0) : alpha) : 1.0
|
| 211 |
+
)
|
| 212 |
+
);
|
objects/appleseed_endtable/materials/omniverse/simready_content/materials/baking_annotations.mdl
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.4;
|
| 2 |
+
import ::anno::*;
|
| 3 |
+
|
| 4 |
+
export const string TRANSFORM_NONE = "NONE";
|
| 5 |
+
export const string TRANSFORM_UNORM_VECTOR = "UNORM_VECTOR";
|
| 6 |
+
|
| 7 |
+
export const string FORMAT_RGBA8_UNORM = "RGBA8_UNORM";
|
| 8 |
+
export const string FORMAT_R8_UNORM = "R8_UNORM";
|
| 9 |
+
export const string FORMAT_RGBA16_SFLOAT = "RGBA16_SFLOAT";
|
| 10 |
+
|
| 11 |
+
export const string BLEND_MODE_OPACITY = "opacity_blend";
|
| 12 |
+
export const string BLEND_MODE_REPLACE = "replace";
|
| 13 |
+
|
| 14 |
+
// This annotation is used to mark a material as target material for baking.
|
| 15 |
+
// It is that is detected by the MDL SDK and neuray.
|
| 16 |
+
export annotation target_material_model();
|
| 17 |
+
|
| 18 |
+
export annotation target_material_rendering(
|
| 19 |
+
string rendering_material_override = "" // if set, the baked material will be rendering using this material,
|
| 20 |
+
// otherwise the target itself is used
|
| 21 |
+
);
|
| 22 |
+
|
| 23 |
+
export annotation target_baked_argument(
|
| 24 |
+
// the name of the baked texture parameter in the rendering material
|
| 25 |
+
string baked_name,
|
| 26 |
+
|
| 27 |
+
// the name of the constant parameter in the rendering material in case baking was not necessary
|
| 28 |
+
string constant_name = "",
|
| 29 |
+
|
| 30 |
+
// texture format to bake to
|
| 31 |
+
string format = "",
|
| 32 |
+
|
| 33 |
+
// transformations, like encoding normals into [0,1] range
|
| 34 |
+
string transform = TRANSFORM_NONE,
|
| 35 |
+
|
| 36 |
+
// blending, e.g., based on alpha or replace
|
| 37 |
+
string blend_mode = BLEND_MODE_OPACITY
|
| 38 |
+
);
|
objects/av_book_01/av_book_01.usd
ADDED
|
Binary file (41.5 kB). View file
|
|
|
objects/av_book_33/av_book_33.usd
ADDED
|
Binary file (41.8 kB). View file
|
|
|
objects/av_book_51/av_book_51.usd
ADDED
|
Binary file (41.9 kB). View file
|
|
|
objects/av_book_51/materials/omniverse/ArchVis/Residential/Decor/Books/Textures/Cover_51.png
ADDED
|
Git LFS Details
|
objects/av_book_51/materials/omniverse/ArchVis/Residential/Decor/Books/Textures/Cover_Full_ORM.png
ADDED
|
Git LFS Details
|
objects/av_book_51/materials/omniverse/ArchVis/Residential/Decor/Books/Textures/Side_Pages.jpg
ADDED
|
Git LFS Details
|
objects/av_book_66/av_book_66.usd
ADDED
|
Binary file (41.8 kB). View file
|
|
|
objects/av_book_77/av_book_77.usd
ADDED
|
Binary file (41.8 kB). View file
|
|
|
objects/av_book_99/av_book_99.usd
ADDED
|
Binary file (41.8 kB). View file
|
|
|
objects/av_eraser/av_eraser.usd
ADDED
|
Binary file (18.3 kB). View file
|
|
|
objects/av_eraser/materials/omniverse/ArchVis/Residential/Misc/Supplies/textures/Eraser_BaseColor.tga
ADDED
|
|
Git LFS Details
|
objects/av_eraser/materials/omniverse/ArchVis/Residential/Misc/Supplies/textures/Eraser_Metalness.tga
ADDED
|
|
Git LFS Details
|
objects/av_eraser/materials/omniverse/ArchVis/Residential/Misc/Supplies/textures/Eraser_Normal.tga
ADDED
|
|
Git LFS Details
|
objects/av_eraser/materials/omniverse/ArchVis/Residential/Misc/Supplies/textures/Eraser_Roughness.tga
ADDED
|
|
Git LFS Details
|
objects/av_photoalbum_closed/av_photoalbum_closed.usd
ADDED
|
Binary file (42.7 kB). View file
|
|
|
objects/av_photoalbum_closed/materials/omniverse/ArchVis/Residential/Decor/Books/Textures/PhotoAlbum_Closed_BaseColor.png
ADDED
|
Git LFS Details
|
objects/av_photoalbum_closed/materials/omniverse/ArchVis/Residential/Decor/Books/Textures/PhotoAlbum_Closed_Normal.png
ADDED
|
Git LFS Details
|
objects/av_photoalbum_closed/materials/omniverse/ArchVis/Residential/Decor/Books/Textures/PhotoAlbum_Closed_ORM.png
ADDED
|
Git LFS Details
|
objects/av_stawberry/materials/omniverse/ArchVis/Residential/Food/Berries/Textures/P_Strawberry_BaseColor.png
ADDED
|
Git LFS Details
|
objects/av_stawberry/materials/omniverse/ArchVis/Residential/Food/Berries/Textures/P_Strawberry_Normal.png
ADDED
|
Git LFS Details
|
objects/av_stawberry/materials/omniverse/ArchVis/Residential/Food/Berries/Textures/P_Strawberry_ORM.png
ADDED
|
Git LFS Details
|
objects/av_stawberry/materials/omniverse/ArchVis/Residential/Food/Berries/Textures/P_Strawberry_Roughness.png
ADDED
|
Git LFS Details
|
objects/avocado01/materials/robolab/objects/fruits_veggies/materials/SimPBR.mdl
ADDED
|
@@ -0,0 +1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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*****************************************************************************
|
| 2 |
+
* Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
******************************************************************************
|
| 4 |
+
|
| 5 |
+
MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
|
| 6 |
+
WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
|
| 7 |
+
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 8 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
| 9 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
| 10 |
+
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
|
| 11 |
+
CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
|
| 12 |
+
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
| 13 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
| 14 |
+
THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
|
| 15 |
+
THE MDL MATERIALS.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
mdl 1.4;
|
| 19 |
+
|
| 20 |
+
import ::df::*;
|
| 21 |
+
import ::state::*;
|
| 22 |
+
import ::math::*;
|
| 23 |
+
import ::base::*;
|
| 24 |
+
import ::tex::*;
|
| 25 |
+
import ::anno::*;
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
using SimPBR_Model import *;
|
| 29 |
+
using baking_annotations import *;
|
| 30 |
+
|
| 31 |
+
export material SimPBR(
|
| 32 |
+
// -------------------- DIFFUSE REFLECTION ----------------------
|
| 33 |
+
uniform color diffuse_color_constant = color(0.2f)
|
| 34 |
+
[[
|
| 35 |
+
anno::display_name("Albedo Base Color"),
|
| 36 |
+
anno::description("The base albedo color to use if no texture is specified"),
|
| 37 |
+
anno::in_group("Diffuse")
|
| 38 |
+
]],
|
| 39 |
+
uniform texture_2d diffuse_texture = texture_2d()
|
| 40 |
+
[[
|
| 41 |
+
anno::display_name("Albedo Map"),
|
| 42 |
+
anno::description("The texture specifying the albedo value to use"),
|
| 43 |
+
anno::in_group("Diffuse")
|
| 44 |
+
]],
|
| 45 |
+
uniform color diffuse_tint = color(1.0f)
|
| 46 |
+
[[
|
| 47 |
+
anno::display_name("Albedo Tint"),
|
| 48 |
+
anno::description("This tints the albedo color or texture contant"),
|
| 49 |
+
anno::in_group("Diffuse")
|
| 50 |
+
]],
|
| 51 |
+
uniform bool enable_transmission = false
|
| 52 |
+
[[
|
| 53 |
+
anno::display_name("Enable Diffuse Transmission"),
|
| 54 |
+
anno::description("Enables the diffuse transmission of light through thin diffuse scattering layer"),
|
| 55 |
+
anno::in_group("Diffuse")
|
| 56 |
+
]],
|
| 57 |
+
uniform float opacity_ratio = 1.f
|
| 58 |
+
[[
|
| 59 |
+
anno::enable_if("enable_transmission == true"),
|
| 60 |
+
anno::display_name("Opacity Ratio"),
|
| 61 |
+
anno::description("Amount of opacity"),
|
| 62 |
+
anno::in_group("Diffuse")
|
| 63 |
+
]],
|
| 64 |
+
uniform color opacity_tint = color(1.0f)
|
| 65 |
+
[[
|
| 66 |
+
anno::enable_if("enable_transmission == true"),
|
| 67 |
+
anno::display_name("Diffuse transmission tint"),
|
| 68 |
+
anno::description("Base diffuse transmission color"),
|
| 69 |
+
anno::in_group("Diffuse")
|
| 70 |
+
]],
|
| 71 |
+
uniform float opacity_multiplier = 1.f
|
| 72 |
+
[[
|
| 73 |
+
anno::enable_if("enable_transmission == true"),
|
| 74 |
+
anno::display_name("Diffuse transmission multiplier"),
|
| 75 |
+
anno::description("Base diffuse transmission multiplier"),
|
| 76 |
+
anno::in_group("Diffuse")
|
| 77 |
+
]],
|
| 78 |
+
|
| 79 |
+
// -------------------- SPECULAR REFLECTION ----------------------
|
| 80 |
+
float reflection_roughness_constant = 0.5f
|
| 81 |
+
[[
|
| 82 |
+
anno::display_name("Roughness Amount"),
|
| 83 |
+
anno::hard_range(0.0,1.),
|
| 84 |
+
anno::description("Higher roughness values lead to more blurry reflections"),
|
| 85 |
+
anno::in_group("Specular")
|
| 86 |
+
]],
|
| 87 |
+
uniform float reflection_roughness_texture_influence = 0.0f
|
| 88 |
+
[[
|
| 89 |
+
anno::display_name("Roughness Map Influence"),
|
| 90 |
+
anno::hard_range(0.0, 1.),
|
| 91 |
+
anno::description("Blends between the constant value and the lookup of the roughness texture"),
|
| 92 |
+
anno::in_group("Specular")
|
| 93 |
+
]],
|
| 94 |
+
uniform texture_2d reflectionroughness_texture = texture_2d()
|
| 95 |
+
[[
|
| 96 |
+
anno::display_name("Roughness Map"),
|
| 97 |
+
anno::in_group("Specular")
|
| 98 |
+
]],
|
| 99 |
+
|
| 100 |
+
float anisotropy_constant = 0.0f
|
| 101 |
+
[[
|
| 102 |
+
anno::display_name("Anisotropy Amount"),
|
| 103 |
+
anno::hard_range(-1.,1.),
|
| 104 |
+
anno::description("0 for isotropic, extents of -1 to 1 for anisotropy"),
|
| 105 |
+
anno::in_group("Specular")
|
| 106 |
+
]],
|
| 107 |
+
uniform float anisotropy_texture_influence = 0.0f
|
| 108 |
+
[[
|
| 109 |
+
anno::display_name("Anisotropy Map Influence"),
|
| 110 |
+
anno::hard_range(0.0, 1.),
|
| 111 |
+
anno::description("Blends between the constant value and the lookup of the anisotropy texture"),
|
| 112 |
+
anno::in_group("Specular")
|
| 113 |
+
]],
|
| 114 |
+
uniform texture_2d anisotropy_texture = texture_2d()
|
| 115 |
+
[[
|
| 116 |
+
anno::display_name("Anisotropy Map"),
|
| 117 |
+
anno::in_group("Specular")
|
| 118 |
+
]],
|
| 119 |
+
|
| 120 |
+
float metallic_constant = 0.f
|
| 121 |
+
[[
|
| 122 |
+
anno::display_name("Metallic Amount"),
|
| 123 |
+
anno::hard_range(0.0,1.),
|
| 124 |
+
anno::description("Metallic Material"),
|
| 125 |
+
anno::in_group("Specular")
|
| 126 |
+
]],
|
| 127 |
+
uniform float metallic_texture_influence = 0.0f
|
| 128 |
+
[[
|
| 129 |
+
anno::display_name("Metallic Map Influence"),
|
| 130 |
+
anno::hard_range(0.0, 1.),
|
| 131 |
+
anno::description("Blends between the constant value and the lookup of the metallic texture"),
|
| 132 |
+
anno::in_group("Specular")
|
| 133 |
+
]],
|
| 134 |
+
uniform texture_2d metallic_texture = texture_2d()
|
| 135 |
+
[[
|
| 136 |
+
anno::display_name("Metallic Map"),
|
| 137 |
+
anno::in_group("Specular")
|
| 138 |
+
]],
|
| 139 |
+
|
| 140 |
+
float specular_constant = 1.f
|
| 141 |
+
[[
|
| 142 |
+
anno::display_name("Specular amount"),
|
| 143 |
+
anno::hard_range(0.0, 1.0),
|
| 144 |
+
anno::description("Scale of the specular component"),
|
| 145 |
+
anno::in_group("Specular")
|
| 146 |
+
]],
|
| 147 |
+
uniform texture_2d specular_texture = texture_2d()
|
| 148 |
+
[[
|
| 149 |
+
anno::display_name("Specular Map"),
|
| 150 |
+
anno::in_group("Specular")
|
| 151 |
+
]],
|
| 152 |
+
|
| 153 |
+
// -------------------- ORM ----------------------
|
| 154 |
+
uniform bool enable_ORM_texture = true
|
| 155 |
+
[[
|
| 156 |
+
anno::display_name("Enable ORM Texture"),
|
| 157 |
+
anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
|
| 158 |
+
anno::in_group("Reflectivity")
|
| 159 |
+
]],
|
| 160 |
+
uniform texture_2d ORM_texture = texture_2d()
|
| 161 |
+
[[
|
| 162 |
+
anno::display_name("ORM Map"),
|
| 163 |
+
anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
|
| 164 |
+
anno::in_group("Reflectivity")
|
| 165 |
+
]],
|
| 166 |
+
|
| 167 |
+
// -------------------- Clearcoat ----------------------
|
| 168 |
+
uniform bool enable_clearcoat = false
|
| 169 |
+
[[
|
| 170 |
+
anno::display_name("Enable Clearcoat Layer"),
|
| 171 |
+
anno::description("Adds a clearcoat layer on top of the material when enabled"),
|
| 172 |
+
anno::in_group("Clearcoat")
|
| 173 |
+
]],
|
| 174 |
+
color clearcoat_tint = color(1.0f)
|
| 175 |
+
[[
|
| 176 |
+
anno::display_name("Clearcoat Tint"),
|
| 177 |
+
anno::description("Clearcoat is tinted and affects the underlying material"),
|
| 178 |
+
anno::in_group("Clearcoat")
|
| 179 |
+
]],
|
| 180 |
+
float clearcoat_transparency = 1.0f
|
| 181 |
+
[[
|
| 182 |
+
anno::display_name("Clearcoat Transparency"),
|
| 183 |
+
anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
|
| 184 |
+
"covering the underlying layer"),
|
| 185 |
+
anno::in_group("Clearcoat")
|
| 186 |
+
]],
|
| 187 |
+
float clearcoat_reflection_roughness = 0.0f
|
| 188 |
+
[[
|
| 189 |
+
anno::display_name("Clearcoat Roughness"),
|
| 190 |
+
anno::description("Higher roughness values lead to more blurry reflections"),
|
| 191 |
+
anno::hard_range(0.0f, 1.0f),
|
| 192 |
+
anno::in_group("Clearcoat")
|
| 193 |
+
]],
|
| 194 |
+
float clearcoat_weight = 1.0f
|
| 195 |
+
[[
|
| 196 |
+
anno::display_name("Clearcoat Weight"),
|
| 197 |
+
anno::description("Sets the weight for clearcoat layer"),
|
| 198 |
+
anno::hard_range(0.0f, 1.0f),
|
| 199 |
+
anno::in_group("Clearcoat")
|
| 200 |
+
]],
|
| 201 |
+
float clearcoat_flatten = 1.0f
|
| 202 |
+
[[
|
| 203 |
+
anno::display_name("Clearcoat Flatten"),
|
| 204 |
+
anno::description("Flattens the clearcoat to even out the underlying bump maps"),
|
| 205 |
+
anno::hard_range(0.0f, 1.0f),
|
| 206 |
+
anno::in_group("Clearcoat")
|
| 207 |
+
]],
|
| 208 |
+
float clearcoat_ior = 1.56f
|
| 209 |
+
[[
|
| 210 |
+
anno::display_name("Clearcoat IOR"),
|
| 211 |
+
anno::description("Sets the Index of refraction for the clearcoat layer"),
|
| 212 |
+
anno::soft_range(1.0f, 4.0f),
|
| 213 |
+
anno::in_group("Clearcoat")
|
| 214 |
+
]],
|
| 215 |
+
uniform float clearcoat_bump_factor = 1.f
|
| 216 |
+
[[
|
| 217 |
+
anno::display_name("Clearcoat Normal Map Strength"),
|
| 218 |
+
anno::description("Strength of normal map."),
|
| 219 |
+
anno::in_group("Clearcoat")
|
| 220 |
+
]],
|
| 221 |
+
|
| 222 |
+
float3 clearcoat_normal_input = float3(0.0, 0.0, 0.0),
|
| 223 |
+
uniform texture_2d clearcoat_normalmap_texture = texture_2d()
|
| 224 |
+
[[
|
| 225 |
+
anno::display_name("Clearcoat Normal Map"),
|
| 226 |
+
anno::description("Enables the usage of the normalmap texture"),
|
| 227 |
+
anno::in_group("Clearcoat")
|
| 228 |
+
]],
|
| 229 |
+
|
| 230 |
+
uniform bool clearcoat_flip_tangent_u = false
|
| 231 |
+
[[
|
| 232 |
+
anno::display_name("Clearcoat Normal Map Flip U Tangent"),
|
| 233 |
+
anno::in_group("Clearcoat")
|
| 234 |
+
]],
|
| 235 |
+
uniform bool clearcoat_flip_tangent_v = true
|
| 236 |
+
[[
|
| 237 |
+
anno::display_name("Clearcoat Normal Map Flip V Tangent"),
|
| 238 |
+
anno::in_group("Clearcoat")
|
| 239 |
+
]],
|
| 240 |
+
|
| 241 |
+
|
| 242 |
+
// -------------------- REFLECTIVITY ----------------------
|
| 243 |
+
uniform bool enable_retroreflection = false
|
| 244 |
+
[[
|
| 245 |
+
anno::display_name("Enable Retroreflection"),
|
| 246 |
+
anno::in_group("Reflectivity")
|
| 247 |
+
]],
|
| 248 |
+
color retroreflection_tint = color(.182,.800,.000)
|
| 249 |
+
[[
|
| 250 |
+
anno::display_name("Retro-reflection tint"),
|
| 251 |
+
anno::description("The tint of the retroreflection"),
|
| 252 |
+
anno::in_group("Reflectivity")
|
| 253 |
+
]],
|
| 254 |
+
uniform float normal_reflectivity = 0.5
|
| 255 |
+
[[
|
| 256 |
+
anno::display_name("Retro-reflection weight facing"),
|
| 257 |
+
anno::hard_range(0.0,1.),
|
| 258 |
+
anno::description("Reflectivity control for geometry facing the viewer"),
|
| 259 |
+
anno::in_group("Reflectivity")
|
| 260 |
+
]],
|
| 261 |
+
uniform float grazing_reflectivity = 1.0
|
| 262 |
+
[[
|
| 263 |
+
anno::display_name("Retro-reflection weight edge"),
|
| 264 |
+
anno::hard_range(0.0,1.),
|
| 265 |
+
anno::description("Reflectivity control for the reflectivity at geometry edges"),
|
| 266 |
+
anno::in_group("Reflectivity")
|
| 267 |
+
]],
|
| 268 |
+
|
| 269 |
+
// -------------------- AMBIENT OCCLUSION ----------------------
|
| 270 |
+
float ao_to_diffuse = 0.0
|
| 271 |
+
[[
|
| 272 |
+
anno::display_name("AO to Diffuse"),
|
| 273 |
+
anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
|
| 274 |
+
anno::in_group("AO")
|
| 275 |
+
]],
|
| 276 |
+
float ao_input = float(1.0),
|
| 277 |
+
uniform texture_2d ao_texture = texture_2d()
|
| 278 |
+
[[
|
| 279 |
+
anno::display_name("Ambient Occlusion Map"),
|
| 280 |
+
anno::description("The Ambient Occlusion texture for the material"),
|
| 281 |
+
anno::in_group("AO")
|
| 282 |
+
]],
|
| 283 |
+
|
| 284 |
+
// -------------------- EMISSIVE ----------------------
|
| 285 |
+
uniform bool enable_emission = false
|
| 286 |
+
[[
|
| 287 |
+
anno::display_name("Enable Emission"),
|
| 288 |
+
anno::description("Enables the emission of light from the material"),
|
| 289 |
+
anno::in_group("Emissive")
|
| 290 |
+
]],
|
| 291 |
+
uniform color emissive_color = color(1.0, 0.1, 0.1)
|
| 292 |
+
[[
|
| 293 |
+
anno::enable_if("enable_emission == true"),
|
| 294 |
+
anno::display_name("Emissive Color"),
|
| 295 |
+
anno::description("The emission color"),
|
| 296 |
+
anno::in_group("Emissive")
|
| 297 |
+
]],
|
| 298 |
+
|
| 299 |
+
color emissive_mask_input = color(1.0),
|
| 300 |
+
uniform texture_2d emissive_mask_texture = texture_2d()
|
| 301 |
+
[[
|
| 302 |
+
anno::enable_if("enable_emission == true"),
|
| 303 |
+
anno::display_name("Emissive Mask Map"),
|
| 304 |
+
anno::description("The texture masking the emissive color"),
|
| 305 |
+
anno::in_group("Emissive")
|
| 306 |
+
]],
|
| 307 |
+
uniform float emissive_intensity = 40.f
|
| 308 |
+
[[
|
| 309 |
+
anno::enable_if("enable_emission == true"),
|
| 310 |
+
anno::display_name("Emissive Intensity"),
|
| 311 |
+
anno::description("Intensity of the emission"),
|
| 312 |
+
anno::in_group("Emissive")
|
| 313 |
+
]],
|
| 314 |
+
uniform bool enable_emissive_flipbook = false
|
| 315 |
+
[[
|
| 316 |
+
anno::display_name("Enable Flipbook for emission"),
|
| 317 |
+
anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
|
| 318 |
+
anno::in_group("Emissive")
|
| 319 |
+
]],
|
| 320 |
+
uniform int2 flipbook_dim = int2(1,1)
|
| 321 |
+
[[
|
| 322 |
+
anno::enable_if("enable_emissive_flipbook == true"),
|
| 323 |
+
anno::display_name("Flipbook Rows/Columns"),
|
| 324 |
+
anno::description("How many rows and columns are in the flipbook?"),
|
| 325 |
+
anno::in_group("Emissive")
|
| 326 |
+
]],
|
| 327 |
+
uniform int target_fps = 1
|
| 328 |
+
[[
|
| 329 |
+
anno::enable_if("enable_emissive_flipbook == true"),
|
| 330 |
+
anno::display_name("Flipbook Target FPS"),
|
| 331 |
+
anno::description("Playback speed in frames per second"),
|
| 332 |
+
anno::in_group("Emissive")
|
| 333 |
+
]],
|
| 334 |
+
|
| 335 |
+
// -------------------- ALPHA ----------------------
|
| 336 |
+
uniform bool enable_opacity = false
|
| 337 |
+
[[
|
| 338 |
+
anno::display_name("Enable Opacity"),
|
| 339 |
+
anno::description("Enables or disables alpha functionality"),
|
| 340 |
+
anno::in_group("Alpha")
|
| 341 |
+
]],
|
| 342 |
+
float alpha_constant = 1.0
|
| 343 |
+
[[
|
| 344 |
+
anno::enable_if("enable_opacity == true"),
|
| 345 |
+
anno::display_name("Opacity Fallback Constant"),
|
| 346 |
+
anno::hard_range(0.0, 1.0),
|
| 347 |
+
anno::description("The base alpha constant to use if no texture is specified"),
|
| 348 |
+
anno::in_group("Alpha")
|
| 349 |
+
]],
|
| 350 |
+
uniform texture_2d opacity_texture = texture_2d()
|
| 351 |
+
[[
|
| 352 |
+
anno::enable_if("enable_opacity == true"),
|
| 353 |
+
anno::display_name("Opacity Map"),
|
| 354 |
+
anno::description("The texture specifying the opacity value to use"),
|
| 355 |
+
anno::in_group("Alpha")
|
| 356 |
+
]],
|
| 357 |
+
uniform bool enable_opacity_cutout = false
|
| 358 |
+
[[
|
| 359 |
+
anno::enable_if("enable_opacity == true"),
|
| 360 |
+
anno::display_name("Enable Alpha Cutout"),
|
| 361 |
+
anno::description("Enables or disables alpha cutout functionality"),
|
| 362 |
+
anno::in_group("Alpha")
|
| 363 |
+
]],
|
| 364 |
+
uniform float alpha_cutout_cutoff = 1.f
|
| 365 |
+
[[
|
| 366 |
+
anno::enable_if("enable_opacity == true"),
|
| 367 |
+
anno::enable_if("enable_opacity_cutout == true"),
|
| 368 |
+
anno::hard_range(0.0, 1.0),
|
| 369 |
+
anno::display_name("Alpha Cutout Cutoff"),
|
| 370 |
+
anno::description("The cutoff value to to render as transparent up to and opaque past"),
|
| 371 |
+
anno::in_group("Alpha")
|
| 372 |
+
]],
|
| 373 |
+
|
| 374 |
+
// -------------------- NORMAL ----------------------
|
| 375 |
+
uniform float bump_factor = 1.f
|
| 376 |
+
[[
|
| 377 |
+
anno::display_name("Normal Map Strength"),
|
| 378 |
+
anno::description("Strength of normal map."),
|
| 379 |
+
anno::in_group("Normal")
|
| 380 |
+
]],
|
| 381 |
+
|
| 382 |
+
float3 normal_input = state::normal(),
|
| 383 |
+
uniform texture_2d normalmap_texture = texture_2d()
|
| 384 |
+
[[
|
| 385 |
+
anno::display_name("Normal Map"),
|
| 386 |
+
anno::in_group("Normal")
|
| 387 |
+
]],
|
| 388 |
+
uniform bool flip_tangent_u = false
|
| 389 |
+
[[
|
| 390 |
+
anno::display_name("Normal Map Flip U Tangent"),
|
| 391 |
+
anno::description("Flips the U Tangent vector."),
|
| 392 |
+
anno::in_group("Normal")
|
| 393 |
+
]],
|
| 394 |
+
uniform bool flip_tangent_v = true
|
| 395 |
+
[[
|
| 396 |
+
anno::display_name("Normal Map Flip V Tangent"),
|
| 397 |
+
anno::description("Flips the V Tangent vector. By Default, SimPBR materials setup for DirectX normal maps. Set Normal Map Flip V = false for OpenGL."),
|
| 398 |
+
anno::in_group("Normal")
|
| 399 |
+
]],
|
| 400 |
+
|
| 401 |
+
// -------------------- UV ADJUSTMENTS ----------------------
|
| 402 |
+
uniform bool project_uvw = false
|
| 403 |
+
[[
|
| 404 |
+
anno::display_name("Enable Project UVW Coordinates"),
|
| 405 |
+
anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
|
| 406 |
+
anno::in_group("UV")
|
| 407 |
+
]],
|
| 408 |
+
uniform bool world_or_object = false
|
| 409 |
+
[[
|
| 410 |
+
anno::enable_if("project_uvw == true"),
|
| 411 |
+
anno::display_name("Enable World Space"),
|
| 412 |
+
anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
|
| 413 |
+
anno::in_group("UV")
|
| 414 |
+
]],
|
| 415 |
+
uniform float2 texture_translate = float2(0.0f)
|
| 416 |
+
[[
|
| 417 |
+
anno::display_name("Texture Translate"),
|
| 418 |
+
anno::description("Controls position of texture."),
|
| 419 |
+
anno::in_group("UV")
|
| 420 |
+
]],
|
| 421 |
+
uniform float2 texture_scale = float2(1.0f)
|
| 422 |
+
[[
|
| 423 |
+
anno::display_name("Texture Tiling"),
|
| 424 |
+
anno::description("Controls repetition of the texture."),
|
| 425 |
+
anno::in_group("UV")
|
| 426 |
+
]],
|
| 427 |
+
uniform float2 texture_speed = float2(0.0f)
|
| 428 |
+
[[
|
| 429 |
+
anno::display_name("Texture Speed"),
|
| 430 |
+
anno::description("Scrolling texture animation speed in UVs per sec."),
|
| 431 |
+
anno::in_group("UV")
|
| 432 |
+
]]
|
| 433 |
+
)
|
| 434 |
+
[[
|
| 435 |
+
anno::display_name("Sim PBR"),
|
| 436 |
+
anno::description("Supports the opaque alpha cutout material model of the Sim Renderer"),
|
| 437 |
+
anno::in_group("SimReady"),
|
| 438 |
+
anno::version( 1, 0, 0),
|
| 439 |
+
anno::author("NVIDIA CORPORATION"),
|
| 440 |
+
anno::key_words(string[]("Sim", "PBR", "opaque", "alpha", "cutout", "omniverse", "generic"))
|
| 441 |
+
]]
|
| 442 |
+
= let {
|
| 443 |
+
base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
|
| 444 |
+
|
| 445 |
+
base::texture_coordinate_info uvw = project_uvw ?
|
| 446 |
+
base::coordinate_projection(
|
| 447 |
+
coordinate_system: the_system,
|
| 448 |
+
texture_space: 0,
|
| 449 |
+
projection_type: base::projection_cubic
|
| 450 |
+
) : base::coordinate_source(
|
| 451 |
+
coordinate_system: base::texture_coordinate_uvw,
|
| 452 |
+
texture_space: 0
|
| 453 |
+
);
|
| 454 |
+
|
| 455 |
+
// Need to use a small value so the compiler doesnt optimize out this var...
|
| 456 |
+
float t = 0.00000001;//state::animation_time();
|
| 457 |
+
base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
|
| 458 |
+
transform: base::rotation_translation_scale(
|
| 459 |
+
scaling: float3(texture_scale.x, texture_scale.y, 1.0),
|
| 460 |
+
rotation: float3(0.0, 0.0, 0.0 ),
|
| 461 |
+
translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
|
| 462 |
+
coordinate: uvw
|
| 463 |
+
);
|
| 464 |
+
float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
|
| 465 |
+
|
| 466 |
+
// Diffuse Color Lookup and AO
|
| 467 |
+
float4 base_lookup = tex::texture_isvalid(diffuse_texture) ? tex::lookup_float4(tex: diffuse_texture, coord: uv) : float4(1, 1, 1, 1);
|
| 468 |
+
|
| 469 |
+
float opacityValue = tex::texture_isvalid(opacity_texture) ? tex::lookup_float4(tex: opacity_texture, coord: uv).w : alpha_constant;
|
| 470 |
+
|
| 471 |
+
// Normal calculations
|
| 472 |
+
float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
|
| 473 |
+
base::tangent_space_normal_texture(
|
| 474 |
+
texture: normalmap_texture,
|
| 475 |
+
factor: bump_factor,
|
| 476 |
+
uvw: transformed_uvw,
|
| 477 |
+
flip_tangent_u: flip_tangent_u,
|
| 478 |
+
flip_tangent_v: flip_tangent_v
|
| 479 |
+
) : normal_input;
|
| 480 |
+
|
| 481 |
+
float3 clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ?
|
| 482 |
+
base::tangent_space_normal_texture(
|
| 483 |
+
texture: clearcoat_normalmap_texture,
|
| 484 |
+
factor: clearcoat_bump_factor,
|
| 485 |
+
uvw: uvw,
|
| 486 |
+
flip_tangent_u: clearcoat_flip_tangent_u,
|
| 487 |
+
flip_tangent_v: clearcoat_flip_tangent_v
|
| 488 |
+
) : clearcoat_normal_input;
|
| 489 |
+
|
| 490 |
+
float3 flattened_clearcoat_normal = ::math::lerp(normal_lookup, ::state::normal(), clearcoat_flatten);
|
| 491 |
+
float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? clearcoat_normal : flattened_clearcoat_normal;
|
| 492 |
+
|
| 493 |
+
float ao_lookup = tex::texture_isvalid(ao_texture) ? tex::lookup_float4(tex: ao_texture, coord: uv).x : ao_input;
|
| 494 |
+
|
| 495 |
+
color diffuse_color = tex::texture_isvalid(diffuse_texture) ? color(base_lookup.x, base_lookup.y, base_lookup.z) : diffuse_color_constant;
|
| 496 |
+
|
| 497 |
+
float3 ORM_lookup = tex::lookup_float3(
|
| 498 |
+
tex: ORM_texture,
|
| 499 |
+
coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
|
| 500 |
+
);
|
| 501 |
+
|
| 502 |
+
float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
|
| 503 |
+
tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
|
| 504 |
+
float anisotropy_lookup = tex::texture_isvalid(anisotropy_texture) ?
|
| 505 |
+
(tex::lookup_float4(tex: anisotropy_texture, coord: uv).x * 2.0f - 1.0f) : anisotropy_constant;
|
| 506 |
+
float metallic_lookup = tex::texture_isvalid(metallic_texture) ?
|
| 507 |
+
tex::lookup_float4(tex: metallic_texture, coord: uv).x : metallic_constant;
|
| 508 |
+
float specular_lookup = tex::texture_isvalid(specular_texture) ?
|
| 509 |
+
tex::lookup_float4(tex: specular_texture, coord: uv).x : specular_constant;
|
| 510 |
+
|
| 511 |
+
float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup;
|
| 512 |
+
float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup;
|
| 513 |
+
float ao = enable_ORM_texture ? ORM_lookup.x : ao_lookup;
|
| 514 |
+
|
| 515 |
+
float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
|
| 516 |
+
float anisotropy = math::lerp(anisotropy_constant, anisotropy_lookup, anisotropy_texture_influence);
|
| 517 |
+
float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
|
| 518 |
+
|
| 519 |
+
int rows = flipbook_dim.x;
|
| 520 |
+
int columns = flipbook_dim.y;
|
| 521 |
+
int numFrames = rows * columns;
|
| 522 |
+
varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
|
| 523 |
+
varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
|
| 524 |
+
varying float2 emissiveUV = enable_emissive_flipbook ?
|
| 525 |
+
((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
|
| 526 |
+
|
| 527 |
+
color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
|
| 528 |
+
tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : emissive_mask_input;
|
| 529 |
+
|
| 530 |
+
} in SimPBR_Model(
|
| 531 |
+
diffuse_color: diffuse_color,
|
| 532 |
+
diffuse_tint: diffuse_tint,
|
| 533 |
+
roughness: reflection_roughness,
|
| 534 |
+
anisotropy: anisotropy,
|
| 535 |
+
metallic: metallic,
|
| 536 |
+
specular: specular_lookup,
|
| 537 |
+
normal: normal_lookup,
|
| 538 |
+
enable_clearcoat: enable_clearcoat,
|
| 539 |
+
clearcoat_tint: clearcoat_tint,
|
| 540 |
+
clearcoat_transparency: clearcoat_transparency,
|
| 541 |
+
clearcoat_reflection_roughness: clearcoat_reflection_roughness,
|
| 542 |
+
clearcoat_weight: clearcoat_weight,
|
| 543 |
+
clearcoat_ior: clearcoat_ior,
|
| 544 |
+
clearcoat_normal: final_clearcoat_normal,
|
| 545 |
+
enable_retroreflection: enable_retroreflection,
|
| 546 |
+
retroreflection_tint: retroreflection_tint,
|
| 547 |
+
normal_reflectivity: normal_reflectivity,
|
| 548 |
+
grazing_reflectivity: grazing_reflectivity,
|
| 549 |
+
ao_to_diffuse: ao_to_diffuse,
|
| 550 |
+
ao: ao,
|
| 551 |
+
enable_emission: enable_emission,
|
| 552 |
+
emissive_color: emissive_color,
|
| 553 |
+
emissive_mask: emissive_mask,
|
| 554 |
+
emissive_intensity: emissive_intensity,
|
| 555 |
+
enable_opacity: enable_opacity,
|
| 556 |
+
alpha: opacityValue,
|
| 557 |
+
enable_opacity_cutout: enable_opacity_cutout,
|
| 558 |
+
alpha_cutout_cutoff: alpha_cutout_cutoff,
|
| 559 |
+
opacity_ratio: enable_transmission ? opacity_ratio : 1.0,
|
| 560 |
+
opacity_tint : opacity_tint,
|
| 561 |
+
opacity_multiplier : opacity_multiplier
|
| 562 |
+
);
|
objects/avocado01/materials/robolab/objects/fruits_veggies/materials/SimPBR_Model.mdl
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*****************************************************************************
|
| 2 |
+
* Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
******************************************************************************
|
| 4 |
+
|
| 5 |
+
MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
|
| 6 |
+
WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
|
| 7 |
+
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 8 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
| 9 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
| 10 |
+
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
|
| 11 |
+
CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
|
| 12 |
+
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
| 13 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
| 14 |
+
THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
|
| 15 |
+
THE MDL MATERIALS.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
mdl 1.4;
|
| 19 |
+
|
| 20 |
+
import ::df::*;
|
| 21 |
+
import ::state::*;
|
| 22 |
+
import ::math::*;
|
| 23 |
+
import ::base::*;
|
| 24 |
+
import ::tex::*;
|
| 25 |
+
import ::anno::*;
|
| 26 |
+
|
| 27 |
+
using baking_annotations import *;
|
| 28 |
+
|
| 29 |
+
base::texture_return multiply_colors(
|
| 30 |
+
color color_1 = color(1.0, 1.0, 1.0),
|
| 31 |
+
color color_2 = color(.5, .5, .5),
|
| 32 |
+
float weight = 1.0
|
| 33 |
+
)
|
| 34 |
+
[[
|
| 35 |
+
anno::hidden()
|
| 36 |
+
]]
|
| 37 |
+
{
|
| 38 |
+
return base::blend_color_layers(
|
| 39 |
+
layers: base::color_layer[](
|
| 40 |
+
base::color_layer(
|
| 41 |
+
layer_color: color_2,
|
| 42 |
+
weight: weight,
|
| 43 |
+
mode: base::color_layer_multiply
|
| 44 |
+
)
|
| 45 |
+
), base: color_1
|
| 46 |
+
);
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
export material SimPBR_Model(
|
| 50 |
+
color diffuse_color = color(0.2f) [[ target_baked_argument("diffuse_texture", "diffuse_color_constant", "RGBA8_UNORM") ]],
|
| 51 |
+
uniform color diffuse_tint = color(1.0f),
|
| 52 |
+
float roughness = 0.5f [[ target_baked_argument("reflectionroughness_texture", "reflection_roughness_constant", "R8_UNORM") ]],
|
| 53 |
+
float anisotropy = 0.0f [[ target_baked_argument("anisotropy_texture", "anisotropy_constant", "R8_SNORM") ]],
|
| 54 |
+
float metallic = 0.f [[ target_baked_argument("metallic_texture", "metallic_constant", "R8_UNORM") ]],
|
| 55 |
+
float specular = 1.f [[ target_baked_argument("specular_texture", "specular_constant", "R8_UNORM") ]],
|
| 56 |
+
float3 normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("normalmap_texture", "normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
|
| 57 |
+
uniform bool enable_clearcoat = false,
|
| 58 |
+
color clearcoat_tint = color(1.0f),
|
| 59 |
+
float clearcoat_transparency = 1.0f,
|
| 60 |
+
float clearcoat_reflection_roughness = 0.0f,
|
| 61 |
+
float clearcoat_weight = 1.0f,
|
| 62 |
+
float clearcoat_ior = 1.56f,
|
| 63 |
+
float3 clearcoat_normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("clearcoat_normalmap_texture", "clearcoat_normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
|
| 64 |
+
uniform bool enable_retroreflection = false,
|
| 65 |
+
color retroreflection_tint = color(.182,.800,.000),
|
| 66 |
+
uniform float normal_reflectivity = 0.5,
|
| 67 |
+
uniform float grazing_reflectivity = 1.0,
|
| 68 |
+
float ao_to_diffuse = 0.0,
|
| 69 |
+
float ao = 1.0f [[ target_baked_argument("ao_texture", "ao_input", "R8_UNORM") ]],
|
| 70 |
+
uniform bool enable_emission = false,
|
| 71 |
+
uniform color emissive_color = color(1.0, 0.1, 0.1),
|
| 72 |
+
color emissive_mask = color(1.0, 0.1, 0.1) [[ target_baked_argument("emissive_mask_texture", "emissive_mask_input", "R8_UNORM") ]],
|
| 73 |
+
uniform float emissive_intensity = 40.f,
|
| 74 |
+
uniform bool enable_opacity = false,
|
| 75 |
+
float alpha = 1.0,
|
| 76 |
+
uniform bool enable_opacity_cutout = false,
|
| 77 |
+
uniform float alpha_cutout_cutoff = 1.f,
|
| 78 |
+
uniform float opacity_ratio = 1.f,
|
| 79 |
+
uniform color opacity_tint = color(1.0f),
|
| 80 |
+
uniform float opacity_multiplier = 1.f
|
| 81 |
+
)
|
| 82 |
+
[[
|
| 83 |
+
target_material_model(),
|
| 84 |
+
target_material_rendering("..::SimPBR::SimPBR")
|
| 85 |
+
]]
|
| 86 |
+
= let {
|
| 87 |
+
color base_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint;
|
| 88 |
+
color ao_weighted_base_color = multiply_colors(base_color, color(ao), ao_to_diffuse).tint;
|
| 89 |
+
|
| 90 |
+
float squared_roughness = roughness * roughness;
|
| 91 |
+
float roughness_u = squared_roughness * (1 + anisotropy);
|
| 92 |
+
float roughness_v = squared_roughness * (1 - anisotropy);
|
| 93 |
+
|
| 94 |
+
color diffuse_transmission_color = base_color * opacity_tint * opacity_multiplier;
|
| 95 |
+
|
| 96 |
+
bsdf diffuse_bsdf = df::weighted_layer(
|
| 97 |
+
weight: opacity_ratio,
|
| 98 |
+
layer: df::diffuse_reflection_bsdf(
|
| 99 |
+
tint: ao_weighted_base_color,
|
| 100 |
+
roughness: 0.0f
|
| 101 |
+
),
|
| 102 |
+
base: df::diffuse_transmission_bsdf(tint: diffuse_transmission_color),
|
| 103 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 104 |
+
);
|
| 105 |
+
|
| 106 |
+
bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
|
| 107 |
+
roughness_u: roughness_u,
|
| 108 |
+
roughness_v: roughness_v,
|
| 109 |
+
tint: color(1.0, 1.0, 1.0),
|
| 110 |
+
mode: df::scatter_reflect
|
| 111 |
+
);
|
| 112 |
+
|
| 113 |
+
bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
|
| 114 |
+
normal_reflectivity: 0.03,
|
| 115 |
+
grazing_reflectivity: 1.0,
|
| 116 |
+
exponent: 5.0,
|
| 117 |
+
weight: specular,
|
| 118 |
+
layer: ggx_smith_bsdf,
|
| 119 |
+
base: diffuse_bsdf,
|
| 120 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 121 |
+
);
|
| 122 |
+
|
| 123 |
+
//
|
| 124 |
+
// Begin RETROREFLECTION SUPPORT
|
| 125 |
+
//
|
| 126 |
+
color final_retroreflection_color = multiply_colors(retroreflection_tint, base_color, 1.0).tint;
|
| 127 |
+
bsdf backscattering_glossy_bsdf = df::backscattering_glossy_reflection_bsdf(
|
| 128 |
+
tint: final_retroreflection_color,
|
| 129 |
+
roughness_u: squared_roughness
|
| 130 |
+
);
|
| 131 |
+
|
| 132 |
+
/*bsdf retroreflection_bsdf = df::custom_curve_layer(
|
| 133 |
+
normal_reflectivity: 1.-normal_reflectivity,
|
| 134 |
+
grazing_reflectivity: 1.-grazing_reflectivity,
|
| 135 |
+
base: backscattering_glossy_bsdf,
|
| 136 |
+
layer: custom_curve_layer_bsdf,
|
| 137 |
+
normal: enable_clearcoat ? normal_lookup : state::normal()
|
| 138 |
+
);*/
|
| 139 |
+
|
| 140 |
+
// if normal_reflectivity and grazing_reflectivity are 1 and weight is 1, just the layer is used
|
| 141 |
+
bsdf opt_retroreflection_bsdf = df::custom_curve_layer(
|
| 142 |
+
normal_reflectivity: enable_retroreflection ? 1.-normal_reflectivity : 1,
|
| 143 |
+
grazing_reflectivity: enable_retroreflection ? 1.-grazing_reflectivity : 1,
|
| 144 |
+
base: backscattering_glossy_bsdf,
|
| 145 |
+
layer: custom_curve_layer_bsdf,
|
| 146 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 147 |
+
);
|
| 148 |
+
|
| 149 |
+
//
|
| 150 |
+
// End RETROREFLECTION SUPPORT
|
| 151 |
+
//
|
| 152 |
+
|
| 153 |
+
bsdf directional_factor_bsdf = df::directional_factor(
|
| 154 |
+
normal_tint: ao_weighted_base_color,
|
| 155 |
+
grazing_tint: color(1.0, 1.0, 1.0),
|
| 156 |
+
exponent: 5.0f,
|
| 157 |
+
base: ggx_smith_bsdf
|
| 158 |
+
);
|
| 159 |
+
|
| 160 |
+
// CLEARCOAT
|
| 161 |
+
bsdf omni_PBR_bsdf = df::weighted_layer(
|
| 162 |
+
weight: metallic,
|
| 163 |
+
layer: directional_factor_bsdf,
|
| 164 |
+
base: opt_retroreflection_bsdf, //enable_retroreflection ? retroreflection_bsdf : custom_curve_layer_bsdf,
|
| 165 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 166 |
+
);
|
| 167 |
+
|
| 168 |
+
bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
|
| 169 |
+
roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
|
| 170 |
+
roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
|
| 171 |
+
tint: color(1.0f),
|
| 172 |
+
mode: df::scatter_reflect
|
| 173 |
+
);
|
| 174 |
+
|
| 175 |
+
// bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
|
| 176 |
+
// normal_reflectivity: clearcoat_reflectivity * 0.08,
|
| 177 |
+
// grazing_reflectivity: 1.0,
|
| 178 |
+
// weight: clearcoat_weight,
|
| 179 |
+
// layer: clearcoat_bsdf,
|
| 180 |
+
// base: omni_PBR_bsdf,
|
| 181 |
+
// normal: final_clearcoat_normal
|
| 182 |
+
// );
|
| 183 |
+
|
| 184 |
+
bsdf opt_opaque_clearcoat = df::weighted_layer(
|
| 185 |
+
weight: enable_clearcoat ? clearcoat_transparency : 1,
|
| 186 |
+
layer: ::df::tint(tint: enable_clearcoat ? clearcoat_tint : color(1), base: omni_PBR_bsdf),
|
| 187 |
+
base: ::df::diffuse_reflection_bsdf(tint: clearcoat_tint)
|
| 188 |
+
);
|
| 189 |
+
|
| 190 |
+
bsdf opt_omni_PBR_coated_bsdf = df::fresnel_layer(
|
| 191 |
+
ior: clearcoat_ior,
|
| 192 |
+
weight: enable_clearcoat ? clearcoat_weight : 0,
|
| 193 |
+
layer: clearcoat_bsdf,
|
| 194 |
+
base: opt_opaque_clearcoat,
|
| 195 |
+
normal: clearcoat_normal
|
| 196 |
+
);
|
| 197 |
+
|
| 198 |
+
bsdf final_bsdf = opt_omni_PBR_coated_bsdf;
|
| 199 |
+
} in material(
|
| 200 |
+
thin_walled: false,
|
| 201 |
+
surface: material_surface(
|
| 202 |
+
scattering: final_bsdf,
|
| 203 |
+
emission: material_emission(
|
| 204 |
+
df::diffuse_edf(),
|
| 205 |
+
intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
|
| 206 |
+
)
|
| 207 |
+
),
|
| 208 |
+
geometry: material_geometry(
|
| 209 |
+
normal: enable_clearcoat ? state::normal() : normal,
|
| 210 |
+
cutout_opacity: enable_opacity ? (enable_opacity_cutout ? (alpha < alpha_cutout_cutoff ? 0.0 : 1.0) : alpha) : 1.0
|
| 211 |
+
)
|
| 212 |
+
);
|
objects/avocado01/materials/robolab/objects/fruits_veggies/materials/baking_annotations.mdl
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.4;
|
| 2 |
+
import ::anno::*;
|
| 3 |
+
|
| 4 |
+
export const string TRANSFORM_NONE = "NONE";
|
| 5 |
+
export const string TRANSFORM_UNORM_VECTOR = "UNORM_VECTOR";
|
| 6 |
+
|
| 7 |
+
export const string FORMAT_RGBA8_UNORM = "RGBA8_UNORM";
|
| 8 |
+
export const string FORMAT_R8_UNORM = "R8_UNORM";
|
| 9 |
+
export const string FORMAT_RGBA16_SFLOAT = "RGBA16_SFLOAT";
|
| 10 |
+
|
| 11 |
+
export const string BLEND_MODE_OPACITY = "opacity_blend";
|
| 12 |
+
export const string BLEND_MODE_REPLACE = "replace";
|
| 13 |
+
|
| 14 |
+
// This annotation is used to mark a material as target material for baking.
|
| 15 |
+
// It is that is detected by the MDL SDK and neuray.
|
| 16 |
+
export annotation target_material_model();
|
| 17 |
+
|
| 18 |
+
export annotation target_material_rendering(
|
| 19 |
+
string rendering_material_override = "" // if set, the baked material will be rendering using this material,
|
| 20 |
+
// otherwise the target itself is used
|
| 21 |
+
);
|
| 22 |
+
|
| 23 |
+
export annotation target_baked_argument(
|
| 24 |
+
// the name of the baked texture parameter in the rendering material
|
| 25 |
+
string baked_name,
|
| 26 |
+
|
| 27 |
+
// the name of the constant parameter in the rendering material in case baking was not necessary
|
| 28 |
+
string constant_name = "",
|
| 29 |
+
|
| 30 |
+
// texture format to bake to
|
| 31 |
+
string format = "",
|
| 32 |
+
|
| 33 |
+
// transformations, like encoding normals into [0,1] range
|
| 34 |
+
string transform = TRANSFORM_NONE,
|
| 35 |
+
|
| 36 |
+
// blending, e.g., based on alpha or replace
|
| 37 |
+
string blend_mode = BLEND_MODE_OPACITY
|
| 38 |
+
);
|
objects/blue_block/blue_block.usd
ADDED
|
Binary file (19.2 kB). View file
|
|
|
objects/brick/materials/robolab/objects/ycb/textures/obj_000021.png
ADDED
|
Git LFS Details
|
objects/contemporary_lockedstorage/materials/omniverse/simready_content/materials/SimPBR.mdl
ADDED
|
@@ -0,0 +1,562 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*****************************************************************************
|
| 2 |
+
* Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
******************************************************************************
|
| 4 |
+
|
| 5 |
+
MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
|
| 6 |
+
WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
|
| 7 |
+
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 8 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
| 9 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
| 10 |
+
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
|
| 11 |
+
CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
|
| 12 |
+
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
| 13 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
| 14 |
+
THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
|
| 15 |
+
THE MDL MATERIALS.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
mdl 1.4;
|
| 19 |
+
|
| 20 |
+
import ::df::*;
|
| 21 |
+
import ::state::*;
|
| 22 |
+
import ::math::*;
|
| 23 |
+
import ::base::*;
|
| 24 |
+
import ::tex::*;
|
| 25 |
+
import ::anno::*;
|
| 26 |
+
|
| 27 |
+
import ::nvidia::core_definitions::file_texture;
|
| 28 |
+
import ::nvidia::core_definitions::normalmap_texture;
|
| 29 |
+
|
| 30 |
+
using .::SimPBR_Model import *;
|
| 31 |
+
using .::baking_annotations import *;
|
| 32 |
+
|
| 33 |
+
export material SimPBR(
|
| 34 |
+
// -------------------- DIFFUSE REFLECTION ----------------------
|
| 35 |
+
color diffuse_color_constant = color(0.2f)
|
| 36 |
+
[[
|
| 37 |
+
anno::display_name("Albedo Base Color"),
|
| 38 |
+
anno::description("The base albedo color to use if no texture is specified"),
|
| 39 |
+
anno::in_group("Diffuse")
|
| 40 |
+
]],
|
| 41 |
+
uniform texture_2d diffuse_texture = texture_2d()
|
| 42 |
+
[[
|
| 43 |
+
anno::display_name("Albedo Map"),
|
| 44 |
+
anno::description("The texture specifying the albedo value to use"),
|
| 45 |
+
anno::in_group("Diffuse")
|
| 46 |
+
]],
|
| 47 |
+
uniform color diffuse_tint = color(1.0f)
|
| 48 |
+
[[
|
| 49 |
+
anno::display_name("Albedo Tint"),
|
| 50 |
+
anno::description("This tints the albedo color or texture contant"),
|
| 51 |
+
anno::in_group("Diffuse")
|
| 52 |
+
]],
|
| 53 |
+
uniform bool enable_transmission = false
|
| 54 |
+
[[
|
| 55 |
+
anno::display_name("Enable Diffuse Transmission"),
|
| 56 |
+
anno::description("Enables the diffuse transmission of light through thin diffuse scattering layer"),
|
| 57 |
+
anno::in_group("Diffuse")
|
| 58 |
+
]],
|
| 59 |
+
uniform float opacity_ratio = 1.f
|
| 60 |
+
[[
|
| 61 |
+
anno::enable_if("enable_transmission == true"),
|
| 62 |
+
anno::display_name("Opacity Ratio"),
|
| 63 |
+
anno::description("Amount of opacity"),
|
| 64 |
+
anno::in_group("Diffuse")
|
| 65 |
+
]],
|
| 66 |
+
uniform color opacity_tint = color(1.0f)
|
| 67 |
+
[[
|
| 68 |
+
anno::enable_if("enable_transmission == true"),
|
| 69 |
+
anno::display_name("Diffuse transmission tint"),
|
| 70 |
+
anno::description("Base diffuse transmission color"),
|
| 71 |
+
anno::in_group("Diffuse")
|
| 72 |
+
]],
|
| 73 |
+
uniform float opacity_multiplier = 1.f
|
| 74 |
+
[[
|
| 75 |
+
anno::enable_if("enable_transmission == true"),
|
| 76 |
+
anno::display_name("Diffuse transmission multiplier"),
|
| 77 |
+
anno::description("Base diffuse transmission multiplier"),
|
| 78 |
+
anno::in_group("Diffuse")
|
| 79 |
+
]],
|
| 80 |
+
|
| 81 |
+
// -------------------- SPECULAR REFLECTION ----------------------
|
| 82 |
+
float reflection_roughness_constant = 0.5f
|
| 83 |
+
[[
|
| 84 |
+
anno::display_name("Roughness Amount"),
|
| 85 |
+
anno::hard_range(0.0,1.),
|
| 86 |
+
anno::description("Higher roughness values lead to more blurry reflections"),
|
| 87 |
+
anno::in_group("Specular")
|
| 88 |
+
]],
|
| 89 |
+
uniform float reflection_roughness_texture_influence = 0.0f
|
| 90 |
+
[[
|
| 91 |
+
anno::display_name("Roughness Map Influence"),
|
| 92 |
+
anno::hard_range(0.0, 1.),
|
| 93 |
+
anno::description("Blends between the constant value and the lookup of the roughness texture"),
|
| 94 |
+
anno::in_group("Specular")
|
| 95 |
+
]],
|
| 96 |
+
uniform texture_2d reflectionroughness_texture = texture_2d()
|
| 97 |
+
[[
|
| 98 |
+
anno::display_name("Roughness Map"),
|
| 99 |
+
anno::in_group("Specular")
|
| 100 |
+
]],
|
| 101 |
+
|
| 102 |
+
float anisotropy_constant = 0.0f
|
| 103 |
+
[[
|
| 104 |
+
anno::display_name("Anisotropy Amount"),
|
| 105 |
+
anno::hard_range(-1.,1.),
|
| 106 |
+
anno::description("0 for isotropic, extents of -1 to 1 for anisotropy"),
|
| 107 |
+
anno::in_group("Specular")
|
| 108 |
+
]],
|
| 109 |
+
uniform float anisotropy_texture_influence = 0.0f
|
| 110 |
+
[[
|
| 111 |
+
anno::display_name("Anisotropy Map Influence"),
|
| 112 |
+
anno::hard_range(0.0, 1.),
|
| 113 |
+
anno::description("Blends between the constant value and the lookup of the anisotropy texture"),
|
| 114 |
+
anno::in_group("Specular")
|
| 115 |
+
]],
|
| 116 |
+
uniform texture_2d anisotropy_texture = texture_2d()
|
| 117 |
+
[[
|
| 118 |
+
anno::display_name("Anisotropy Map"),
|
| 119 |
+
anno::in_group("Specular")
|
| 120 |
+
]],
|
| 121 |
+
|
| 122 |
+
float metallic_constant = 0.f
|
| 123 |
+
[[
|
| 124 |
+
anno::display_name("Metallic Amount"),
|
| 125 |
+
anno::hard_range(0.0,1.),
|
| 126 |
+
anno::description("Metallic Material"),
|
| 127 |
+
anno::in_group("Specular")
|
| 128 |
+
]],
|
| 129 |
+
uniform float metallic_texture_influence = 0.0f
|
| 130 |
+
[[
|
| 131 |
+
anno::display_name("Metallic Map Influence"),
|
| 132 |
+
anno::hard_range(0.0, 1.),
|
| 133 |
+
anno::description("Blends between the constant value and the lookup of the metallic texture"),
|
| 134 |
+
anno::in_group("Specular")
|
| 135 |
+
]],
|
| 136 |
+
uniform texture_2d metallic_texture = texture_2d()
|
| 137 |
+
[[
|
| 138 |
+
anno::display_name("Metallic Map"),
|
| 139 |
+
anno::in_group("Specular")
|
| 140 |
+
]],
|
| 141 |
+
|
| 142 |
+
float specular_constant = 1.f
|
| 143 |
+
[[
|
| 144 |
+
anno::display_name("Specular amount"),
|
| 145 |
+
anno::hard_range(0.0, 1.0),
|
| 146 |
+
anno::description("Scale of the specular component"),
|
| 147 |
+
anno::in_group("Specular")
|
| 148 |
+
]],
|
| 149 |
+
uniform texture_2d specular_texture = texture_2d()
|
| 150 |
+
[[
|
| 151 |
+
anno::display_name("Specular Map"),
|
| 152 |
+
anno::in_group("Specular")
|
| 153 |
+
]],
|
| 154 |
+
|
| 155 |
+
// -------------------- ORM ----------------------
|
| 156 |
+
uniform bool enable_ORM_texture = true
|
| 157 |
+
[[
|
| 158 |
+
anno::display_name("Enable ORM Texture"),
|
| 159 |
+
anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
|
| 160 |
+
anno::in_group("Reflectivity")
|
| 161 |
+
]],
|
| 162 |
+
uniform texture_2d ORM_texture = texture_2d()
|
| 163 |
+
[[
|
| 164 |
+
anno::display_name("ORM Map"),
|
| 165 |
+
anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
|
| 166 |
+
anno::in_group("Reflectivity")
|
| 167 |
+
]],
|
| 168 |
+
|
| 169 |
+
// -------------------- Clearcoat ----------------------
|
| 170 |
+
uniform bool enable_clearcoat = false
|
| 171 |
+
[[
|
| 172 |
+
anno::display_name("Enable Clearcoat Layer"),
|
| 173 |
+
anno::description("Adds a clearcoat layer on top of the material when enabled"),
|
| 174 |
+
anno::in_group("Clearcoat")
|
| 175 |
+
]],
|
| 176 |
+
color clearcoat_tint = color(1.0f)
|
| 177 |
+
[[
|
| 178 |
+
anno::display_name("Clearcoat Tint"),
|
| 179 |
+
anno::description("Clearcoat is tinted and affects the underlying material"),
|
| 180 |
+
anno::in_group("Clearcoat")
|
| 181 |
+
]],
|
| 182 |
+
float clearcoat_transparency = 1.0f
|
| 183 |
+
[[
|
| 184 |
+
anno::display_name("Clearcoat Transparency"),
|
| 185 |
+
anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
|
| 186 |
+
"covering the underlying layer"),
|
| 187 |
+
anno::in_group("Clearcoat")
|
| 188 |
+
]],
|
| 189 |
+
float clearcoat_reflection_roughness = 0.0f
|
| 190 |
+
[[
|
| 191 |
+
anno::display_name("Clearcoat Roughness"),
|
| 192 |
+
anno::description("Higher roughness values lead to more blurry reflections"),
|
| 193 |
+
anno::hard_range(0.0f, 1.0f),
|
| 194 |
+
anno::in_group("Clearcoat")
|
| 195 |
+
]],
|
| 196 |
+
float clearcoat_weight = 1.0f
|
| 197 |
+
[[
|
| 198 |
+
anno::display_name("Clearcoat Weight"),
|
| 199 |
+
anno::description("Sets the weight for clearcoat layer"),
|
| 200 |
+
anno::hard_range(0.0f, 1.0f),
|
| 201 |
+
anno::in_group("Clearcoat")
|
| 202 |
+
]],
|
| 203 |
+
float clearcoat_flatten = 1.0f
|
| 204 |
+
[[
|
| 205 |
+
anno::display_name("Clearcoat Flatten"),
|
| 206 |
+
anno::description("Flattens the clearcoat to even out the underlying bump maps"),
|
| 207 |
+
anno::hard_range(0.0f, 1.0f),
|
| 208 |
+
anno::in_group("Clearcoat")
|
| 209 |
+
]],
|
| 210 |
+
float clearcoat_ior = 1.56f
|
| 211 |
+
[[
|
| 212 |
+
anno::display_name("Clearcoat IOR"),
|
| 213 |
+
anno::description("Sets the Index of refraction for the clearcoat layer"),
|
| 214 |
+
anno::soft_range(1.0f, 4.0f),
|
| 215 |
+
anno::in_group("Clearcoat")
|
| 216 |
+
]],
|
| 217 |
+
uniform float clearcoat_bump_factor = 1.f
|
| 218 |
+
[[
|
| 219 |
+
anno::display_name("Clearcoat Normal Map Strength"),
|
| 220 |
+
anno::description("Strength of normal map."),
|
| 221 |
+
anno::in_group("Clearcoat")
|
| 222 |
+
]],
|
| 223 |
+
|
| 224 |
+
float3 clearcoat_normal_input = float3(0.0, 0.0, 0.0),
|
| 225 |
+
uniform texture_2d clearcoat_normalmap_texture = texture_2d()
|
| 226 |
+
[[
|
| 227 |
+
anno::display_name("Clearcoat Normal Map"),
|
| 228 |
+
anno::description("Enables the usage of the normalmap texture"),
|
| 229 |
+
anno::in_group("Clearcoat")
|
| 230 |
+
]],
|
| 231 |
+
|
| 232 |
+
uniform bool clearcoat_flip_tangent_u = false
|
| 233 |
+
[[
|
| 234 |
+
anno::display_name("Clearcoat Normal Map Flip U Tangent"),
|
| 235 |
+
anno::in_group("Clearcoat")
|
| 236 |
+
]],
|
| 237 |
+
uniform bool clearcoat_flip_tangent_v = true
|
| 238 |
+
[[
|
| 239 |
+
anno::display_name("Clearcoat Normal Map Flip V Tangent"),
|
| 240 |
+
anno::in_group("Clearcoat")
|
| 241 |
+
]],
|
| 242 |
+
|
| 243 |
+
|
| 244 |
+
// -------------------- REFLECTIVITY ----------------------
|
| 245 |
+
uniform bool enable_retroreflection = false
|
| 246 |
+
[[
|
| 247 |
+
anno::display_name("Enable Retroreflection"),
|
| 248 |
+
anno::in_group("Reflectivity")
|
| 249 |
+
]],
|
| 250 |
+
color retroreflection_tint = color(.182,.800,.000)
|
| 251 |
+
[[
|
| 252 |
+
anno::display_name("Retro-reflection tint"),
|
| 253 |
+
anno::description("The tint of the retroreflection"),
|
| 254 |
+
anno::in_group("Reflectivity")
|
| 255 |
+
]],
|
| 256 |
+
uniform float normal_reflectivity = 0.5
|
| 257 |
+
[[
|
| 258 |
+
anno::display_name("Retro-reflection weight facing"),
|
| 259 |
+
anno::hard_range(0.0,1.),
|
| 260 |
+
anno::description("Reflectivity control for geometry facing the viewer"),
|
| 261 |
+
anno::in_group("Reflectivity")
|
| 262 |
+
]],
|
| 263 |
+
uniform float grazing_reflectivity = 1.0
|
| 264 |
+
[[
|
| 265 |
+
anno::display_name("Retro-reflection weight edge"),
|
| 266 |
+
anno::hard_range(0.0,1.),
|
| 267 |
+
anno::description("Reflectivity control for the reflectivity at geometry edges"),
|
| 268 |
+
anno::in_group("Reflectivity")
|
| 269 |
+
]],
|
| 270 |
+
|
| 271 |
+
// -------------------- AMBIENT OCCLUSION ----------------------
|
| 272 |
+
float ao_to_diffuse = 0.0
|
| 273 |
+
[[
|
| 274 |
+
anno::display_name("AO to Diffuse"),
|
| 275 |
+
anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
|
| 276 |
+
anno::in_group("AO")
|
| 277 |
+
]],
|
| 278 |
+
float ao_input = float(1.0),
|
| 279 |
+
uniform texture_2d ao_texture = texture_2d()
|
| 280 |
+
[[
|
| 281 |
+
anno::display_name("Ambient Occlusion Map"),
|
| 282 |
+
anno::description("The Ambient Occlusion texture for the material"),
|
| 283 |
+
anno::in_group("AO")
|
| 284 |
+
]],
|
| 285 |
+
|
| 286 |
+
// -------------------- EMISSIVE ----------------------
|
| 287 |
+
uniform bool enable_emission = false
|
| 288 |
+
[[
|
| 289 |
+
anno::display_name("Enable Emission"),
|
| 290 |
+
anno::description("Enables the emission of light from the material"),
|
| 291 |
+
anno::in_group("Emissive")
|
| 292 |
+
]],
|
| 293 |
+
uniform color emissive_color = color(1.0, 0.1, 0.1)
|
| 294 |
+
[[
|
| 295 |
+
anno::enable_if("enable_emission == true"),
|
| 296 |
+
anno::display_name("Emissive Color"),
|
| 297 |
+
anno::description("The emission color"),
|
| 298 |
+
anno::in_group("Emissive")
|
| 299 |
+
]],
|
| 300 |
+
|
| 301 |
+
color emissive_mask_input = color(1.0),
|
| 302 |
+
uniform texture_2d emissive_mask_texture = texture_2d()
|
| 303 |
+
[[
|
| 304 |
+
anno::enable_if("enable_emission == true"),
|
| 305 |
+
anno::display_name("Emissive Mask Map"),
|
| 306 |
+
anno::description("The texture masking the emissive color"),
|
| 307 |
+
anno::in_group("Emissive")
|
| 308 |
+
]],
|
| 309 |
+
uniform float emissive_intensity = 40.f
|
| 310 |
+
[[
|
| 311 |
+
anno::enable_if("enable_emission == true"),
|
| 312 |
+
anno::display_name("Emissive Intensity"),
|
| 313 |
+
anno::description("Intensity of the emission"),
|
| 314 |
+
anno::in_group("Emissive")
|
| 315 |
+
]],
|
| 316 |
+
uniform bool enable_emissive_flipbook = false
|
| 317 |
+
[[
|
| 318 |
+
anno::display_name("Enable Flipbook for emission"),
|
| 319 |
+
anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
|
| 320 |
+
anno::in_group("Emissive")
|
| 321 |
+
]],
|
| 322 |
+
uniform int2 flipbook_dim = int2(1,1)
|
| 323 |
+
[[
|
| 324 |
+
anno::enable_if("enable_emissive_flipbook == true"),
|
| 325 |
+
anno::display_name("Flipbook Rows/Columns"),
|
| 326 |
+
anno::description("How many rows and columns are in the flipbook?"),
|
| 327 |
+
anno::in_group("Emissive")
|
| 328 |
+
]],
|
| 329 |
+
uniform int target_fps = 1
|
| 330 |
+
[[
|
| 331 |
+
anno::enable_if("enable_emissive_flipbook == true"),
|
| 332 |
+
anno::display_name("Flipbook Target FPS"),
|
| 333 |
+
anno::description("Playback speed in frames per second"),
|
| 334 |
+
anno::in_group("Emissive")
|
| 335 |
+
]],
|
| 336 |
+
|
| 337 |
+
// -------------------- ALPHA ----------------------
|
| 338 |
+
uniform bool enable_opacity = false
|
| 339 |
+
[[
|
| 340 |
+
anno::display_name("Enable Opacity"),
|
| 341 |
+
anno::description("Enables or disables alpha functionality"),
|
| 342 |
+
anno::in_group("Alpha")
|
| 343 |
+
]],
|
| 344 |
+
float alpha_constant = 1.0
|
| 345 |
+
[[
|
| 346 |
+
anno::enable_if("enable_opacity == true"),
|
| 347 |
+
anno::display_name("Opacity Fallback Constant"),
|
| 348 |
+
anno::hard_range(0.0, 1.0),
|
| 349 |
+
anno::description("The base alpha constant to use if no texture is specified"),
|
| 350 |
+
anno::in_group("Alpha")
|
| 351 |
+
]],
|
| 352 |
+
uniform texture_2d opacity_texture = texture_2d()
|
| 353 |
+
[[
|
| 354 |
+
anno::enable_if("enable_opacity == true"),
|
| 355 |
+
anno::display_name("Opacity Map"),
|
| 356 |
+
anno::description("The texture specifying the opacity value to use"),
|
| 357 |
+
anno::in_group("Alpha")
|
| 358 |
+
]],
|
| 359 |
+
uniform bool enable_opacity_cutout = false
|
| 360 |
+
[[
|
| 361 |
+
anno::enable_if("enable_opacity == true"),
|
| 362 |
+
anno::display_name("Enable Alpha Cutout"),
|
| 363 |
+
anno::description("Enables or disables alpha cutout functionality"),
|
| 364 |
+
anno::in_group("Alpha")
|
| 365 |
+
]],
|
| 366 |
+
uniform float alpha_cutout_cutoff = 1.f
|
| 367 |
+
[[
|
| 368 |
+
anno::enable_if("enable_opacity == true"),
|
| 369 |
+
anno::enable_if("enable_opacity_cutout == true"),
|
| 370 |
+
anno::hard_range(0.0, 1.0),
|
| 371 |
+
anno::display_name("Alpha Cutout Cutoff"),
|
| 372 |
+
anno::description("The cutoff value to to render as transparent up to and opaque past"),
|
| 373 |
+
anno::in_group("Alpha")
|
| 374 |
+
]],
|
| 375 |
+
|
| 376 |
+
// -------------------- NORMAL ----------------------
|
| 377 |
+
uniform float bump_factor = 1.f
|
| 378 |
+
[[
|
| 379 |
+
anno::display_name("Normal Map Strength"),
|
| 380 |
+
anno::description("Strength of normal map."),
|
| 381 |
+
anno::in_group("Normal")
|
| 382 |
+
]],
|
| 383 |
+
|
| 384 |
+
float3 normal_input = state::normal(),
|
| 385 |
+
uniform texture_2d normalmap_texture = texture_2d()
|
| 386 |
+
[[
|
| 387 |
+
anno::display_name("Normal Map"),
|
| 388 |
+
anno::in_group("Normal")
|
| 389 |
+
]],
|
| 390 |
+
uniform bool flip_tangent_u = false
|
| 391 |
+
[[
|
| 392 |
+
anno::display_name("Normal Map Flip U Tangent"),
|
| 393 |
+
anno::in_group("Normal")
|
| 394 |
+
]],
|
| 395 |
+
uniform bool flip_tangent_v = true
|
| 396 |
+
[[
|
| 397 |
+
anno::display_name("Normal Map Flip V Tangent"),
|
| 398 |
+
anno::in_group("Normal")
|
| 399 |
+
]],
|
| 400 |
+
|
| 401 |
+
// -------------------- UV ADJUSTMENTS ----------------------
|
| 402 |
+
uniform bool project_uvw = false
|
| 403 |
+
[[
|
| 404 |
+
anno::display_name("Enable Project UVW Coordinates"),
|
| 405 |
+
anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
|
| 406 |
+
anno::in_group("UV")
|
| 407 |
+
]],
|
| 408 |
+
uniform bool world_or_object = false
|
| 409 |
+
[[
|
| 410 |
+
anno::enable_if("project_uvw == true"),
|
| 411 |
+
anno::display_name("Enable World Space"),
|
| 412 |
+
anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
|
| 413 |
+
anno::in_group("UV")
|
| 414 |
+
]],
|
| 415 |
+
uniform float2 texture_translate = float2(0.0f)
|
| 416 |
+
[[
|
| 417 |
+
anno::display_name("Texture Translate"),
|
| 418 |
+
anno::description("Controls position of texture."),
|
| 419 |
+
anno::in_group("UV")
|
| 420 |
+
]],
|
| 421 |
+
uniform float2 texture_scale = float2(1.0f)
|
| 422 |
+
[[
|
| 423 |
+
anno::display_name("Texture Tiling"),
|
| 424 |
+
anno::description("Controls repetition of the texture."),
|
| 425 |
+
anno::in_group("UV")
|
| 426 |
+
]],
|
| 427 |
+
uniform float2 texture_speed = float2(0.0f)
|
| 428 |
+
[[
|
| 429 |
+
anno::display_name("Texture Speed"),
|
| 430 |
+
anno::description("Scrolling texture animation speed in UVs per sec."),
|
| 431 |
+
anno::in_group("UV")
|
| 432 |
+
]]
|
| 433 |
+
)
|
| 434 |
+
[[
|
| 435 |
+
anno::display_name("Sim PBR"),
|
| 436 |
+
anno::description("Supports the opaque alpha cutout material model of the Sim Renderer"),
|
| 437 |
+
anno::in_group("SimReady"),
|
| 438 |
+
anno::version( 1, 0, 0),
|
| 439 |
+
anno::author("NVIDIA CORPORATION"),
|
| 440 |
+
anno::key_words(string[]("Sim", "PBR", "opaque", "alpha", "cutout", "omniverse", "generic"))
|
| 441 |
+
]]
|
| 442 |
+
= let {
|
| 443 |
+
base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
|
| 444 |
+
|
| 445 |
+
base::texture_coordinate_info uvw = project_uvw ?
|
| 446 |
+
base::coordinate_projection(
|
| 447 |
+
coordinate_system: the_system,
|
| 448 |
+
texture_space: 0,
|
| 449 |
+
projection_type: base::projection_cubic
|
| 450 |
+
) : base::coordinate_source(
|
| 451 |
+
coordinate_system: base::texture_coordinate_uvw,
|
| 452 |
+
texture_space: 0
|
| 453 |
+
);
|
| 454 |
+
|
| 455 |
+
// Need to use a small value so the compiler doesnt optimize out this var...
|
| 456 |
+
float t = 0.00000001;//state::animation_time();
|
| 457 |
+
base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
|
| 458 |
+
transform: base::rotation_translation_scale(
|
| 459 |
+
scaling: float3(texture_scale.x, texture_scale.y, 1.0),
|
| 460 |
+
rotation: float3(0.0, 0.0, 0.0 ),
|
| 461 |
+
translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
|
| 462 |
+
coordinate: uvw
|
| 463 |
+
);
|
| 464 |
+
float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
|
| 465 |
+
|
| 466 |
+
// Diffuse Color Lookup and AO
|
| 467 |
+
float4 base_lookup = tex::texture_isvalid(diffuse_texture) ? tex::lookup_float4(tex: diffuse_texture, coord: uv) : float4(1, 1, 1, 1);
|
| 468 |
+
|
| 469 |
+
float opacityValue = tex::texture_isvalid(opacity_texture) ? tex::lookup_float4(tex: opacity_texture, coord: uv).w : alpha_constant;
|
| 470 |
+
|
| 471 |
+
// Normal calculations
|
| 472 |
+
float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
|
| 473 |
+
base::tangent_space_normal_texture(
|
| 474 |
+
texture: normalmap_texture,
|
| 475 |
+
factor: bump_factor,
|
| 476 |
+
uvw: transformed_uvw,
|
| 477 |
+
flip_tangent_u: flip_tangent_u,
|
| 478 |
+
flip_tangent_v: flip_tangent_v
|
| 479 |
+
) : normal_input;
|
| 480 |
+
|
| 481 |
+
float3 clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ?
|
| 482 |
+
base::tangent_space_normal_texture(
|
| 483 |
+
texture: clearcoat_normalmap_texture,
|
| 484 |
+
factor: clearcoat_bump_factor,
|
| 485 |
+
uvw: uvw,
|
| 486 |
+
flip_tangent_u: clearcoat_flip_tangent_u,
|
| 487 |
+
flip_tangent_v: clearcoat_flip_tangent_v
|
| 488 |
+
) : clearcoat_normal_input;
|
| 489 |
+
|
| 490 |
+
float3 flattened_clearcoat_normal = ::math::lerp(normal_lookup, ::state::normal(), clearcoat_flatten);
|
| 491 |
+
float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? clearcoat_normal : flattened_clearcoat_normal;
|
| 492 |
+
|
| 493 |
+
float ao_lookup = tex::texture_isvalid(ao_texture) ? tex::lookup_float4(tex: ao_texture, coord: uv).x : ao_input;
|
| 494 |
+
|
| 495 |
+
color diffuse_color = tex::texture_isvalid(diffuse_texture) ? color(base_lookup.x, base_lookup.y, base_lookup.z) : diffuse_color_constant;
|
| 496 |
+
|
| 497 |
+
float3 ORM_lookup = tex::lookup_float3(
|
| 498 |
+
tex: ORM_texture,
|
| 499 |
+
coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
|
| 500 |
+
);
|
| 501 |
+
|
| 502 |
+
float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
|
| 503 |
+
tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
|
| 504 |
+
float anisotropy_lookup = tex::texture_isvalid(anisotropy_texture) ?
|
| 505 |
+
(tex::lookup_float4(tex: anisotropy_texture, coord: uv).x * 2.0f - 1.0f) : anisotropy_constant;
|
| 506 |
+
float metallic_lookup = tex::texture_isvalid(metallic_texture) ?
|
| 507 |
+
tex::lookup_float4(tex: metallic_texture, coord: uv).x : metallic_constant;
|
| 508 |
+
float specular_lookup = tex::texture_isvalid(specular_texture) ?
|
| 509 |
+
tex::lookup_float4(tex: specular_texture, coord: uv).x : specular_constant;
|
| 510 |
+
|
| 511 |
+
float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup;
|
| 512 |
+
float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup;
|
| 513 |
+
float ao = enable_ORM_texture ? ORM_lookup.x : ao_lookup;
|
| 514 |
+
|
| 515 |
+
float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
|
| 516 |
+
float anisotropy = math::lerp(anisotropy_constant, anisotropy_lookup, anisotropy_texture_influence);
|
| 517 |
+
float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
|
| 518 |
+
|
| 519 |
+
int rows = flipbook_dim.x;
|
| 520 |
+
int columns = flipbook_dim.y;
|
| 521 |
+
int numFrames = rows * columns;
|
| 522 |
+
varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
|
| 523 |
+
varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
|
| 524 |
+
varying float2 emissiveUV = enable_emissive_flipbook ?
|
| 525 |
+
((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
|
| 526 |
+
|
| 527 |
+
color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
|
| 528 |
+
tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : emissive_mask_input;
|
| 529 |
+
|
| 530 |
+
} in SimPBR_Model(
|
| 531 |
+
diffuse_color: diffuse_color,
|
| 532 |
+
diffuse_tint: diffuse_tint,
|
| 533 |
+
roughness: reflection_roughness,
|
| 534 |
+
anisotropy: anisotropy,
|
| 535 |
+
metallic: metallic,
|
| 536 |
+
specular: specular_lookup,
|
| 537 |
+
normal: normal_lookup,
|
| 538 |
+
enable_clearcoat: enable_clearcoat,
|
| 539 |
+
clearcoat_tint: clearcoat_tint,
|
| 540 |
+
clearcoat_transparency: clearcoat_transparency,
|
| 541 |
+
clearcoat_reflection_roughness: clearcoat_reflection_roughness,
|
| 542 |
+
clearcoat_weight: clearcoat_weight,
|
| 543 |
+
clearcoat_ior: clearcoat_ior,
|
| 544 |
+
clearcoat_normal: final_clearcoat_normal,
|
| 545 |
+
enable_retroreflection: enable_retroreflection,
|
| 546 |
+
retroreflection_tint: retroreflection_tint,
|
| 547 |
+
normal_reflectivity: normal_reflectivity,
|
| 548 |
+
grazing_reflectivity: grazing_reflectivity,
|
| 549 |
+
ao_to_diffuse: ao_to_diffuse,
|
| 550 |
+
ao: ao,
|
| 551 |
+
enable_emission: enable_emission,
|
| 552 |
+
emissive_color: emissive_color,
|
| 553 |
+
emissive_mask: emissive_mask,
|
| 554 |
+
emissive_intensity: emissive_intensity,
|
| 555 |
+
enable_opacity: enable_opacity,
|
| 556 |
+
alpha: opacityValue,
|
| 557 |
+
enable_opacity_cutout: enable_opacity_cutout,
|
| 558 |
+
alpha_cutout_cutoff: alpha_cutout_cutoff,
|
| 559 |
+
opacity_ratio: enable_transmission ? opacity_ratio : 1.0,
|
| 560 |
+
opacity_tint : opacity_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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*****************************************************************************
|
| 2 |
+
* Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
******************************************************************************
|
| 4 |
+
|
| 5 |
+
MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
|
| 6 |
+
WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
|
| 7 |
+
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 8 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
| 9 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
| 10 |
+
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
|
| 11 |
+
CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
|
| 12 |
+
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
| 13 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
| 14 |
+
THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
|
| 15 |
+
THE MDL MATERIALS.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
mdl 1.4;
|
| 19 |
+
|
| 20 |
+
import ::df::*;
|
| 21 |
+
import ::state::*;
|
| 22 |
+
import ::math::*;
|
| 23 |
+
import ::base::*;
|
| 24 |
+
import ::tex::*;
|
| 25 |
+
import ::anno::*;
|
| 26 |
+
|
| 27 |
+
using .::baking_annotations import *;
|
| 28 |
+
|
| 29 |
+
base::texture_return multiply_colors(
|
| 30 |
+
color color_1 = color(1.0, 1.0, 1.0),
|
| 31 |
+
color color_2 = color(.5, .5, .5),
|
| 32 |
+
float weight = 1.0
|
| 33 |
+
)
|
| 34 |
+
[[
|
| 35 |
+
anno::hidden()
|
| 36 |
+
]]
|
| 37 |
+
{
|
| 38 |
+
return base::blend_color_layers(
|
| 39 |
+
layers: base::color_layer[](
|
| 40 |
+
base::color_layer(
|
| 41 |
+
layer_color: color_2,
|
| 42 |
+
weight: weight,
|
| 43 |
+
mode: base::color_layer_multiply
|
| 44 |
+
)
|
| 45 |
+
), base: color_1
|
| 46 |
+
);
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
export material SimPBR_Model(
|
| 50 |
+
color diffuse_color = color(0.2f) [[ target_baked_argument("diffuse_texture", "diffuse_color_constant", "RGBA8_UNORM") ]],
|
| 51 |
+
uniform color diffuse_tint = color(1.0f),
|
| 52 |
+
float roughness = 0.5f [[ target_baked_argument("reflectionroughness_texture", "reflection_roughness_constant", "R8_UNORM") ]],
|
| 53 |
+
float anisotropy = 0.0f [[ target_baked_argument("anisotropy_texture", "anisotropy_constant", "R8_SNORM") ]],
|
| 54 |
+
float metallic = 0.f [[ target_baked_argument("metallic_texture", "metallic_constant", "R8_UNORM") ]],
|
| 55 |
+
float specular = 1.f [[ target_baked_argument("specular_texture", "specular_constant", "R8_UNORM") ]],
|
| 56 |
+
float3 normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("normalmap_texture", "normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
|
| 57 |
+
uniform bool enable_clearcoat = false,
|
| 58 |
+
color clearcoat_tint = color(1.0f),
|
| 59 |
+
float clearcoat_transparency = 1.0f,
|
| 60 |
+
float clearcoat_reflection_roughness = 0.0f,
|
| 61 |
+
float clearcoat_weight = 1.0f,
|
| 62 |
+
float clearcoat_ior = 1.56f,
|
| 63 |
+
float3 clearcoat_normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("clearcoat_normalmap_texture", "clearcoat_normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
|
| 64 |
+
uniform bool enable_retroreflection = false,
|
| 65 |
+
color retroreflection_tint = color(.182,.800,.000),
|
| 66 |
+
uniform float normal_reflectivity = 0.5,
|
| 67 |
+
uniform float grazing_reflectivity = 1.0,
|
| 68 |
+
float ao_to_diffuse = 0.0,
|
| 69 |
+
float ao = 1.0f [[ target_baked_argument("ao_texture", "ao_input", "R8_UNORM") ]],
|
| 70 |
+
uniform bool enable_emission = false,
|
| 71 |
+
uniform color emissive_color = color(1.0, 0.1, 0.1),
|
| 72 |
+
color emissive_mask = color(1.0, 0.1, 0.1) [[ target_baked_argument("emissive_mask_texture", "emissive_mask_input", "R8_UNORM") ]],
|
| 73 |
+
uniform float emissive_intensity = 40.f,
|
| 74 |
+
uniform bool enable_opacity = false,
|
| 75 |
+
float alpha = 1.0,
|
| 76 |
+
uniform bool enable_opacity_cutout = false,
|
| 77 |
+
uniform float alpha_cutout_cutoff = 1.f,
|
| 78 |
+
uniform float opacity_ratio = 1.f,
|
| 79 |
+
uniform color opacity_tint = color(1.0f),
|
| 80 |
+
uniform float opacity_multiplier = 1.f
|
| 81 |
+
)
|
| 82 |
+
[[
|
| 83 |
+
target_material_model(),
|
| 84 |
+
target_material_rendering("..::SimPBR::SimPBR")
|
| 85 |
+
]]
|
| 86 |
+
= let {
|
| 87 |
+
color base_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint;
|
| 88 |
+
color ao_weighted_base_color = multiply_colors(base_color, color(ao), ao_to_diffuse).tint;
|
| 89 |
+
|
| 90 |
+
float squared_roughness = roughness * roughness;
|
| 91 |
+
float roughness_u = squared_roughness * (1 + anisotropy);
|
| 92 |
+
float roughness_v = squared_roughness * (1 - anisotropy);
|
| 93 |
+
|
| 94 |
+
color diffuse_transmission_color = base_color * opacity_tint * opacity_multiplier;
|
| 95 |
+
|
| 96 |
+
bsdf diffuse_bsdf = df::weighted_layer(
|
| 97 |
+
weight: opacity_ratio,
|
| 98 |
+
layer: df::diffuse_reflection_bsdf(
|
| 99 |
+
tint: ao_weighted_base_color,
|
| 100 |
+
roughness: 0.0f
|
| 101 |
+
),
|
| 102 |
+
base: df::diffuse_transmission_bsdf(tint: diffuse_transmission_color),
|
| 103 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 104 |
+
);
|
| 105 |
+
|
| 106 |
+
bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
|
| 107 |
+
roughness_u: roughness_u,
|
| 108 |
+
roughness_v: roughness_v,
|
| 109 |
+
tint: color(1.0, 1.0, 1.0),
|
| 110 |
+
mode: df::scatter_reflect
|
| 111 |
+
);
|
| 112 |
+
|
| 113 |
+
bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
|
| 114 |
+
normal_reflectivity: 0.03,
|
| 115 |
+
grazing_reflectivity: 1.0,
|
| 116 |
+
exponent: 5.0,
|
| 117 |
+
weight: specular,
|
| 118 |
+
layer: ggx_smith_bsdf,
|
| 119 |
+
base: diffuse_bsdf,
|
| 120 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 121 |
+
);
|
| 122 |
+
|
| 123 |
+
//
|
| 124 |
+
// Begin RETROREFLECTION SUPPORT
|
| 125 |
+
//
|
| 126 |
+
color final_retroreflection_color = multiply_colors(retroreflection_tint, base_color, 1.0).tint;
|
| 127 |
+
bsdf backscattering_glossy_bsdf = df::backscattering_glossy_reflection_bsdf(
|
| 128 |
+
tint: final_retroreflection_color,
|
| 129 |
+
roughness_u: squared_roughness
|
| 130 |
+
);
|
| 131 |
+
|
| 132 |
+
/*bsdf retroreflection_bsdf = df::custom_curve_layer(
|
| 133 |
+
normal_reflectivity: 1.-normal_reflectivity,
|
| 134 |
+
grazing_reflectivity: 1.-grazing_reflectivity,
|
| 135 |
+
base: backscattering_glossy_bsdf,
|
| 136 |
+
layer: custom_curve_layer_bsdf,
|
| 137 |
+
normal: enable_clearcoat ? normal_lookup : state::normal()
|
| 138 |
+
);*/
|
| 139 |
+
|
| 140 |
+
// if normal_reflectivity and grazing_reflectivity are 1 and weight is 1, just the layer is used
|
| 141 |
+
bsdf opt_retroreflection_bsdf = df::custom_curve_layer(
|
| 142 |
+
normal_reflectivity: enable_retroreflection ? 1.-normal_reflectivity : 1,
|
| 143 |
+
grazing_reflectivity: enable_retroreflection ? 1.-grazing_reflectivity : 1,
|
| 144 |
+
base: backscattering_glossy_bsdf,
|
| 145 |
+
layer: custom_curve_layer_bsdf,
|
| 146 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 147 |
+
);
|
| 148 |
+
|
| 149 |
+
//
|
| 150 |
+
// End RETROREFLECTION SUPPORT
|
| 151 |
+
//
|
| 152 |
+
|
| 153 |
+
bsdf directional_factor_bsdf = df::directional_factor(
|
| 154 |
+
normal_tint: ao_weighted_base_color,
|
| 155 |
+
grazing_tint: color(1.0, 1.0, 1.0),
|
| 156 |
+
exponent: 5.0f,
|
| 157 |
+
base: ggx_smith_bsdf
|
| 158 |
+
);
|
| 159 |
+
|
| 160 |
+
// CLEARCOAT
|
| 161 |
+
bsdf omni_PBR_bsdf = df::weighted_layer(
|
| 162 |
+
weight: metallic,
|
| 163 |
+
layer: directional_factor_bsdf,
|
| 164 |
+
base: opt_retroreflection_bsdf, //enable_retroreflection ? retroreflection_bsdf : custom_curve_layer_bsdf,
|
| 165 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 166 |
+
);
|
| 167 |
+
|
| 168 |
+
bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
|
| 169 |
+
roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
|
| 170 |
+
roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
|
| 171 |
+
tint: color(1.0f),
|
| 172 |
+
mode: df::scatter_reflect
|
| 173 |
+
);
|
| 174 |
+
|
| 175 |
+
// bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
|
| 176 |
+
// normal_reflectivity: clearcoat_reflectivity * 0.08,
|
| 177 |
+
// grazing_reflectivity: 1.0,
|
| 178 |
+
// weight: clearcoat_weight,
|
| 179 |
+
// layer: clearcoat_bsdf,
|
| 180 |
+
// base: omni_PBR_bsdf,
|
| 181 |
+
// normal: final_clearcoat_normal
|
| 182 |
+
// );
|
| 183 |
+
|
| 184 |
+
bsdf opt_opaque_clearcoat = df::weighted_layer(
|
| 185 |
+
weight: enable_clearcoat ? clearcoat_transparency : 1,
|
| 186 |
+
layer: ::df::tint(tint: enable_clearcoat ? clearcoat_tint : color(1), base: omni_PBR_bsdf),
|
| 187 |
+
base: ::df::diffuse_reflection_bsdf(tint: clearcoat_tint)
|
| 188 |
+
);
|
| 189 |
+
|
| 190 |
+
bsdf opt_omni_PBR_coated_bsdf = df::fresnel_layer(
|
| 191 |
+
ior: clearcoat_ior,
|
| 192 |
+
weight: enable_clearcoat ? clearcoat_weight : 0,
|
| 193 |
+
layer: clearcoat_bsdf,
|
| 194 |
+
base: opt_opaque_clearcoat,
|
| 195 |
+
normal: clearcoat_normal
|
| 196 |
+
);
|
| 197 |
+
|
| 198 |
+
bsdf final_bsdf = opt_omni_PBR_coated_bsdf;
|
| 199 |
+
} in material(
|
| 200 |
+
thin_walled: false,
|
| 201 |
+
surface: material_surface(
|
| 202 |
+
scattering: final_bsdf,
|
| 203 |
+
emission: material_emission(
|
| 204 |
+
df::diffuse_edf(),
|
| 205 |
+
intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
|
| 206 |
+
)
|
| 207 |
+
),
|
| 208 |
+
geometry: material_geometry(
|
| 209 |
+
normal: enable_clearcoat ? state::normal() : normal,
|
| 210 |
+
cutout_opacity: enable_opacity ? (enable_opacity_cutout ? (alpha < alpha_cutout_cutoff ? 0.0 : 1.0) : alpha) : 1.0
|
| 211 |
+
)
|
| 212 |
+
);
|
objects/contemporary_lockedstorage/materials/omniverse/simready_content/materials/baking_annotations.mdl
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.4;
|
| 2 |
+
import ::anno::*;
|
| 3 |
+
|
| 4 |
+
export const string TRANSFORM_NONE = "NONE";
|
| 5 |
+
export const string TRANSFORM_UNORM_VECTOR = "UNORM_VECTOR";
|
| 6 |
+
|
| 7 |
+
export const string FORMAT_RGBA8_UNORM = "RGBA8_UNORM";
|
| 8 |
+
export const string FORMAT_R8_UNORM = "R8_UNORM";
|
| 9 |
+
export const string FORMAT_RGBA16_SFLOAT = "RGBA16_SFLOAT";
|
| 10 |
+
|
| 11 |
+
export const string BLEND_MODE_OPACITY = "opacity_blend";
|
| 12 |
+
export const string BLEND_MODE_REPLACE = "replace";
|
| 13 |
+
|
| 14 |
+
// This annotation is used to mark a material as target material for baking.
|
| 15 |
+
// It is that is detected by the MDL SDK and neuray.
|
| 16 |
+
export annotation target_material_model();
|
| 17 |
+
|
| 18 |
+
export annotation target_material_rendering(
|
| 19 |
+
string rendering_material_override = "" // if set, the baked material will be rendering using this material,
|
| 20 |
+
// otherwise the target itself is used
|
| 21 |
+
);
|
| 22 |
+
|
| 23 |
+
export annotation target_baked_argument(
|
| 24 |
+
// the name of the baked texture parameter in the rendering material
|
| 25 |
+
string baked_name,
|
| 26 |
+
|
| 27 |
+
// the name of the constant parameter in the rendering material in case baking was not necessary
|
| 28 |
+
string constant_name = "",
|
| 29 |
+
|
| 30 |
+
// texture format to bake to
|
| 31 |
+
string format = "",
|
| 32 |
+
|
| 33 |
+
// transformations, like encoding normals into [0,1] range
|
| 34 |
+
string transform = TRANSFORM_NONE,
|
| 35 |
+
|
| 36 |
+
// blending, e.g., based on alpha or replace
|
| 37 |
+
string blend_mode = BLEND_MODE_OPACITY
|
| 38 |
+
);
|
objects/contemporary_lowfulldesk/materials/omniverse/simready_content/materials/SimPBR.mdl
ADDED
|
@@ -0,0 +1,562 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*****************************************************************************
|
| 2 |
+
* Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
******************************************************************************
|
| 4 |
+
|
| 5 |
+
MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
|
| 6 |
+
WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
|
| 7 |
+
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 8 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
| 9 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
| 10 |
+
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
|
| 11 |
+
CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
|
| 12 |
+
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
| 13 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
| 14 |
+
THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
|
| 15 |
+
THE MDL MATERIALS.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
mdl 1.4;
|
| 19 |
+
|
| 20 |
+
import ::df::*;
|
| 21 |
+
import ::state::*;
|
| 22 |
+
import ::math::*;
|
| 23 |
+
import ::base::*;
|
| 24 |
+
import ::tex::*;
|
| 25 |
+
import ::anno::*;
|
| 26 |
+
|
| 27 |
+
import ::nvidia::core_definitions::file_texture;
|
| 28 |
+
import ::nvidia::core_definitions::normalmap_texture;
|
| 29 |
+
|
| 30 |
+
using .::SimPBR_Model import *;
|
| 31 |
+
using .::baking_annotations import *;
|
| 32 |
+
|
| 33 |
+
export material SimPBR(
|
| 34 |
+
// -------------------- DIFFUSE REFLECTION ----------------------
|
| 35 |
+
color diffuse_color_constant = color(0.2f)
|
| 36 |
+
[[
|
| 37 |
+
anno::display_name("Albedo Base Color"),
|
| 38 |
+
anno::description("The base albedo color to use if no texture is specified"),
|
| 39 |
+
anno::in_group("Diffuse")
|
| 40 |
+
]],
|
| 41 |
+
uniform texture_2d diffuse_texture = texture_2d()
|
| 42 |
+
[[
|
| 43 |
+
anno::display_name("Albedo Map"),
|
| 44 |
+
anno::description("The texture specifying the albedo value to use"),
|
| 45 |
+
anno::in_group("Diffuse")
|
| 46 |
+
]],
|
| 47 |
+
uniform color diffuse_tint = color(1.0f)
|
| 48 |
+
[[
|
| 49 |
+
anno::display_name("Albedo Tint"),
|
| 50 |
+
anno::description("This tints the albedo color or texture contant"),
|
| 51 |
+
anno::in_group("Diffuse")
|
| 52 |
+
]],
|
| 53 |
+
uniform bool enable_transmission = false
|
| 54 |
+
[[
|
| 55 |
+
anno::display_name("Enable Diffuse Transmission"),
|
| 56 |
+
anno::description("Enables the diffuse transmission of light through thin diffuse scattering layer"),
|
| 57 |
+
anno::in_group("Diffuse")
|
| 58 |
+
]],
|
| 59 |
+
uniform float opacity_ratio = 1.f
|
| 60 |
+
[[
|
| 61 |
+
anno::enable_if("enable_transmission == true"),
|
| 62 |
+
anno::display_name("Opacity Ratio"),
|
| 63 |
+
anno::description("Amount of opacity"),
|
| 64 |
+
anno::in_group("Diffuse")
|
| 65 |
+
]],
|
| 66 |
+
uniform color opacity_tint = color(1.0f)
|
| 67 |
+
[[
|
| 68 |
+
anno::enable_if("enable_transmission == true"),
|
| 69 |
+
anno::display_name("Diffuse transmission tint"),
|
| 70 |
+
anno::description("Base diffuse transmission color"),
|
| 71 |
+
anno::in_group("Diffuse")
|
| 72 |
+
]],
|
| 73 |
+
uniform float opacity_multiplier = 1.f
|
| 74 |
+
[[
|
| 75 |
+
anno::enable_if("enable_transmission == true"),
|
| 76 |
+
anno::display_name("Diffuse transmission multiplier"),
|
| 77 |
+
anno::description("Base diffuse transmission multiplier"),
|
| 78 |
+
anno::in_group("Diffuse")
|
| 79 |
+
]],
|
| 80 |
+
|
| 81 |
+
// -------------------- SPECULAR REFLECTION ----------------------
|
| 82 |
+
float reflection_roughness_constant = 0.5f
|
| 83 |
+
[[
|
| 84 |
+
anno::display_name("Roughness Amount"),
|
| 85 |
+
anno::hard_range(0.0,1.),
|
| 86 |
+
anno::description("Higher roughness values lead to more blurry reflections"),
|
| 87 |
+
anno::in_group("Specular")
|
| 88 |
+
]],
|
| 89 |
+
uniform float reflection_roughness_texture_influence = 0.0f
|
| 90 |
+
[[
|
| 91 |
+
anno::display_name("Roughness Map Influence"),
|
| 92 |
+
anno::hard_range(0.0, 1.),
|
| 93 |
+
anno::description("Blends between the constant value and the lookup of the roughness texture"),
|
| 94 |
+
anno::in_group("Specular")
|
| 95 |
+
]],
|
| 96 |
+
uniform texture_2d reflectionroughness_texture = texture_2d()
|
| 97 |
+
[[
|
| 98 |
+
anno::display_name("Roughness Map"),
|
| 99 |
+
anno::in_group("Specular")
|
| 100 |
+
]],
|
| 101 |
+
|
| 102 |
+
float anisotropy_constant = 0.0f
|
| 103 |
+
[[
|
| 104 |
+
anno::display_name("Anisotropy Amount"),
|
| 105 |
+
anno::hard_range(-1.,1.),
|
| 106 |
+
anno::description("0 for isotropic, extents of -1 to 1 for anisotropy"),
|
| 107 |
+
anno::in_group("Specular")
|
| 108 |
+
]],
|
| 109 |
+
uniform float anisotropy_texture_influence = 0.0f
|
| 110 |
+
[[
|
| 111 |
+
anno::display_name("Anisotropy Map Influence"),
|
| 112 |
+
anno::hard_range(0.0, 1.),
|
| 113 |
+
anno::description("Blends between the constant value and the lookup of the anisotropy texture"),
|
| 114 |
+
anno::in_group("Specular")
|
| 115 |
+
]],
|
| 116 |
+
uniform texture_2d anisotropy_texture = texture_2d()
|
| 117 |
+
[[
|
| 118 |
+
anno::display_name("Anisotropy Map"),
|
| 119 |
+
anno::in_group("Specular")
|
| 120 |
+
]],
|
| 121 |
+
|
| 122 |
+
float metallic_constant = 0.f
|
| 123 |
+
[[
|
| 124 |
+
anno::display_name("Metallic Amount"),
|
| 125 |
+
anno::hard_range(0.0,1.),
|
| 126 |
+
anno::description("Metallic Material"),
|
| 127 |
+
anno::in_group("Specular")
|
| 128 |
+
]],
|
| 129 |
+
uniform float metallic_texture_influence = 0.0f
|
| 130 |
+
[[
|
| 131 |
+
anno::display_name("Metallic Map Influence"),
|
| 132 |
+
anno::hard_range(0.0, 1.),
|
| 133 |
+
anno::description("Blends between the constant value and the lookup of the metallic texture"),
|
| 134 |
+
anno::in_group("Specular")
|
| 135 |
+
]],
|
| 136 |
+
uniform texture_2d metallic_texture = texture_2d()
|
| 137 |
+
[[
|
| 138 |
+
anno::display_name("Metallic Map"),
|
| 139 |
+
anno::in_group("Specular")
|
| 140 |
+
]],
|
| 141 |
+
|
| 142 |
+
float specular_constant = 1.f
|
| 143 |
+
[[
|
| 144 |
+
anno::display_name("Specular amount"),
|
| 145 |
+
anno::hard_range(0.0, 1.0),
|
| 146 |
+
anno::description("Scale of the specular component"),
|
| 147 |
+
anno::in_group("Specular")
|
| 148 |
+
]],
|
| 149 |
+
uniform texture_2d specular_texture = texture_2d()
|
| 150 |
+
[[
|
| 151 |
+
anno::display_name("Specular Map"),
|
| 152 |
+
anno::in_group("Specular")
|
| 153 |
+
]],
|
| 154 |
+
|
| 155 |
+
// -------------------- ORM ----------------------
|
| 156 |
+
uniform bool enable_ORM_texture = true
|
| 157 |
+
[[
|
| 158 |
+
anno::display_name("Enable ORM Texture"),
|
| 159 |
+
anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
|
| 160 |
+
anno::in_group("Reflectivity")
|
| 161 |
+
]],
|
| 162 |
+
uniform texture_2d ORM_texture = texture_2d()
|
| 163 |
+
[[
|
| 164 |
+
anno::display_name("ORM Map"),
|
| 165 |
+
anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
|
| 166 |
+
anno::in_group("Reflectivity")
|
| 167 |
+
]],
|
| 168 |
+
|
| 169 |
+
// -------------------- Clearcoat ----------------------
|
| 170 |
+
uniform bool enable_clearcoat = false
|
| 171 |
+
[[
|
| 172 |
+
anno::display_name("Enable Clearcoat Layer"),
|
| 173 |
+
anno::description("Adds a clearcoat layer on top of the material when enabled"),
|
| 174 |
+
anno::in_group("Clearcoat")
|
| 175 |
+
]],
|
| 176 |
+
color clearcoat_tint = color(1.0f)
|
| 177 |
+
[[
|
| 178 |
+
anno::display_name("Clearcoat Tint"),
|
| 179 |
+
anno::description("Clearcoat is tinted and affects the underlying material"),
|
| 180 |
+
anno::in_group("Clearcoat")
|
| 181 |
+
]],
|
| 182 |
+
float clearcoat_transparency = 1.0f
|
| 183 |
+
[[
|
| 184 |
+
anno::display_name("Clearcoat Transparency"),
|
| 185 |
+
anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
|
| 186 |
+
"covering the underlying layer"),
|
| 187 |
+
anno::in_group("Clearcoat")
|
| 188 |
+
]],
|
| 189 |
+
float clearcoat_reflection_roughness = 0.0f
|
| 190 |
+
[[
|
| 191 |
+
anno::display_name("Clearcoat Roughness"),
|
| 192 |
+
anno::description("Higher roughness values lead to more blurry reflections"),
|
| 193 |
+
anno::hard_range(0.0f, 1.0f),
|
| 194 |
+
anno::in_group("Clearcoat")
|
| 195 |
+
]],
|
| 196 |
+
float clearcoat_weight = 1.0f
|
| 197 |
+
[[
|
| 198 |
+
anno::display_name("Clearcoat Weight"),
|
| 199 |
+
anno::description("Sets the weight for clearcoat layer"),
|
| 200 |
+
anno::hard_range(0.0f, 1.0f),
|
| 201 |
+
anno::in_group("Clearcoat")
|
| 202 |
+
]],
|
| 203 |
+
float clearcoat_flatten = 1.0f
|
| 204 |
+
[[
|
| 205 |
+
anno::display_name("Clearcoat Flatten"),
|
| 206 |
+
anno::description("Flattens the clearcoat to even out the underlying bump maps"),
|
| 207 |
+
anno::hard_range(0.0f, 1.0f),
|
| 208 |
+
anno::in_group("Clearcoat")
|
| 209 |
+
]],
|
| 210 |
+
float clearcoat_ior = 1.56f
|
| 211 |
+
[[
|
| 212 |
+
anno::display_name("Clearcoat IOR"),
|
| 213 |
+
anno::description("Sets the Index of refraction for the clearcoat layer"),
|
| 214 |
+
anno::soft_range(1.0f, 4.0f),
|
| 215 |
+
anno::in_group("Clearcoat")
|
| 216 |
+
]],
|
| 217 |
+
uniform float clearcoat_bump_factor = 1.f
|
| 218 |
+
[[
|
| 219 |
+
anno::display_name("Clearcoat Normal Map Strength"),
|
| 220 |
+
anno::description("Strength of normal map."),
|
| 221 |
+
anno::in_group("Clearcoat")
|
| 222 |
+
]],
|
| 223 |
+
|
| 224 |
+
float3 clearcoat_normal_input = float3(0.0, 0.0, 0.0),
|
| 225 |
+
uniform texture_2d clearcoat_normalmap_texture = texture_2d()
|
| 226 |
+
[[
|
| 227 |
+
anno::display_name("Clearcoat Normal Map"),
|
| 228 |
+
anno::description("Enables the usage of the normalmap texture"),
|
| 229 |
+
anno::in_group("Clearcoat")
|
| 230 |
+
]],
|
| 231 |
+
|
| 232 |
+
uniform bool clearcoat_flip_tangent_u = false
|
| 233 |
+
[[
|
| 234 |
+
anno::display_name("Clearcoat Normal Map Flip U Tangent"),
|
| 235 |
+
anno::in_group("Clearcoat")
|
| 236 |
+
]],
|
| 237 |
+
uniform bool clearcoat_flip_tangent_v = true
|
| 238 |
+
[[
|
| 239 |
+
anno::display_name("Clearcoat Normal Map Flip V Tangent"),
|
| 240 |
+
anno::in_group("Clearcoat")
|
| 241 |
+
]],
|
| 242 |
+
|
| 243 |
+
|
| 244 |
+
// -------------------- REFLECTIVITY ----------------------
|
| 245 |
+
uniform bool enable_retroreflection = false
|
| 246 |
+
[[
|
| 247 |
+
anno::display_name("Enable Retroreflection"),
|
| 248 |
+
anno::in_group("Reflectivity")
|
| 249 |
+
]],
|
| 250 |
+
color retroreflection_tint = color(.182,.800,.000)
|
| 251 |
+
[[
|
| 252 |
+
anno::display_name("Retro-reflection tint"),
|
| 253 |
+
anno::description("The tint of the retroreflection"),
|
| 254 |
+
anno::in_group("Reflectivity")
|
| 255 |
+
]],
|
| 256 |
+
uniform float normal_reflectivity = 0.5
|
| 257 |
+
[[
|
| 258 |
+
anno::display_name("Retro-reflection weight facing"),
|
| 259 |
+
anno::hard_range(0.0,1.),
|
| 260 |
+
anno::description("Reflectivity control for geometry facing the viewer"),
|
| 261 |
+
anno::in_group("Reflectivity")
|
| 262 |
+
]],
|
| 263 |
+
uniform float grazing_reflectivity = 1.0
|
| 264 |
+
[[
|
| 265 |
+
anno::display_name("Retro-reflection weight edge"),
|
| 266 |
+
anno::hard_range(0.0,1.),
|
| 267 |
+
anno::description("Reflectivity control for the reflectivity at geometry edges"),
|
| 268 |
+
anno::in_group("Reflectivity")
|
| 269 |
+
]],
|
| 270 |
+
|
| 271 |
+
// -------------------- AMBIENT OCCLUSION ----------------------
|
| 272 |
+
float ao_to_diffuse = 0.0
|
| 273 |
+
[[
|
| 274 |
+
anno::display_name("AO to Diffuse"),
|
| 275 |
+
anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
|
| 276 |
+
anno::in_group("AO")
|
| 277 |
+
]],
|
| 278 |
+
float ao_input = float(1.0),
|
| 279 |
+
uniform texture_2d ao_texture = texture_2d()
|
| 280 |
+
[[
|
| 281 |
+
anno::display_name("Ambient Occlusion Map"),
|
| 282 |
+
anno::description("The Ambient Occlusion texture for the material"),
|
| 283 |
+
anno::in_group("AO")
|
| 284 |
+
]],
|
| 285 |
+
|
| 286 |
+
// -------------------- EMISSIVE ----------------------
|
| 287 |
+
uniform bool enable_emission = false
|
| 288 |
+
[[
|
| 289 |
+
anno::display_name("Enable Emission"),
|
| 290 |
+
anno::description("Enables the emission of light from the material"),
|
| 291 |
+
anno::in_group("Emissive")
|
| 292 |
+
]],
|
| 293 |
+
uniform color emissive_color = color(1.0, 0.1, 0.1)
|
| 294 |
+
[[
|
| 295 |
+
anno::enable_if("enable_emission == true"),
|
| 296 |
+
anno::display_name("Emissive Color"),
|
| 297 |
+
anno::description("The emission color"),
|
| 298 |
+
anno::in_group("Emissive")
|
| 299 |
+
]],
|
| 300 |
+
|
| 301 |
+
color emissive_mask_input = color(1.0),
|
| 302 |
+
uniform texture_2d emissive_mask_texture = texture_2d()
|
| 303 |
+
[[
|
| 304 |
+
anno::enable_if("enable_emission == true"),
|
| 305 |
+
anno::display_name("Emissive Mask Map"),
|
| 306 |
+
anno::description("The texture masking the emissive color"),
|
| 307 |
+
anno::in_group("Emissive")
|
| 308 |
+
]],
|
| 309 |
+
uniform float emissive_intensity = 40.f
|
| 310 |
+
[[
|
| 311 |
+
anno::enable_if("enable_emission == true"),
|
| 312 |
+
anno::display_name("Emissive Intensity"),
|
| 313 |
+
anno::description("Intensity of the emission"),
|
| 314 |
+
anno::in_group("Emissive")
|
| 315 |
+
]],
|
| 316 |
+
uniform bool enable_emissive_flipbook = false
|
| 317 |
+
[[
|
| 318 |
+
anno::display_name("Enable Flipbook for emission"),
|
| 319 |
+
anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
|
| 320 |
+
anno::in_group("Emissive")
|
| 321 |
+
]],
|
| 322 |
+
uniform int2 flipbook_dim = int2(1,1)
|
| 323 |
+
[[
|
| 324 |
+
anno::enable_if("enable_emissive_flipbook == true"),
|
| 325 |
+
anno::display_name("Flipbook Rows/Columns"),
|
| 326 |
+
anno::description("How many rows and columns are in the flipbook?"),
|
| 327 |
+
anno::in_group("Emissive")
|
| 328 |
+
]],
|
| 329 |
+
uniform int target_fps = 1
|
| 330 |
+
[[
|
| 331 |
+
anno::enable_if("enable_emissive_flipbook == true"),
|
| 332 |
+
anno::display_name("Flipbook Target FPS"),
|
| 333 |
+
anno::description("Playback speed in frames per second"),
|
| 334 |
+
anno::in_group("Emissive")
|
| 335 |
+
]],
|
| 336 |
+
|
| 337 |
+
// -------------------- ALPHA ----------------------
|
| 338 |
+
uniform bool enable_opacity = false
|
| 339 |
+
[[
|
| 340 |
+
anno::display_name("Enable Opacity"),
|
| 341 |
+
anno::description("Enables or disables alpha functionality"),
|
| 342 |
+
anno::in_group("Alpha")
|
| 343 |
+
]],
|
| 344 |
+
float alpha_constant = 1.0
|
| 345 |
+
[[
|
| 346 |
+
anno::enable_if("enable_opacity == true"),
|
| 347 |
+
anno::display_name("Opacity Fallback Constant"),
|
| 348 |
+
anno::hard_range(0.0, 1.0),
|
| 349 |
+
anno::description("The base alpha constant to use if no texture is specified"),
|
| 350 |
+
anno::in_group("Alpha")
|
| 351 |
+
]],
|
| 352 |
+
uniform texture_2d opacity_texture = texture_2d()
|
| 353 |
+
[[
|
| 354 |
+
anno::enable_if("enable_opacity == true"),
|
| 355 |
+
anno::display_name("Opacity Map"),
|
| 356 |
+
anno::description("The texture specifying the opacity value to use"),
|
| 357 |
+
anno::in_group("Alpha")
|
| 358 |
+
]],
|
| 359 |
+
uniform bool enable_opacity_cutout = false
|
| 360 |
+
[[
|
| 361 |
+
anno::enable_if("enable_opacity == true"),
|
| 362 |
+
anno::display_name("Enable Alpha Cutout"),
|
| 363 |
+
anno::description("Enables or disables alpha cutout functionality"),
|
| 364 |
+
anno::in_group("Alpha")
|
| 365 |
+
]],
|
| 366 |
+
uniform float alpha_cutout_cutoff = 1.f
|
| 367 |
+
[[
|
| 368 |
+
anno::enable_if("enable_opacity == true"),
|
| 369 |
+
anno::enable_if("enable_opacity_cutout == true"),
|
| 370 |
+
anno::hard_range(0.0, 1.0),
|
| 371 |
+
anno::display_name("Alpha Cutout Cutoff"),
|
| 372 |
+
anno::description("The cutoff value to to render as transparent up to and opaque past"),
|
| 373 |
+
anno::in_group("Alpha")
|
| 374 |
+
]],
|
| 375 |
+
|
| 376 |
+
// -------------------- NORMAL ----------------------
|
| 377 |
+
uniform float bump_factor = 1.f
|
| 378 |
+
[[
|
| 379 |
+
anno::display_name("Normal Map Strength"),
|
| 380 |
+
anno::description("Strength of normal map."),
|
| 381 |
+
anno::in_group("Normal")
|
| 382 |
+
]],
|
| 383 |
+
|
| 384 |
+
float3 normal_input = state::normal(),
|
| 385 |
+
uniform texture_2d normalmap_texture = texture_2d()
|
| 386 |
+
[[
|
| 387 |
+
anno::display_name("Normal Map"),
|
| 388 |
+
anno::in_group("Normal")
|
| 389 |
+
]],
|
| 390 |
+
uniform bool flip_tangent_u = false
|
| 391 |
+
[[
|
| 392 |
+
anno::display_name("Normal Map Flip U Tangent"),
|
| 393 |
+
anno::in_group("Normal")
|
| 394 |
+
]],
|
| 395 |
+
uniform bool flip_tangent_v = true
|
| 396 |
+
[[
|
| 397 |
+
anno::display_name("Normal Map Flip V Tangent"),
|
| 398 |
+
anno::in_group("Normal")
|
| 399 |
+
]],
|
| 400 |
+
|
| 401 |
+
// -------------------- UV ADJUSTMENTS ----------------------
|
| 402 |
+
uniform bool project_uvw = false
|
| 403 |
+
[[
|
| 404 |
+
anno::display_name("Enable Project UVW Coordinates"),
|
| 405 |
+
anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
|
| 406 |
+
anno::in_group("UV")
|
| 407 |
+
]],
|
| 408 |
+
uniform bool world_or_object = false
|
| 409 |
+
[[
|
| 410 |
+
anno::enable_if("project_uvw == true"),
|
| 411 |
+
anno::display_name("Enable World Space"),
|
| 412 |
+
anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
|
| 413 |
+
anno::in_group("UV")
|
| 414 |
+
]],
|
| 415 |
+
uniform float2 texture_translate = float2(0.0f)
|
| 416 |
+
[[
|
| 417 |
+
anno::display_name("Texture Translate"),
|
| 418 |
+
anno::description("Controls position of texture."),
|
| 419 |
+
anno::in_group("UV")
|
| 420 |
+
]],
|
| 421 |
+
uniform float2 texture_scale = float2(1.0f)
|
| 422 |
+
[[
|
| 423 |
+
anno::display_name("Texture Tiling"),
|
| 424 |
+
anno::description("Controls repetition of the texture."),
|
| 425 |
+
anno::in_group("UV")
|
| 426 |
+
]],
|
| 427 |
+
uniform float2 texture_speed = float2(0.0f)
|
| 428 |
+
[[
|
| 429 |
+
anno::display_name("Texture Speed"),
|
| 430 |
+
anno::description("Scrolling texture animation speed in UVs per sec."),
|
| 431 |
+
anno::in_group("UV")
|
| 432 |
+
]]
|
| 433 |
+
)
|
| 434 |
+
[[
|
| 435 |
+
anno::display_name("Sim PBR"),
|
| 436 |
+
anno::description("Supports the opaque alpha cutout material model of the Sim Renderer"),
|
| 437 |
+
anno::in_group("SimReady"),
|
| 438 |
+
anno::version( 1, 0, 0),
|
| 439 |
+
anno::author("NVIDIA CORPORATION"),
|
| 440 |
+
anno::key_words(string[]("Sim", "PBR", "opaque", "alpha", "cutout", "omniverse", "generic"))
|
| 441 |
+
]]
|
| 442 |
+
= let {
|
| 443 |
+
base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
|
| 444 |
+
|
| 445 |
+
base::texture_coordinate_info uvw = project_uvw ?
|
| 446 |
+
base::coordinate_projection(
|
| 447 |
+
coordinate_system: the_system,
|
| 448 |
+
texture_space: 0,
|
| 449 |
+
projection_type: base::projection_cubic
|
| 450 |
+
) : base::coordinate_source(
|
| 451 |
+
coordinate_system: base::texture_coordinate_uvw,
|
| 452 |
+
texture_space: 0
|
| 453 |
+
);
|
| 454 |
+
|
| 455 |
+
// Need to use a small value so the compiler doesnt optimize out this var...
|
| 456 |
+
float t = 0.00000001;//state::animation_time();
|
| 457 |
+
base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
|
| 458 |
+
transform: base::rotation_translation_scale(
|
| 459 |
+
scaling: float3(texture_scale.x, texture_scale.y, 1.0),
|
| 460 |
+
rotation: float3(0.0, 0.0, 0.0 ),
|
| 461 |
+
translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
|
| 462 |
+
coordinate: uvw
|
| 463 |
+
);
|
| 464 |
+
float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
|
| 465 |
+
|
| 466 |
+
// Diffuse Color Lookup and AO
|
| 467 |
+
float4 base_lookup = tex::texture_isvalid(diffuse_texture) ? tex::lookup_float4(tex: diffuse_texture, coord: uv) : float4(1, 1, 1, 1);
|
| 468 |
+
|
| 469 |
+
float opacityValue = tex::texture_isvalid(opacity_texture) ? tex::lookup_float4(tex: opacity_texture, coord: uv).w : alpha_constant;
|
| 470 |
+
|
| 471 |
+
// Normal calculations
|
| 472 |
+
float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
|
| 473 |
+
base::tangent_space_normal_texture(
|
| 474 |
+
texture: normalmap_texture,
|
| 475 |
+
factor: bump_factor,
|
| 476 |
+
uvw: transformed_uvw,
|
| 477 |
+
flip_tangent_u: flip_tangent_u,
|
| 478 |
+
flip_tangent_v: flip_tangent_v
|
| 479 |
+
) : normal_input;
|
| 480 |
+
|
| 481 |
+
float3 clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ?
|
| 482 |
+
base::tangent_space_normal_texture(
|
| 483 |
+
texture: clearcoat_normalmap_texture,
|
| 484 |
+
factor: clearcoat_bump_factor,
|
| 485 |
+
uvw: uvw,
|
| 486 |
+
flip_tangent_u: clearcoat_flip_tangent_u,
|
| 487 |
+
flip_tangent_v: clearcoat_flip_tangent_v
|
| 488 |
+
) : clearcoat_normal_input;
|
| 489 |
+
|
| 490 |
+
float3 flattened_clearcoat_normal = ::math::lerp(normal_lookup, ::state::normal(), clearcoat_flatten);
|
| 491 |
+
float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? clearcoat_normal : flattened_clearcoat_normal;
|
| 492 |
+
|
| 493 |
+
float ao_lookup = tex::texture_isvalid(ao_texture) ? tex::lookup_float4(tex: ao_texture, coord: uv).x : ao_input;
|
| 494 |
+
|
| 495 |
+
color diffuse_color = tex::texture_isvalid(diffuse_texture) ? color(base_lookup.x, base_lookup.y, base_lookup.z) : diffuse_color_constant;
|
| 496 |
+
|
| 497 |
+
float3 ORM_lookup = tex::lookup_float3(
|
| 498 |
+
tex: ORM_texture,
|
| 499 |
+
coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
|
| 500 |
+
);
|
| 501 |
+
|
| 502 |
+
float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
|
| 503 |
+
tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
|
| 504 |
+
float anisotropy_lookup = tex::texture_isvalid(anisotropy_texture) ?
|
| 505 |
+
(tex::lookup_float4(tex: anisotropy_texture, coord: uv).x * 2.0f - 1.0f) : anisotropy_constant;
|
| 506 |
+
float metallic_lookup = tex::texture_isvalid(metallic_texture) ?
|
| 507 |
+
tex::lookup_float4(tex: metallic_texture, coord: uv).x : metallic_constant;
|
| 508 |
+
float specular_lookup = tex::texture_isvalid(specular_texture) ?
|
| 509 |
+
tex::lookup_float4(tex: specular_texture, coord: uv).x : specular_constant;
|
| 510 |
+
|
| 511 |
+
float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup;
|
| 512 |
+
float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup;
|
| 513 |
+
float ao = enable_ORM_texture ? ORM_lookup.x : ao_lookup;
|
| 514 |
+
|
| 515 |
+
float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
|
| 516 |
+
float anisotropy = math::lerp(anisotropy_constant, anisotropy_lookup, anisotropy_texture_influence);
|
| 517 |
+
float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
|
| 518 |
+
|
| 519 |
+
int rows = flipbook_dim.x;
|
| 520 |
+
int columns = flipbook_dim.y;
|
| 521 |
+
int numFrames = rows * columns;
|
| 522 |
+
varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
|
| 523 |
+
varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
|
| 524 |
+
varying float2 emissiveUV = enable_emissive_flipbook ?
|
| 525 |
+
((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
|
| 526 |
+
|
| 527 |
+
color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
|
| 528 |
+
tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : emissive_mask_input;
|
| 529 |
+
|
| 530 |
+
} in SimPBR_Model(
|
| 531 |
+
diffuse_color: diffuse_color,
|
| 532 |
+
diffuse_tint: diffuse_tint,
|
| 533 |
+
roughness: reflection_roughness,
|
| 534 |
+
anisotropy: anisotropy,
|
| 535 |
+
metallic: metallic,
|
| 536 |
+
specular: specular_lookup,
|
| 537 |
+
normal: normal_lookup,
|
| 538 |
+
enable_clearcoat: enable_clearcoat,
|
| 539 |
+
clearcoat_tint: clearcoat_tint,
|
| 540 |
+
clearcoat_transparency: clearcoat_transparency,
|
| 541 |
+
clearcoat_reflection_roughness: clearcoat_reflection_roughness,
|
| 542 |
+
clearcoat_weight: clearcoat_weight,
|
| 543 |
+
clearcoat_ior: clearcoat_ior,
|
| 544 |
+
clearcoat_normal: final_clearcoat_normal,
|
| 545 |
+
enable_retroreflection: enable_retroreflection,
|
| 546 |
+
retroreflection_tint: retroreflection_tint,
|
| 547 |
+
normal_reflectivity: normal_reflectivity,
|
| 548 |
+
grazing_reflectivity: grazing_reflectivity,
|
| 549 |
+
ao_to_diffuse: ao_to_diffuse,
|
| 550 |
+
ao: ao,
|
| 551 |
+
enable_emission: enable_emission,
|
| 552 |
+
emissive_color: emissive_color,
|
| 553 |
+
emissive_mask: emissive_mask,
|
| 554 |
+
emissive_intensity: emissive_intensity,
|
| 555 |
+
enable_opacity: enable_opacity,
|
| 556 |
+
alpha: opacityValue,
|
| 557 |
+
enable_opacity_cutout: enable_opacity_cutout,
|
| 558 |
+
alpha_cutout_cutoff: alpha_cutout_cutoff,
|
| 559 |
+
opacity_ratio: enable_transmission ? opacity_ratio : 1.0,
|
| 560 |
+
opacity_tint : opacity_tint,
|
| 561 |
+
opacity_multiplier : opacity_multiplier
|
| 562 |
+
);
|
objects/contemporary_lowfulldesk/materials/omniverse/simready_content/materials/SimPBR_Model.mdl
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
| 1 |
+
/*****************************************************************************
|
| 2 |
+
* Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
******************************************************************************
|
| 4 |
+
|
| 5 |
+
MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
|
| 6 |
+
WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
|
| 7 |
+
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 8 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
| 9 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
| 10 |
+
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
|
| 11 |
+
CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
|
| 12 |
+
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
| 13 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
| 14 |
+
THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
|
| 15 |
+
THE MDL MATERIALS.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
mdl 1.4;
|
| 19 |
+
|
| 20 |
+
import ::df::*;
|
| 21 |
+
import ::state::*;
|
| 22 |
+
import ::math::*;
|
| 23 |
+
import ::base::*;
|
| 24 |
+
import ::tex::*;
|
| 25 |
+
import ::anno::*;
|
| 26 |
+
|
| 27 |
+
using .::baking_annotations import *;
|
| 28 |
+
|
| 29 |
+
base::texture_return multiply_colors(
|
| 30 |
+
color color_1 = color(1.0, 1.0, 1.0),
|
| 31 |
+
color color_2 = color(.5, .5, .5),
|
| 32 |
+
float weight = 1.0
|
| 33 |
+
)
|
| 34 |
+
[[
|
| 35 |
+
anno::hidden()
|
| 36 |
+
]]
|
| 37 |
+
{
|
| 38 |
+
return base::blend_color_layers(
|
| 39 |
+
layers: base::color_layer[](
|
| 40 |
+
base::color_layer(
|
| 41 |
+
layer_color: color_2,
|
| 42 |
+
weight: weight,
|
| 43 |
+
mode: base::color_layer_multiply
|
| 44 |
+
)
|
| 45 |
+
), base: color_1
|
| 46 |
+
);
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
export material SimPBR_Model(
|
| 50 |
+
color diffuse_color = color(0.2f) [[ target_baked_argument("diffuse_texture", "diffuse_color_constant", "RGBA8_UNORM") ]],
|
| 51 |
+
uniform color diffuse_tint = color(1.0f),
|
| 52 |
+
float roughness = 0.5f [[ target_baked_argument("reflectionroughness_texture", "reflection_roughness_constant", "R8_UNORM") ]],
|
| 53 |
+
float anisotropy = 0.0f [[ target_baked_argument("anisotropy_texture", "anisotropy_constant", "R8_SNORM") ]],
|
| 54 |
+
float metallic = 0.f [[ target_baked_argument("metallic_texture", "metallic_constant", "R8_UNORM") ]],
|
| 55 |
+
float specular = 1.f [[ target_baked_argument("specular_texture", "specular_constant", "R8_UNORM") ]],
|
| 56 |
+
float3 normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("normalmap_texture", "normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
|
| 57 |
+
uniform bool enable_clearcoat = false,
|
| 58 |
+
color clearcoat_tint = color(1.0f),
|
| 59 |
+
float clearcoat_transparency = 1.0f,
|
| 60 |
+
float clearcoat_reflection_roughness = 0.0f,
|
| 61 |
+
float clearcoat_weight = 1.0f,
|
| 62 |
+
float clearcoat_ior = 1.56f,
|
| 63 |
+
float3 clearcoat_normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("clearcoat_normalmap_texture", "clearcoat_normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
|
| 64 |
+
uniform bool enable_retroreflection = false,
|
| 65 |
+
color retroreflection_tint = color(.182,.800,.000),
|
| 66 |
+
uniform float normal_reflectivity = 0.5,
|
| 67 |
+
uniform float grazing_reflectivity = 1.0,
|
| 68 |
+
float ao_to_diffuse = 0.0,
|
| 69 |
+
float ao = 1.0f [[ target_baked_argument("ao_texture", "ao_input", "R8_UNORM") ]],
|
| 70 |
+
uniform bool enable_emission = false,
|
| 71 |
+
uniform color emissive_color = color(1.0, 0.1, 0.1),
|
| 72 |
+
color emissive_mask = color(1.0, 0.1, 0.1) [[ target_baked_argument("emissive_mask_texture", "emissive_mask_input", "R8_UNORM") ]],
|
| 73 |
+
uniform float emissive_intensity = 40.f,
|
| 74 |
+
uniform bool enable_opacity = false,
|
| 75 |
+
float alpha = 1.0,
|
| 76 |
+
uniform bool enable_opacity_cutout = false,
|
| 77 |
+
uniform float alpha_cutout_cutoff = 1.f,
|
| 78 |
+
uniform float opacity_ratio = 1.f,
|
| 79 |
+
uniform color opacity_tint = color(1.0f),
|
| 80 |
+
uniform float opacity_multiplier = 1.f
|
| 81 |
+
)
|
| 82 |
+
[[
|
| 83 |
+
target_material_model(),
|
| 84 |
+
target_material_rendering("..::SimPBR::SimPBR")
|
| 85 |
+
]]
|
| 86 |
+
= let {
|
| 87 |
+
color base_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint;
|
| 88 |
+
color ao_weighted_base_color = multiply_colors(base_color, color(ao), ao_to_diffuse).tint;
|
| 89 |
+
|
| 90 |
+
float squared_roughness = roughness * roughness;
|
| 91 |
+
float roughness_u = squared_roughness * (1 + anisotropy);
|
| 92 |
+
float roughness_v = squared_roughness * (1 - anisotropy);
|
| 93 |
+
|
| 94 |
+
color diffuse_transmission_color = base_color * opacity_tint * opacity_multiplier;
|
| 95 |
+
|
| 96 |
+
bsdf diffuse_bsdf = df::weighted_layer(
|
| 97 |
+
weight: opacity_ratio,
|
| 98 |
+
layer: df::diffuse_reflection_bsdf(
|
| 99 |
+
tint: ao_weighted_base_color,
|
| 100 |
+
roughness: 0.0f
|
| 101 |
+
),
|
| 102 |
+
base: df::diffuse_transmission_bsdf(tint: diffuse_transmission_color),
|
| 103 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 104 |
+
);
|
| 105 |
+
|
| 106 |
+
bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
|
| 107 |
+
roughness_u: roughness_u,
|
| 108 |
+
roughness_v: roughness_v,
|
| 109 |
+
tint: color(1.0, 1.0, 1.0),
|
| 110 |
+
mode: df::scatter_reflect
|
| 111 |
+
);
|
| 112 |
+
|
| 113 |
+
bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
|
| 114 |
+
normal_reflectivity: 0.03,
|
| 115 |
+
grazing_reflectivity: 1.0,
|
| 116 |
+
exponent: 5.0,
|
| 117 |
+
weight: specular,
|
| 118 |
+
layer: ggx_smith_bsdf,
|
| 119 |
+
base: diffuse_bsdf,
|
| 120 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 121 |
+
);
|
| 122 |
+
|
| 123 |
+
//
|
| 124 |
+
// Begin RETROREFLECTION SUPPORT
|
| 125 |
+
//
|
| 126 |
+
color final_retroreflection_color = multiply_colors(retroreflection_tint, base_color, 1.0).tint;
|
| 127 |
+
bsdf backscattering_glossy_bsdf = df::backscattering_glossy_reflection_bsdf(
|
| 128 |
+
tint: final_retroreflection_color,
|
| 129 |
+
roughness_u: squared_roughness
|
| 130 |
+
);
|
| 131 |
+
|
| 132 |
+
/*bsdf retroreflection_bsdf = df::custom_curve_layer(
|
| 133 |
+
normal_reflectivity: 1.-normal_reflectivity,
|
| 134 |
+
grazing_reflectivity: 1.-grazing_reflectivity,
|
| 135 |
+
base: backscattering_glossy_bsdf,
|
| 136 |
+
layer: custom_curve_layer_bsdf,
|
| 137 |
+
normal: enable_clearcoat ? normal_lookup : state::normal()
|
| 138 |
+
);*/
|
| 139 |
+
|
| 140 |
+
// if normal_reflectivity and grazing_reflectivity are 1 and weight is 1, just the layer is used
|
| 141 |
+
bsdf opt_retroreflection_bsdf = df::custom_curve_layer(
|
| 142 |
+
normal_reflectivity: enable_retroreflection ? 1.-normal_reflectivity : 1,
|
| 143 |
+
grazing_reflectivity: enable_retroreflection ? 1.-grazing_reflectivity : 1,
|
| 144 |
+
base: backscattering_glossy_bsdf,
|
| 145 |
+
layer: custom_curve_layer_bsdf,
|
| 146 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 147 |
+
);
|
| 148 |
+
|
| 149 |
+
//
|
| 150 |
+
// End RETROREFLECTION SUPPORT
|
| 151 |
+
//
|
| 152 |
+
|
| 153 |
+
bsdf directional_factor_bsdf = df::directional_factor(
|
| 154 |
+
normal_tint: ao_weighted_base_color,
|
| 155 |
+
grazing_tint: color(1.0, 1.0, 1.0),
|
| 156 |
+
exponent: 5.0f,
|
| 157 |
+
base: ggx_smith_bsdf
|
| 158 |
+
);
|
| 159 |
+
|
| 160 |
+
// CLEARCOAT
|
| 161 |
+
bsdf omni_PBR_bsdf = df::weighted_layer(
|
| 162 |
+
weight: metallic,
|
| 163 |
+
layer: directional_factor_bsdf,
|
| 164 |
+
base: opt_retroreflection_bsdf, //enable_retroreflection ? retroreflection_bsdf : custom_curve_layer_bsdf,
|
| 165 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 166 |
+
);
|
| 167 |
+
|
| 168 |
+
bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
|
| 169 |
+
roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
|
| 170 |
+
roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
|
| 171 |
+
tint: color(1.0f),
|
| 172 |
+
mode: df::scatter_reflect
|
| 173 |
+
);
|
| 174 |
+
|
| 175 |
+
// bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
|
| 176 |
+
// normal_reflectivity: clearcoat_reflectivity * 0.08,
|
| 177 |
+
// grazing_reflectivity: 1.0,
|
| 178 |
+
// weight: clearcoat_weight,
|
| 179 |
+
// layer: clearcoat_bsdf,
|
| 180 |
+
// base: omni_PBR_bsdf,
|
| 181 |
+
// normal: final_clearcoat_normal
|
| 182 |
+
// );
|
| 183 |
+
|
| 184 |
+
bsdf opt_opaque_clearcoat = df::weighted_layer(
|
| 185 |
+
weight: enable_clearcoat ? clearcoat_transparency : 1,
|
| 186 |
+
layer: ::df::tint(tint: enable_clearcoat ? clearcoat_tint : color(1), base: omni_PBR_bsdf),
|
| 187 |
+
base: ::df::diffuse_reflection_bsdf(tint: clearcoat_tint)
|
| 188 |
+
);
|
| 189 |
+
|
| 190 |
+
bsdf opt_omni_PBR_coated_bsdf = df::fresnel_layer(
|
| 191 |
+
ior: clearcoat_ior,
|
| 192 |
+
weight: enable_clearcoat ? clearcoat_weight : 0,
|
| 193 |
+
layer: clearcoat_bsdf,
|
| 194 |
+
base: opt_opaque_clearcoat,
|
| 195 |
+
normal: clearcoat_normal
|
| 196 |
+
);
|
| 197 |
+
|
| 198 |
+
bsdf final_bsdf = opt_omni_PBR_coated_bsdf;
|
| 199 |
+
} in material(
|
| 200 |
+
thin_walled: false,
|
| 201 |
+
surface: material_surface(
|
| 202 |
+
scattering: final_bsdf,
|
| 203 |
+
emission: material_emission(
|
| 204 |
+
df::diffuse_edf(),
|
| 205 |
+
intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
|
| 206 |
+
)
|
| 207 |
+
),
|
| 208 |
+
geometry: material_geometry(
|
| 209 |
+
normal: enable_clearcoat ? state::normal() : normal,
|
| 210 |
+
cutout_opacity: enable_opacity ? (enable_opacity_cutout ? (alpha < alpha_cutout_cutoff ? 0.0 : 1.0) : alpha) : 1.0
|
| 211 |
+
)
|
| 212 |
+
);
|
objects/contemporary_lowfulldesk/materials/omniverse/simready_content/materials/baking_annotations.mdl
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.4;
|
| 2 |
+
import ::anno::*;
|
| 3 |
+
|
| 4 |
+
export const string TRANSFORM_NONE = "NONE";
|
| 5 |
+
export const string TRANSFORM_UNORM_VECTOR = "UNORM_VECTOR";
|
| 6 |
+
|
| 7 |
+
export const string FORMAT_RGBA8_UNORM = "RGBA8_UNORM";
|
| 8 |
+
export const string FORMAT_R8_UNORM = "R8_UNORM";
|
| 9 |
+
export const string FORMAT_RGBA16_SFLOAT = "RGBA16_SFLOAT";
|
| 10 |
+
|
| 11 |
+
export const string BLEND_MODE_OPACITY = "opacity_blend";
|
| 12 |
+
export const string BLEND_MODE_REPLACE = "replace";
|
| 13 |
+
|
| 14 |
+
// This annotation is used to mark a material as target material for baking.
|
| 15 |
+
// It is that is detected by the MDL SDK and neuray.
|
| 16 |
+
export annotation target_material_model();
|
| 17 |
+
|
| 18 |
+
export annotation target_material_rendering(
|
| 19 |
+
string rendering_material_override = "" // if set, the baked material will be rendering using this material,
|
| 20 |
+
// otherwise the target itself is used
|
| 21 |
+
);
|
| 22 |
+
|
| 23 |
+
export annotation target_baked_argument(
|
| 24 |
+
// the name of the baked texture parameter in the rendering material
|
| 25 |
+
string baked_name,
|
| 26 |
+
|
| 27 |
+
// the name of the constant parameter in the rendering material in case baking was not necessary
|
| 28 |
+
string constant_name = "",
|
| 29 |
+
|
| 30 |
+
// texture format to bake to
|
| 31 |
+
string format = "",
|
| 32 |
+
|
| 33 |
+
// transformations, like encoding normals into [0,1] range
|
| 34 |
+
string transform = TRANSFORM_NONE,
|
| 35 |
+
|
| 36 |
+
// blending, e.g., based on alpha or replace
|
| 37 |
+
string blend_mode = BLEND_MODE_OPACITY
|
| 38 |
+
);
|
objects/fork_big/materials/robolab/objects/vomp/fork_big/textures/Fork_Big_Metallic.png
ADDED
|
Git LFS Details
|
objects/fstylejug_a01/materials/omniverse/simready_content/common_assets/props/fstylejug_a01/textures/T_Plastic_Glossy_White_A_Albedo.png
ADDED
|
Git LFS Details
|
objects/fstylejug_a01/materials/omniverse/simready_content/common_assets/props/fstylejug_a01/textures/T_Plastic_Glossy_White_A_Normal.png
ADDED
|
Git LFS Details
|
objects/fstylejug_a01/materials/omniverse/simready_content/common_assets/props/fstylejug_a01/textures/T_Plastic_Glossy_White_A_ORM.png
ADDED
|
Git LFS Details
|
objects/fstylejug_a02/materials/omniverse/simready_content/common_assets/props/fstylejug_a02/materials/Natural_Plastic_E.mdl
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.7;
|
| 2 |
+
|
| 3 |
+
using m_mdl = "mdl";
|
| 4 |
+
|
| 5 |
+
import ::state::normal;
|
| 6 |
+
import ::OmniSurface::OmniImage::alpha_mode;
|
| 7 |
+
import ::OmniSurface::OmniImage::projection_mode;
|
| 8 |
+
import ::OmniSurface::OmniImage::tangent_bitangent_mapping;
|
| 9 |
+
import ::OmniSurface::OmniImage::wrap_mode;
|
| 10 |
+
import ::OmniSurface::OmniShared::displacement_mode;
|
| 11 |
+
import ::OmniSurface::OmniShared::emission_mode;
|
| 12 |
+
import ::OmniSurface::OmniShared::ior_presets;
|
| 13 |
+
import ::OmniSurface::OmniShared::scattering_colors_presets;
|
| 14 |
+
import ::OmniSurface::OmniSurface;
|
| 15 |
+
import ::base::texture_coordinate_system;
|
| 16 |
+
import ::tex::gamma_mode;
|
| 17 |
+
|
| 18 |
+
export material Natural_Plastic_E(*)
|
| 19 |
+
= ::OmniSurface::OmniSurface(
|
| 20 |
+
diffuse_reflection_weight: 1.f,
|
| 21 |
+
diffuse_reflection_weight_image: texture_2d(),
|
| 22 |
+
diffuse_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 23 |
+
diffuse_reflection_color: color(1.f, 1.f, 1.f),
|
| 24 |
+
diffuse_reflection_color_image: texture_2d(),
|
| 25 |
+
diffuse_reflection_roughness: 0.f,
|
| 26 |
+
diffuse_reflection_roughness_image: texture_2d(),
|
| 27 |
+
diffuse_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 28 |
+
metalness: 0.049999997f,
|
| 29 |
+
metalness_image: texture_2d(),
|
| 30 |
+
metalness_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 31 |
+
specular_reflection_weight: 0.f,
|
| 32 |
+
specular_reflection_weight_image: texture_2d(),
|
| 33 |
+
specular_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 34 |
+
specular_reflection_color: color(1.f, 1.f, 1.f),
|
| 35 |
+
specular_reflection_color_image: texture_2d(),
|
| 36 |
+
specular_reflection_roughness: 0.299999982f,
|
| 37 |
+
specular_reflection_roughness_image: texture_2d(),
|
| 38 |
+
specular_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 39 |
+
specular_reflection_ior_preset: OmniSurface::OmniShared::ior_custom,
|
| 40 |
+
specular_reflection_ior: 2.f,
|
| 41 |
+
specular_reflection_anisotropy: 0.f,
|
| 42 |
+
specular_reflection_anisotropy_image: texture_2d(),
|
| 43 |
+
specular_reflection_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 44 |
+
specular_reflection_anisotropy_rotation: 0.f,
|
| 45 |
+
specular_reflection_anisotropy_rotation_image: texture_2d(),
|
| 46 |
+
specular_reflection_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 47 |
+
enable_specular_transmission: true,
|
| 48 |
+
specular_transmission_weight: 0.799999952f,
|
| 49 |
+
specular_transmission_weight_image: texture_2d(),
|
| 50 |
+
specular_transmission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 51 |
+
specular_transmission_color: color(1.f, 1.f, 1.f),
|
| 52 |
+
specular_transmission_color_image: texture_2d(),
|
| 53 |
+
specular_transmission_scattering_depth: 0.f,
|
| 54 |
+
specular_transmission_scattering_depth_image: texture_2d(),
|
| 55 |
+
specular_transmission_scattering_depth_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 56 |
+
specular_transmission_scattering_color: color(0.f, 0.f, 0.f),
|
| 57 |
+
specular_transmission_scattering_color_image: texture_2d(),
|
| 58 |
+
specular_transmission_scatter_anisotropy: 0.f,
|
| 59 |
+
specular_transmission_scatter_anisotropy_image: texture_2d(),
|
| 60 |
+
specular_transmission_scatter_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 61 |
+
specular_transmission_dispersion_abbe: 0.f,
|
| 62 |
+
enable_diffuse_transmission: true,
|
| 63 |
+
subsurface_weight: 1.f,
|
| 64 |
+
subsurface_weight_image: texture_2d(),
|
| 65 |
+
subsurface_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 66 |
+
subsurface_scattering_colors_preset: OmniSurface::OmniShared::scattering_colors_custom,
|
| 67 |
+
subsurface_transmission_color: color(1.f, 1.f, 1.f),
|
| 68 |
+
subsurface_transmission_color_image: texture_2d(),
|
| 69 |
+
subsurface_scattering_color: color(1.f, 1.f, 1.f),
|
| 70 |
+
subsurface_scattering_color_image: texture_2d(),
|
| 71 |
+
subsurface_scale: 1.f,
|
| 72 |
+
subsurface_scale_image: texture_2d(),
|
| 73 |
+
subsurface_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 74 |
+
subsurface_anisotropy: 0.f,
|
| 75 |
+
subsurface_anisotropy_image: texture_2d(),
|
| 76 |
+
subsurface_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 77 |
+
coat_weight: 1.f,
|
| 78 |
+
coat_weight_image: texture_2d(),
|
| 79 |
+
coat_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 80 |
+
coat_color: color(1.f, 1.f, 1.f),
|
| 81 |
+
coat_color_image: texture_2d(),
|
| 82 |
+
coat_roughness: 0.299999982f,
|
| 83 |
+
coat_roughness_image: texture_2d(),
|
| 84 |
+
coat_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 85 |
+
coat_ior_preset: OmniSurface::OmniShared::ior_custom,
|
| 86 |
+
coat_ior: 1.5f,
|
| 87 |
+
coat_anisotropy: 0.f,
|
| 88 |
+
coat_anisotropy_image: texture_2d(),
|
| 89 |
+
coat_anisotropy_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 90 |
+
coat_anisotropy_rotation: 0.f,
|
| 91 |
+
coat_anisotropy_rotation_image: texture_2d(),
|
| 92 |
+
coat_anisotropy_rotation_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 93 |
+
coat_affect_color: 0.f,
|
| 94 |
+
coat_affect_color_image: texture_2d(),
|
| 95 |
+
coat_affect_color_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 96 |
+
coat_affect_roughness: 0.f,
|
| 97 |
+
coat_affect_roughness_image: texture_2d(),
|
| 98 |
+
coat_affect_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 99 |
+
coat_normal_strength: 1.f,
|
| 100 |
+
coat_normal: state::normal(),
|
| 101 |
+
coat_normal_image: texture_2d(),
|
| 102 |
+
coat_normal_image_flip_r_channel: false,
|
| 103 |
+
coat_normal_image_flip_g_channel: false,
|
| 104 |
+
coat_normal_image_flip_b_channel: false,
|
| 105 |
+
specular_retro_reflection_weight: 0.699999988f,
|
| 106 |
+
specular_retro_reflection_weight_image: texture_2d(),
|
| 107 |
+
specular_retro_reflection_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 108 |
+
specular_retro_reflection_color: color(1.f, 1.f, 1.f),
|
| 109 |
+
specular_retro_reflection_color_image: texture_2d(),
|
| 110 |
+
specular_retro_reflection_roughness: 0.300000012f,
|
| 111 |
+
specular_retro_reflection_roughness_image: texture_2d(),
|
| 112 |
+
specular_retro_reflection_roughness_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 113 |
+
emission_weight: 0.f,
|
| 114 |
+
emission_weight_image: texture_2d(),
|
| 115 |
+
emission_weight_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 116 |
+
emission_mode: OmniSurface::OmniShared::emission_lx,
|
| 117 |
+
emission_intensity: 1.f,
|
| 118 |
+
emission_intensity_image: texture_2d(),
|
| 119 |
+
emission_intensity_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 120 |
+
emission_color: color(1.f, 1.f, 1.f),
|
| 121 |
+
emission_color_image: texture_2d(),
|
| 122 |
+
emission_use_temperature: false,
|
| 123 |
+
emission_temperature: 6500.f,
|
| 124 |
+
emission_temperature_image: texture_2d(),
|
| 125 |
+
emission_temperature_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 126 |
+
enable_thin_film: false,
|
| 127 |
+
thin_film_thickness: 400.f,
|
| 128 |
+
thin_film_thickness_image: texture_2d(),
|
| 129 |
+
thin_film_thickness_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 130 |
+
thin_film_ior_preset: OmniSurface::OmniShared::ior_custom,
|
| 131 |
+
thin_film_ior: 1.5f,
|
| 132 |
+
thin_walled: false,
|
| 133 |
+
enable_opacity: false,
|
| 134 |
+
geometry_opacity: 1.f,
|
| 135 |
+
geometry_opacity_image: texture_2d(),
|
| 136 |
+
geometry_opacity_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 137 |
+
geometry_opacity_threshold: 0.f,
|
| 138 |
+
geometry_normal_strength: 1.f,
|
| 139 |
+
geometry_normal: state::normal(),
|
| 140 |
+
geometry_normal_image: texture_2d(),
|
| 141 |
+
geometry_normal_image_flip_r_channel: false,
|
| 142 |
+
geometry_normal_image_flip_g_channel: false,
|
| 143 |
+
geometry_normal_image_flip_b_channel: false,
|
| 144 |
+
geometry_tangent_bitangent_mapping: OmniSurface::OmniImage::red_green,
|
| 145 |
+
geometry_displacement: float3(0.f),
|
| 146 |
+
geometry_displacement_mode: OmniSurface::OmniShared::displacement_height,
|
| 147 |
+
geometry_displacement_image: texture_2d(),
|
| 148 |
+
geometry_displacement_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 149 |
+
geometry_displacement_scale: 1.f,
|
| 150 |
+
geometry_displacement_scale_image: texture_2d(),
|
| 151 |
+
geometry_displacement_scale_image_alpha_mode: OmniSurface::OmniImage::alpha_default,
|
| 152 |
+
geometry_displacement_scalar_zero_value: 0.f,
|
| 153 |
+
uvw_texture_coordinate_system: base::texture_coordinate_uvw,
|
| 154 |
+
uvw_uv_set: 0,
|
| 155 |
+
uvw_ignore_missing_textures: false,
|
| 156 |
+
uvw_missing_texture_color: color(0.f, 0.f, 0.f),
|
| 157 |
+
uvw_use_uv_coords: false,
|
| 158 |
+
uvw_uv_coords: float2(0.f),
|
| 159 |
+
uvw_s_offset: 0.f,
|
| 160 |
+
uvw_t_offset: 0.f,
|
| 161 |
+
uvw_s_wrap: OmniSurface::OmniImage::wrap_periodic,
|
| 162 |
+
uvw_t_wrap: OmniSurface::OmniImage::wrap_periodic,
|
| 163 |
+
uvw_s_scale: 1.f,
|
| 164 |
+
uvw_t_scale: 1.f,
|
| 165 |
+
uvw_s_flip: false,
|
| 166 |
+
uvw_t_flip: false,
|
| 167 |
+
uvw_swap_st: false,
|
| 168 |
+
uvw_projection_mode: OmniSurface::OmniImage::projection_cubic,
|
| 169 |
+
uvw_projection_translate: float3(0.f),
|
| 170 |
+
uvw_projection_rotate: float3(0.f),
|
| 171 |
+
uvw_projection_scale: float3(1.f));
|
objects/fstylejug_a02/materials/omniverse/simready_content/common_assets/props/fstylejug_a02/materials/Plastic_Glossy_White_A.mdl
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.4;
|
| 2 |
+
|
| 3 |
+
using ::OmniPBR import OmniPBR;
|
| 4 |
+
import ::tex::gamma_mode;
|
| 5 |
+
import ::state::normal;
|
| 6 |
+
import ::base::mono_mode;
|
| 7 |
+
|
| 8 |
+
export material Plastic_Glossy_White_A(*)
|
| 9 |
+
= OmniPBR(
|
| 10 |
+
diffuse_color_constant: color(0.2, 0.2, 0.2),
|
| 11 |
+
diffuse_texture: texture_2d("../textures/T_Plastic_Glossy_White_A_Albedo.png", ::tex::gamma_srgb),
|
| 12 |
+
albedo_desaturation: 0.0,
|
| 13 |
+
albedo_add: 0.0,
|
| 14 |
+
albedo_brightness: 1.0,
|
| 15 |
+
diffuse_tint: color(1, 1, 1),
|
| 16 |
+
reflection_roughness_texture_influence: 1.0,
|
| 17 |
+
specular_level: 0.5,
|
| 18 |
+
enable_ORM_texture: true,
|
| 19 |
+
ORM_texture: texture_2d("../textures/T_Plastic_Glossy_White_A_ORM.png", ::tex::gamma_linear),
|
| 20 |
+
ao_to_diffuse: 0.0,
|
| 21 |
+
ao_texture: texture_2d(),
|
| 22 |
+
enable_emission: false,
|
| 23 |
+
enable_opacity: false,
|
| 24 |
+
bump_factor: 1.0,
|
| 25 |
+
normalmap_texture: texture_2d("../textures/T_Plastic_Glossy_White_A_Normal.png", ::tex::gamma_linear),
|
| 26 |
+
flip_tangent_u: false,
|
| 27 |
+
flip_tangent_v: true,
|
| 28 |
+
project_uvw: false,
|
| 29 |
+
world_or_object: false,
|
| 30 |
+
uv_space_index: 0,
|
| 31 |
+
texture_translate: float2(0, 0),
|
| 32 |
+
texture_rotate: 0.0,
|
| 33 |
+
texture_scale: float2(1, 1),
|
| 34 |
+
detail_texture_translate: float2(0, 0),
|
| 35 |
+
detail_texture_rotate: 0.0,
|
| 36 |
+
detail_texture_scale: float2(1, 1));
|
objects/glasses/materials/robolab/objects/hot3d/textures/obj_000023.png
ADDED
|
Git LFS Details
|
objects/ketchup_bottle/materials/robolab/objects/hope/textures/obj_000011.png
ADDED
|
Git LFS Details
|
objects/lime01/materials/robolab/objects/fruits_veggies/materials/SimPBR.mdl
ADDED
|
@@ -0,0 +1,562 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*****************************************************************************
|
| 2 |
+
* Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
******************************************************************************
|
| 4 |
+
|
| 5 |
+
MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
|
| 6 |
+
WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
|
| 7 |
+
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 8 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
| 9 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
| 10 |
+
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
|
| 11 |
+
CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
|
| 12 |
+
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
| 13 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
| 14 |
+
THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
|
| 15 |
+
THE MDL MATERIALS.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
mdl 1.4;
|
| 19 |
+
|
| 20 |
+
import ::df::*;
|
| 21 |
+
import ::state::*;
|
| 22 |
+
import ::math::*;
|
| 23 |
+
import ::base::*;
|
| 24 |
+
import ::tex::*;
|
| 25 |
+
import ::anno::*;
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
using SimPBR_Model import *;
|
| 29 |
+
using baking_annotations import *;
|
| 30 |
+
|
| 31 |
+
export material SimPBR(
|
| 32 |
+
// -------------------- DIFFUSE REFLECTION ----------------------
|
| 33 |
+
uniform color diffuse_color_constant = color(0.2f)
|
| 34 |
+
[[
|
| 35 |
+
anno::display_name("Albedo Base Color"),
|
| 36 |
+
anno::description("The base albedo color to use if no texture is specified"),
|
| 37 |
+
anno::in_group("Diffuse")
|
| 38 |
+
]],
|
| 39 |
+
uniform texture_2d diffuse_texture = texture_2d()
|
| 40 |
+
[[
|
| 41 |
+
anno::display_name("Albedo Map"),
|
| 42 |
+
anno::description("The texture specifying the albedo value to use"),
|
| 43 |
+
anno::in_group("Diffuse")
|
| 44 |
+
]],
|
| 45 |
+
uniform color diffuse_tint = color(1.0f)
|
| 46 |
+
[[
|
| 47 |
+
anno::display_name("Albedo Tint"),
|
| 48 |
+
anno::description("This tints the albedo color or texture contant"),
|
| 49 |
+
anno::in_group("Diffuse")
|
| 50 |
+
]],
|
| 51 |
+
uniform bool enable_transmission = false
|
| 52 |
+
[[
|
| 53 |
+
anno::display_name("Enable Diffuse Transmission"),
|
| 54 |
+
anno::description("Enables the diffuse transmission of light through thin diffuse scattering layer"),
|
| 55 |
+
anno::in_group("Diffuse")
|
| 56 |
+
]],
|
| 57 |
+
uniform float opacity_ratio = 1.f
|
| 58 |
+
[[
|
| 59 |
+
anno::enable_if("enable_transmission == true"),
|
| 60 |
+
anno::display_name("Opacity Ratio"),
|
| 61 |
+
anno::description("Amount of opacity"),
|
| 62 |
+
anno::in_group("Diffuse")
|
| 63 |
+
]],
|
| 64 |
+
uniform color opacity_tint = color(1.0f)
|
| 65 |
+
[[
|
| 66 |
+
anno::enable_if("enable_transmission == true"),
|
| 67 |
+
anno::display_name("Diffuse transmission tint"),
|
| 68 |
+
anno::description("Base diffuse transmission color"),
|
| 69 |
+
anno::in_group("Diffuse")
|
| 70 |
+
]],
|
| 71 |
+
uniform float opacity_multiplier = 1.f
|
| 72 |
+
[[
|
| 73 |
+
anno::enable_if("enable_transmission == true"),
|
| 74 |
+
anno::display_name("Diffuse transmission multiplier"),
|
| 75 |
+
anno::description("Base diffuse transmission multiplier"),
|
| 76 |
+
anno::in_group("Diffuse")
|
| 77 |
+
]],
|
| 78 |
+
|
| 79 |
+
// -------------------- SPECULAR REFLECTION ----------------------
|
| 80 |
+
float reflection_roughness_constant = 0.5f
|
| 81 |
+
[[
|
| 82 |
+
anno::display_name("Roughness Amount"),
|
| 83 |
+
anno::hard_range(0.0,1.),
|
| 84 |
+
anno::description("Higher roughness values lead to more blurry reflections"),
|
| 85 |
+
anno::in_group("Specular")
|
| 86 |
+
]],
|
| 87 |
+
uniform float reflection_roughness_texture_influence = 0.0f
|
| 88 |
+
[[
|
| 89 |
+
anno::display_name("Roughness Map Influence"),
|
| 90 |
+
anno::hard_range(0.0, 1.),
|
| 91 |
+
anno::description("Blends between the constant value and the lookup of the roughness texture"),
|
| 92 |
+
anno::in_group("Specular")
|
| 93 |
+
]],
|
| 94 |
+
uniform texture_2d reflectionroughness_texture = texture_2d()
|
| 95 |
+
[[
|
| 96 |
+
anno::display_name("Roughness Map"),
|
| 97 |
+
anno::in_group("Specular")
|
| 98 |
+
]],
|
| 99 |
+
|
| 100 |
+
float anisotropy_constant = 0.0f
|
| 101 |
+
[[
|
| 102 |
+
anno::display_name("Anisotropy Amount"),
|
| 103 |
+
anno::hard_range(-1.,1.),
|
| 104 |
+
anno::description("0 for isotropic, extents of -1 to 1 for anisotropy"),
|
| 105 |
+
anno::in_group("Specular")
|
| 106 |
+
]],
|
| 107 |
+
uniform float anisotropy_texture_influence = 0.0f
|
| 108 |
+
[[
|
| 109 |
+
anno::display_name("Anisotropy Map Influence"),
|
| 110 |
+
anno::hard_range(0.0, 1.),
|
| 111 |
+
anno::description("Blends between the constant value and the lookup of the anisotropy texture"),
|
| 112 |
+
anno::in_group("Specular")
|
| 113 |
+
]],
|
| 114 |
+
uniform texture_2d anisotropy_texture = texture_2d()
|
| 115 |
+
[[
|
| 116 |
+
anno::display_name("Anisotropy Map"),
|
| 117 |
+
anno::in_group("Specular")
|
| 118 |
+
]],
|
| 119 |
+
|
| 120 |
+
float metallic_constant = 0.f
|
| 121 |
+
[[
|
| 122 |
+
anno::display_name("Metallic Amount"),
|
| 123 |
+
anno::hard_range(0.0,1.),
|
| 124 |
+
anno::description("Metallic Material"),
|
| 125 |
+
anno::in_group("Specular")
|
| 126 |
+
]],
|
| 127 |
+
uniform float metallic_texture_influence = 0.0f
|
| 128 |
+
[[
|
| 129 |
+
anno::display_name("Metallic Map Influence"),
|
| 130 |
+
anno::hard_range(0.0, 1.),
|
| 131 |
+
anno::description("Blends between the constant value and the lookup of the metallic texture"),
|
| 132 |
+
anno::in_group("Specular")
|
| 133 |
+
]],
|
| 134 |
+
uniform texture_2d metallic_texture = texture_2d()
|
| 135 |
+
[[
|
| 136 |
+
anno::display_name("Metallic Map"),
|
| 137 |
+
anno::in_group("Specular")
|
| 138 |
+
]],
|
| 139 |
+
|
| 140 |
+
float specular_constant = 1.f
|
| 141 |
+
[[
|
| 142 |
+
anno::display_name("Specular amount"),
|
| 143 |
+
anno::hard_range(0.0, 1.0),
|
| 144 |
+
anno::description("Scale of the specular component"),
|
| 145 |
+
anno::in_group("Specular")
|
| 146 |
+
]],
|
| 147 |
+
uniform texture_2d specular_texture = texture_2d()
|
| 148 |
+
[[
|
| 149 |
+
anno::display_name("Specular Map"),
|
| 150 |
+
anno::in_group("Specular")
|
| 151 |
+
]],
|
| 152 |
+
|
| 153 |
+
// -------------------- ORM ----------------------
|
| 154 |
+
uniform bool enable_ORM_texture = true
|
| 155 |
+
[[
|
| 156 |
+
anno::display_name("Enable ORM Texture"),
|
| 157 |
+
anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
|
| 158 |
+
anno::in_group("Reflectivity")
|
| 159 |
+
]],
|
| 160 |
+
uniform texture_2d ORM_texture = texture_2d()
|
| 161 |
+
[[
|
| 162 |
+
anno::display_name("ORM Map"),
|
| 163 |
+
anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
|
| 164 |
+
anno::in_group("Reflectivity")
|
| 165 |
+
]],
|
| 166 |
+
|
| 167 |
+
// -------------------- Clearcoat ----------------------
|
| 168 |
+
uniform bool enable_clearcoat = false
|
| 169 |
+
[[
|
| 170 |
+
anno::display_name("Enable Clearcoat Layer"),
|
| 171 |
+
anno::description("Adds a clearcoat layer on top of the material when enabled"),
|
| 172 |
+
anno::in_group("Clearcoat")
|
| 173 |
+
]],
|
| 174 |
+
color clearcoat_tint = color(1.0f)
|
| 175 |
+
[[
|
| 176 |
+
anno::display_name("Clearcoat Tint"),
|
| 177 |
+
anno::description("Clearcoat is tinted and affects the underlying material"),
|
| 178 |
+
anno::in_group("Clearcoat")
|
| 179 |
+
]],
|
| 180 |
+
float clearcoat_transparency = 1.0f
|
| 181 |
+
[[
|
| 182 |
+
anno::display_name("Clearcoat Transparency"),
|
| 183 |
+
anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
|
| 184 |
+
"covering the underlying layer"),
|
| 185 |
+
anno::in_group("Clearcoat")
|
| 186 |
+
]],
|
| 187 |
+
float clearcoat_reflection_roughness = 0.0f
|
| 188 |
+
[[
|
| 189 |
+
anno::display_name("Clearcoat Roughness"),
|
| 190 |
+
anno::description("Higher roughness values lead to more blurry reflections"),
|
| 191 |
+
anno::hard_range(0.0f, 1.0f),
|
| 192 |
+
anno::in_group("Clearcoat")
|
| 193 |
+
]],
|
| 194 |
+
float clearcoat_weight = 1.0f
|
| 195 |
+
[[
|
| 196 |
+
anno::display_name("Clearcoat Weight"),
|
| 197 |
+
anno::description("Sets the weight for clearcoat layer"),
|
| 198 |
+
anno::hard_range(0.0f, 1.0f),
|
| 199 |
+
anno::in_group("Clearcoat")
|
| 200 |
+
]],
|
| 201 |
+
float clearcoat_flatten = 1.0f
|
| 202 |
+
[[
|
| 203 |
+
anno::display_name("Clearcoat Flatten"),
|
| 204 |
+
anno::description("Flattens the clearcoat to even out the underlying bump maps"),
|
| 205 |
+
anno::hard_range(0.0f, 1.0f),
|
| 206 |
+
anno::in_group("Clearcoat")
|
| 207 |
+
]],
|
| 208 |
+
float clearcoat_ior = 1.56f
|
| 209 |
+
[[
|
| 210 |
+
anno::display_name("Clearcoat IOR"),
|
| 211 |
+
anno::description("Sets the Index of refraction for the clearcoat layer"),
|
| 212 |
+
anno::soft_range(1.0f, 4.0f),
|
| 213 |
+
anno::in_group("Clearcoat")
|
| 214 |
+
]],
|
| 215 |
+
uniform float clearcoat_bump_factor = 1.f
|
| 216 |
+
[[
|
| 217 |
+
anno::display_name("Clearcoat Normal Map Strength"),
|
| 218 |
+
anno::description("Strength of normal map."),
|
| 219 |
+
anno::in_group("Clearcoat")
|
| 220 |
+
]],
|
| 221 |
+
|
| 222 |
+
float3 clearcoat_normal_input = float3(0.0, 0.0, 0.0),
|
| 223 |
+
uniform texture_2d clearcoat_normalmap_texture = texture_2d()
|
| 224 |
+
[[
|
| 225 |
+
anno::display_name("Clearcoat Normal Map"),
|
| 226 |
+
anno::description("Enables the usage of the normalmap texture"),
|
| 227 |
+
anno::in_group("Clearcoat")
|
| 228 |
+
]],
|
| 229 |
+
|
| 230 |
+
uniform bool clearcoat_flip_tangent_u = false
|
| 231 |
+
[[
|
| 232 |
+
anno::display_name("Clearcoat Normal Map Flip U Tangent"),
|
| 233 |
+
anno::in_group("Clearcoat")
|
| 234 |
+
]],
|
| 235 |
+
uniform bool clearcoat_flip_tangent_v = true
|
| 236 |
+
[[
|
| 237 |
+
anno::display_name("Clearcoat Normal Map Flip V Tangent"),
|
| 238 |
+
anno::in_group("Clearcoat")
|
| 239 |
+
]],
|
| 240 |
+
|
| 241 |
+
|
| 242 |
+
// -------------------- REFLECTIVITY ----------------------
|
| 243 |
+
uniform bool enable_retroreflection = false
|
| 244 |
+
[[
|
| 245 |
+
anno::display_name("Enable Retroreflection"),
|
| 246 |
+
anno::in_group("Reflectivity")
|
| 247 |
+
]],
|
| 248 |
+
color retroreflection_tint = color(.182,.800,.000)
|
| 249 |
+
[[
|
| 250 |
+
anno::display_name("Retro-reflection tint"),
|
| 251 |
+
anno::description("The tint of the retroreflection"),
|
| 252 |
+
anno::in_group("Reflectivity")
|
| 253 |
+
]],
|
| 254 |
+
uniform float normal_reflectivity = 0.5
|
| 255 |
+
[[
|
| 256 |
+
anno::display_name("Retro-reflection weight facing"),
|
| 257 |
+
anno::hard_range(0.0,1.),
|
| 258 |
+
anno::description("Reflectivity control for geometry facing the viewer"),
|
| 259 |
+
anno::in_group("Reflectivity")
|
| 260 |
+
]],
|
| 261 |
+
uniform float grazing_reflectivity = 1.0
|
| 262 |
+
[[
|
| 263 |
+
anno::display_name("Retro-reflection weight edge"),
|
| 264 |
+
anno::hard_range(0.0,1.),
|
| 265 |
+
anno::description("Reflectivity control for the reflectivity at geometry edges"),
|
| 266 |
+
anno::in_group("Reflectivity")
|
| 267 |
+
]],
|
| 268 |
+
|
| 269 |
+
// -------------------- AMBIENT OCCLUSION ----------------------
|
| 270 |
+
float ao_to_diffuse = 0.0
|
| 271 |
+
[[
|
| 272 |
+
anno::display_name("AO to Diffuse"),
|
| 273 |
+
anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
|
| 274 |
+
anno::in_group("AO")
|
| 275 |
+
]],
|
| 276 |
+
float ao_input = float(1.0),
|
| 277 |
+
uniform texture_2d ao_texture = texture_2d()
|
| 278 |
+
[[
|
| 279 |
+
anno::display_name("Ambient Occlusion Map"),
|
| 280 |
+
anno::description("The Ambient Occlusion texture for the material"),
|
| 281 |
+
anno::in_group("AO")
|
| 282 |
+
]],
|
| 283 |
+
|
| 284 |
+
// -------------------- EMISSIVE ----------------------
|
| 285 |
+
uniform bool enable_emission = false
|
| 286 |
+
[[
|
| 287 |
+
anno::display_name("Enable Emission"),
|
| 288 |
+
anno::description("Enables the emission of light from the material"),
|
| 289 |
+
anno::in_group("Emissive")
|
| 290 |
+
]],
|
| 291 |
+
uniform color emissive_color = color(1.0, 0.1, 0.1)
|
| 292 |
+
[[
|
| 293 |
+
anno::enable_if("enable_emission == true"),
|
| 294 |
+
anno::display_name("Emissive Color"),
|
| 295 |
+
anno::description("The emission color"),
|
| 296 |
+
anno::in_group("Emissive")
|
| 297 |
+
]],
|
| 298 |
+
|
| 299 |
+
color emissive_mask_input = color(1.0),
|
| 300 |
+
uniform texture_2d emissive_mask_texture = texture_2d()
|
| 301 |
+
[[
|
| 302 |
+
anno::enable_if("enable_emission == true"),
|
| 303 |
+
anno::display_name("Emissive Mask Map"),
|
| 304 |
+
anno::description("The texture masking the emissive color"),
|
| 305 |
+
anno::in_group("Emissive")
|
| 306 |
+
]],
|
| 307 |
+
uniform float emissive_intensity = 40.f
|
| 308 |
+
[[
|
| 309 |
+
anno::enable_if("enable_emission == true"),
|
| 310 |
+
anno::display_name("Emissive Intensity"),
|
| 311 |
+
anno::description("Intensity of the emission"),
|
| 312 |
+
anno::in_group("Emissive")
|
| 313 |
+
]],
|
| 314 |
+
uniform bool enable_emissive_flipbook = false
|
| 315 |
+
[[
|
| 316 |
+
anno::display_name("Enable Flipbook for emission"),
|
| 317 |
+
anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
|
| 318 |
+
anno::in_group("Emissive")
|
| 319 |
+
]],
|
| 320 |
+
uniform int2 flipbook_dim = int2(1,1)
|
| 321 |
+
[[
|
| 322 |
+
anno::enable_if("enable_emissive_flipbook == true"),
|
| 323 |
+
anno::display_name("Flipbook Rows/Columns"),
|
| 324 |
+
anno::description("How many rows and columns are in the flipbook?"),
|
| 325 |
+
anno::in_group("Emissive")
|
| 326 |
+
]],
|
| 327 |
+
uniform int target_fps = 1
|
| 328 |
+
[[
|
| 329 |
+
anno::enable_if("enable_emissive_flipbook == true"),
|
| 330 |
+
anno::display_name("Flipbook Target FPS"),
|
| 331 |
+
anno::description("Playback speed in frames per second"),
|
| 332 |
+
anno::in_group("Emissive")
|
| 333 |
+
]],
|
| 334 |
+
|
| 335 |
+
// -------------------- ALPHA ----------------------
|
| 336 |
+
uniform bool enable_opacity = false
|
| 337 |
+
[[
|
| 338 |
+
anno::display_name("Enable Opacity"),
|
| 339 |
+
anno::description("Enables or disables alpha functionality"),
|
| 340 |
+
anno::in_group("Alpha")
|
| 341 |
+
]],
|
| 342 |
+
float alpha_constant = 1.0
|
| 343 |
+
[[
|
| 344 |
+
anno::enable_if("enable_opacity == true"),
|
| 345 |
+
anno::display_name("Opacity Fallback Constant"),
|
| 346 |
+
anno::hard_range(0.0, 1.0),
|
| 347 |
+
anno::description("The base alpha constant to use if no texture is specified"),
|
| 348 |
+
anno::in_group("Alpha")
|
| 349 |
+
]],
|
| 350 |
+
uniform texture_2d opacity_texture = texture_2d()
|
| 351 |
+
[[
|
| 352 |
+
anno::enable_if("enable_opacity == true"),
|
| 353 |
+
anno::display_name("Opacity Map"),
|
| 354 |
+
anno::description("The texture specifying the opacity value to use"),
|
| 355 |
+
anno::in_group("Alpha")
|
| 356 |
+
]],
|
| 357 |
+
uniform bool enable_opacity_cutout = false
|
| 358 |
+
[[
|
| 359 |
+
anno::enable_if("enable_opacity == true"),
|
| 360 |
+
anno::display_name("Enable Alpha Cutout"),
|
| 361 |
+
anno::description("Enables or disables alpha cutout functionality"),
|
| 362 |
+
anno::in_group("Alpha")
|
| 363 |
+
]],
|
| 364 |
+
uniform float alpha_cutout_cutoff = 1.f
|
| 365 |
+
[[
|
| 366 |
+
anno::enable_if("enable_opacity == true"),
|
| 367 |
+
anno::enable_if("enable_opacity_cutout == true"),
|
| 368 |
+
anno::hard_range(0.0, 1.0),
|
| 369 |
+
anno::display_name("Alpha Cutout Cutoff"),
|
| 370 |
+
anno::description("The cutoff value to to render as transparent up to and opaque past"),
|
| 371 |
+
anno::in_group("Alpha")
|
| 372 |
+
]],
|
| 373 |
+
|
| 374 |
+
// -------------------- NORMAL ----------------------
|
| 375 |
+
uniform float bump_factor = 1.f
|
| 376 |
+
[[
|
| 377 |
+
anno::display_name("Normal Map Strength"),
|
| 378 |
+
anno::description("Strength of normal map."),
|
| 379 |
+
anno::in_group("Normal")
|
| 380 |
+
]],
|
| 381 |
+
|
| 382 |
+
float3 normal_input = state::normal(),
|
| 383 |
+
uniform texture_2d normalmap_texture = texture_2d()
|
| 384 |
+
[[
|
| 385 |
+
anno::display_name("Normal Map"),
|
| 386 |
+
anno::in_group("Normal")
|
| 387 |
+
]],
|
| 388 |
+
uniform bool flip_tangent_u = false
|
| 389 |
+
[[
|
| 390 |
+
anno::display_name("Normal Map Flip U Tangent"),
|
| 391 |
+
anno::description("Flips the U Tangent vector."),
|
| 392 |
+
anno::in_group("Normal")
|
| 393 |
+
]],
|
| 394 |
+
uniform bool flip_tangent_v = true
|
| 395 |
+
[[
|
| 396 |
+
anno::display_name("Normal Map Flip V Tangent"),
|
| 397 |
+
anno::description("Flips the V Tangent vector. By Default, SimPBR materials setup for DirectX normal maps. Set Normal Map Flip V = false for OpenGL."),
|
| 398 |
+
anno::in_group("Normal")
|
| 399 |
+
]],
|
| 400 |
+
|
| 401 |
+
// -------------------- UV ADJUSTMENTS ----------------------
|
| 402 |
+
uniform bool project_uvw = false
|
| 403 |
+
[[
|
| 404 |
+
anno::display_name("Enable Project UVW Coordinates"),
|
| 405 |
+
anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
|
| 406 |
+
anno::in_group("UV")
|
| 407 |
+
]],
|
| 408 |
+
uniform bool world_or_object = false
|
| 409 |
+
[[
|
| 410 |
+
anno::enable_if("project_uvw == true"),
|
| 411 |
+
anno::display_name("Enable World Space"),
|
| 412 |
+
anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
|
| 413 |
+
anno::in_group("UV")
|
| 414 |
+
]],
|
| 415 |
+
uniform float2 texture_translate = float2(0.0f)
|
| 416 |
+
[[
|
| 417 |
+
anno::display_name("Texture Translate"),
|
| 418 |
+
anno::description("Controls position of texture."),
|
| 419 |
+
anno::in_group("UV")
|
| 420 |
+
]],
|
| 421 |
+
uniform float2 texture_scale = float2(1.0f)
|
| 422 |
+
[[
|
| 423 |
+
anno::display_name("Texture Tiling"),
|
| 424 |
+
anno::description("Controls repetition of the texture."),
|
| 425 |
+
anno::in_group("UV")
|
| 426 |
+
]],
|
| 427 |
+
uniform float2 texture_speed = float2(0.0f)
|
| 428 |
+
[[
|
| 429 |
+
anno::display_name("Texture Speed"),
|
| 430 |
+
anno::description("Scrolling texture animation speed in UVs per sec."),
|
| 431 |
+
anno::in_group("UV")
|
| 432 |
+
]]
|
| 433 |
+
)
|
| 434 |
+
[[
|
| 435 |
+
anno::display_name("Sim PBR"),
|
| 436 |
+
anno::description("Supports the opaque alpha cutout material model of the Sim Renderer"),
|
| 437 |
+
anno::in_group("SimReady"),
|
| 438 |
+
anno::version( 1, 0, 0),
|
| 439 |
+
anno::author("NVIDIA CORPORATION"),
|
| 440 |
+
anno::key_words(string[]("Sim", "PBR", "opaque", "alpha", "cutout", "omniverse", "generic"))
|
| 441 |
+
]]
|
| 442 |
+
= let {
|
| 443 |
+
base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
|
| 444 |
+
|
| 445 |
+
base::texture_coordinate_info uvw = project_uvw ?
|
| 446 |
+
base::coordinate_projection(
|
| 447 |
+
coordinate_system: the_system,
|
| 448 |
+
texture_space: 0,
|
| 449 |
+
projection_type: base::projection_cubic
|
| 450 |
+
) : base::coordinate_source(
|
| 451 |
+
coordinate_system: base::texture_coordinate_uvw,
|
| 452 |
+
texture_space: 0
|
| 453 |
+
);
|
| 454 |
+
|
| 455 |
+
// Need to use a small value so the compiler doesnt optimize out this var...
|
| 456 |
+
float t = 0.00000001;//state::animation_time();
|
| 457 |
+
base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
|
| 458 |
+
transform: base::rotation_translation_scale(
|
| 459 |
+
scaling: float3(texture_scale.x, texture_scale.y, 1.0),
|
| 460 |
+
rotation: float3(0.0, 0.0, 0.0 ),
|
| 461 |
+
translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
|
| 462 |
+
coordinate: uvw
|
| 463 |
+
);
|
| 464 |
+
float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
|
| 465 |
+
|
| 466 |
+
// Diffuse Color Lookup and AO
|
| 467 |
+
float4 base_lookup = tex::texture_isvalid(diffuse_texture) ? tex::lookup_float4(tex: diffuse_texture, coord: uv) : float4(1, 1, 1, 1);
|
| 468 |
+
|
| 469 |
+
float opacityValue = tex::texture_isvalid(opacity_texture) ? tex::lookup_float4(tex: opacity_texture, coord: uv).w : alpha_constant;
|
| 470 |
+
|
| 471 |
+
// Normal calculations
|
| 472 |
+
float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
|
| 473 |
+
base::tangent_space_normal_texture(
|
| 474 |
+
texture: normalmap_texture,
|
| 475 |
+
factor: bump_factor,
|
| 476 |
+
uvw: transformed_uvw,
|
| 477 |
+
flip_tangent_u: flip_tangent_u,
|
| 478 |
+
flip_tangent_v: flip_tangent_v
|
| 479 |
+
) : normal_input;
|
| 480 |
+
|
| 481 |
+
float3 clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ?
|
| 482 |
+
base::tangent_space_normal_texture(
|
| 483 |
+
texture: clearcoat_normalmap_texture,
|
| 484 |
+
factor: clearcoat_bump_factor,
|
| 485 |
+
uvw: uvw,
|
| 486 |
+
flip_tangent_u: clearcoat_flip_tangent_u,
|
| 487 |
+
flip_tangent_v: clearcoat_flip_tangent_v
|
| 488 |
+
) : clearcoat_normal_input;
|
| 489 |
+
|
| 490 |
+
float3 flattened_clearcoat_normal = ::math::lerp(normal_lookup, ::state::normal(), clearcoat_flatten);
|
| 491 |
+
float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? clearcoat_normal : flattened_clearcoat_normal;
|
| 492 |
+
|
| 493 |
+
float ao_lookup = tex::texture_isvalid(ao_texture) ? tex::lookup_float4(tex: ao_texture, coord: uv).x : ao_input;
|
| 494 |
+
|
| 495 |
+
color diffuse_color = tex::texture_isvalid(diffuse_texture) ? color(base_lookup.x, base_lookup.y, base_lookup.z) : diffuse_color_constant;
|
| 496 |
+
|
| 497 |
+
float3 ORM_lookup = tex::lookup_float3(
|
| 498 |
+
tex: ORM_texture,
|
| 499 |
+
coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
|
| 500 |
+
);
|
| 501 |
+
|
| 502 |
+
float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
|
| 503 |
+
tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
|
| 504 |
+
float anisotropy_lookup = tex::texture_isvalid(anisotropy_texture) ?
|
| 505 |
+
(tex::lookup_float4(tex: anisotropy_texture, coord: uv).x * 2.0f - 1.0f) : anisotropy_constant;
|
| 506 |
+
float metallic_lookup = tex::texture_isvalid(metallic_texture) ?
|
| 507 |
+
tex::lookup_float4(tex: metallic_texture, coord: uv).x : metallic_constant;
|
| 508 |
+
float specular_lookup = tex::texture_isvalid(specular_texture) ?
|
| 509 |
+
tex::lookup_float4(tex: specular_texture, coord: uv).x : specular_constant;
|
| 510 |
+
|
| 511 |
+
float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup;
|
| 512 |
+
float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup;
|
| 513 |
+
float ao = enable_ORM_texture ? ORM_lookup.x : ao_lookup;
|
| 514 |
+
|
| 515 |
+
float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
|
| 516 |
+
float anisotropy = math::lerp(anisotropy_constant, anisotropy_lookup, anisotropy_texture_influence);
|
| 517 |
+
float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
|
| 518 |
+
|
| 519 |
+
int rows = flipbook_dim.x;
|
| 520 |
+
int columns = flipbook_dim.y;
|
| 521 |
+
int numFrames = rows * columns;
|
| 522 |
+
varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
|
| 523 |
+
varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
|
| 524 |
+
varying float2 emissiveUV = enable_emissive_flipbook ?
|
| 525 |
+
((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
|
| 526 |
+
|
| 527 |
+
color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
|
| 528 |
+
tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : emissive_mask_input;
|
| 529 |
+
|
| 530 |
+
} in SimPBR_Model(
|
| 531 |
+
diffuse_color: diffuse_color,
|
| 532 |
+
diffuse_tint: diffuse_tint,
|
| 533 |
+
roughness: reflection_roughness,
|
| 534 |
+
anisotropy: anisotropy,
|
| 535 |
+
metallic: metallic,
|
| 536 |
+
specular: specular_lookup,
|
| 537 |
+
normal: normal_lookup,
|
| 538 |
+
enable_clearcoat: enable_clearcoat,
|
| 539 |
+
clearcoat_tint: clearcoat_tint,
|
| 540 |
+
clearcoat_transparency: clearcoat_transparency,
|
| 541 |
+
clearcoat_reflection_roughness: clearcoat_reflection_roughness,
|
| 542 |
+
clearcoat_weight: clearcoat_weight,
|
| 543 |
+
clearcoat_ior: clearcoat_ior,
|
| 544 |
+
clearcoat_normal: final_clearcoat_normal,
|
| 545 |
+
enable_retroreflection: enable_retroreflection,
|
| 546 |
+
retroreflection_tint: retroreflection_tint,
|
| 547 |
+
normal_reflectivity: normal_reflectivity,
|
| 548 |
+
grazing_reflectivity: grazing_reflectivity,
|
| 549 |
+
ao_to_diffuse: ao_to_diffuse,
|
| 550 |
+
ao: ao,
|
| 551 |
+
enable_emission: enable_emission,
|
| 552 |
+
emissive_color: emissive_color,
|
| 553 |
+
emissive_mask: emissive_mask,
|
| 554 |
+
emissive_intensity: emissive_intensity,
|
| 555 |
+
enable_opacity: enable_opacity,
|
| 556 |
+
alpha: opacityValue,
|
| 557 |
+
enable_opacity_cutout: enable_opacity_cutout,
|
| 558 |
+
alpha_cutout_cutoff: alpha_cutout_cutoff,
|
| 559 |
+
opacity_ratio: enable_transmission ? opacity_ratio : 1.0,
|
| 560 |
+
opacity_tint : opacity_tint,
|
| 561 |
+
opacity_multiplier : opacity_multiplier
|
| 562 |
+
);
|
objects/lime01/materials/robolab/objects/fruits_veggies/materials/baking_annotations.mdl
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.4;
|
| 2 |
+
import ::anno::*;
|
| 3 |
+
|
| 4 |
+
export const string TRANSFORM_NONE = "NONE";
|
| 5 |
+
export const string TRANSFORM_UNORM_VECTOR = "UNORM_VECTOR";
|
| 6 |
+
|
| 7 |
+
export const string FORMAT_RGBA8_UNORM = "RGBA8_UNORM";
|
| 8 |
+
export const string FORMAT_R8_UNORM = "R8_UNORM";
|
| 9 |
+
export const string FORMAT_RGBA16_SFLOAT = "RGBA16_SFLOAT";
|
| 10 |
+
|
| 11 |
+
export const string BLEND_MODE_OPACITY = "opacity_blend";
|
| 12 |
+
export const string BLEND_MODE_REPLACE = "replace";
|
| 13 |
+
|
| 14 |
+
// This annotation is used to mark a material as target material for baking.
|
| 15 |
+
// It is that is detected by the MDL SDK and neuray.
|
| 16 |
+
export annotation target_material_model();
|
| 17 |
+
|
| 18 |
+
export annotation target_material_rendering(
|
| 19 |
+
string rendering_material_override = "" // if set, the baked material will be rendering using this material,
|
| 20 |
+
// otherwise the target itself is used
|
| 21 |
+
);
|
| 22 |
+
|
| 23 |
+
export annotation target_baked_argument(
|
| 24 |
+
// the name of the baked texture parameter in the rendering material
|
| 25 |
+
string baked_name,
|
| 26 |
+
|
| 27 |
+
// the name of the constant parameter in the rendering material in case baking was not necessary
|
| 28 |
+
string constant_name = "",
|
| 29 |
+
|
| 30 |
+
// texture format to bake to
|
| 31 |
+
string format = "",
|
| 32 |
+
|
| 33 |
+
// transformations, like encoding normals into [0,1] range
|
| 34 |
+
string transform = TRANSFORM_NONE,
|
| 35 |
+
|
| 36 |
+
// blending, e.g., based on alpha or replace
|
| 37 |
+
string blend_mode = BLEND_MODE_OPACITY
|
| 38 |
+
);
|
objects/orange_02/materials/robolab/objects/fruits_veggies/materials/SimPBR.mdl
ADDED
|
@@ -0,0 +1,562 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
| 1 |
+
/*****************************************************************************
|
| 2 |
+
* Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
******************************************************************************
|
| 4 |
+
|
| 5 |
+
MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
|
| 6 |
+
WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
|
| 7 |
+
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 8 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
| 9 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
| 10 |
+
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
|
| 11 |
+
CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
|
| 12 |
+
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
| 13 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
| 14 |
+
THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
|
| 15 |
+
THE MDL MATERIALS.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
mdl 1.4;
|
| 19 |
+
|
| 20 |
+
import ::df::*;
|
| 21 |
+
import ::state::*;
|
| 22 |
+
import ::math::*;
|
| 23 |
+
import ::base::*;
|
| 24 |
+
import ::tex::*;
|
| 25 |
+
import ::anno::*;
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
using SimPBR_Model import *;
|
| 29 |
+
using baking_annotations import *;
|
| 30 |
+
|
| 31 |
+
export material SimPBR(
|
| 32 |
+
// -------------------- DIFFUSE REFLECTION ----------------------
|
| 33 |
+
uniform color diffuse_color_constant = color(0.2f)
|
| 34 |
+
[[
|
| 35 |
+
anno::display_name("Albedo Base Color"),
|
| 36 |
+
anno::description("The base albedo color to use if no texture is specified"),
|
| 37 |
+
anno::in_group("Diffuse")
|
| 38 |
+
]],
|
| 39 |
+
uniform texture_2d diffuse_texture = texture_2d()
|
| 40 |
+
[[
|
| 41 |
+
anno::display_name("Albedo Map"),
|
| 42 |
+
anno::description("The texture specifying the albedo value to use"),
|
| 43 |
+
anno::in_group("Diffuse")
|
| 44 |
+
]],
|
| 45 |
+
uniform color diffuse_tint = color(1.0f)
|
| 46 |
+
[[
|
| 47 |
+
anno::display_name("Albedo Tint"),
|
| 48 |
+
anno::description("This tints the albedo color or texture contant"),
|
| 49 |
+
anno::in_group("Diffuse")
|
| 50 |
+
]],
|
| 51 |
+
uniform bool enable_transmission = false
|
| 52 |
+
[[
|
| 53 |
+
anno::display_name("Enable Diffuse Transmission"),
|
| 54 |
+
anno::description("Enables the diffuse transmission of light through thin diffuse scattering layer"),
|
| 55 |
+
anno::in_group("Diffuse")
|
| 56 |
+
]],
|
| 57 |
+
uniform float opacity_ratio = 1.f
|
| 58 |
+
[[
|
| 59 |
+
anno::enable_if("enable_transmission == true"),
|
| 60 |
+
anno::display_name("Opacity Ratio"),
|
| 61 |
+
anno::description("Amount of opacity"),
|
| 62 |
+
anno::in_group("Diffuse")
|
| 63 |
+
]],
|
| 64 |
+
uniform color opacity_tint = color(1.0f)
|
| 65 |
+
[[
|
| 66 |
+
anno::enable_if("enable_transmission == true"),
|
| 67 |
+
anno::display_name("Diffuse transmission tint"),
|
| 68 |
+
anno::description("Base diffuse transmission color"),
|
| 69 |
+
anno::in_group("Diffuse")
|
| 70 |
+
]],
|
| 71 |
+
uniform float opacity_multiplier = 1.f
|
| 72 |
+
[[
|
| 73 |
+
anno::enable_if("enable_transmission == true"),
|
| 74 |
+
anno::display_name("Diffuse transmission multiplier"),
|
| 75 |
+
anno::description("Base diffuse transmission multiplier"),
|
| 76 |
+
anno::in_group("Diffuse")
|
| 77 |
+
]],
|
| 78 |
+
|
| 79 |
+
// -------------------- SPECULAR REFLECTION ----------------------
|
| 80 |
+
float reflection_roughness_constant = 0.5f
|
| 81 |
+
[[
|
| 82 |
+
anno::display_name("Roughness Amount"),
|
| 83 |
+
anno::hard_range(0.0,1.),
|
| 84 |
+
anno::description("Higher roughness values lead to more blurry reflections"),
|
| 85 |
+
anno::in_group("Specular")
|
| 86 |
+
]],
|
| 87 |
+
uniform float reflection_roughness_texture_influence = 0.0f
|
| 88 |
+
[[
|
| 89 |
+
anno::display_name("Roughness Map Influence"),
|
| 90 |
+
anno::hard_range(0.0, 1.),
|
| 91 |
+
anno::description("Blends between the constant value and the lookup of the roughness texture"),
|
| 92 |
+
anno::in_group("Specular")
|
| 93 |
+
]],
|
| 94 |
+
uniform texture_2d reflectionroughness_texture = texture_2d()
|
| 95 |
+
[[
|
| 96 |
+
anno::display_name("Roughness Map"),
|
| 97 |
+
anno::in_group("Specular")
|
| 98 |
+
]],
|
| 99 |
+
|
| 100 |
+
float anisotropy_constant = 0.0f
|
| 101 |
+
[[
|
| 102 |
+
anno::display_name("Anisotropy Amount"),
|
| 103 |
+
anno::hard_range(-1.,1.),
|
| 104 |
+
anno::description("0 for isotropic, extents of -1 to 1 for anisotropy"),
|
| 105 |
+
anno::in_group("Specular")
|
| 106 |
+
]],
|
| 107 |
+
uniform float anisotropy_texture_influence = 0.0f
|
| 108 |
+
[[
|
| 109 |
+
anno::display_name("Anisotropy Map Influence"),
|
| 110 |
+
anno::hard_range(0.0, 1.),
|
| 111 |
+
anno::description("Blends between the constant value and the lookup of the anisotropy texture"),
|
| 112 |
+
anno::in_group("Specular")
|
| 113 |
+
]],
|
| 114 |
+
uniform texture_2d anisotropy_texture = texture_2d()
|
| 115 |
+
[[
|
| 116 |
+
anno::display_name("Anisotropy Map"),
|
| 117 |
+
anno::in_group("Specular")
|
| 118 |
+
]],
|
| 119 |
+
|
| 120 |
+
float metallic_constant = 0.f
|
| 121 |
+
[[
|
| 122 |
+
anno::display_name("Metallic Amount"),
|
| 123 |
+
anno::hard_range(0.0,1.),
|
| 124 |
+
anno::description("Metallic Material"),
|
| 125 |
+
anno::in_group("Specular")
|
| 126 |
+
]],
|
| 127 |
+
uniform float metallic_texture_influence = 0.0f
|
| 128 |
+
[[
|
| 129 |
+
anno::display_name("Metallic Map Influence"),
|
| 130 |
+
anno::hard_range(0.0, 1.),
|
| 131 |
+
anno::description("Blends between the constant value and the lookup of the metallic texture"),
|
| 132 |
+
anno::in_group("Specular")
|
| 133 |
+
]],
|
| 134 |
+
uniform texture_2d metallic_texture = texture_2d()
|
| 135 |
+
[[
|
| 136 |
+
anno::display_name("Metallic Map"),
|
| 137 |
+
anno::in_group("Specular")
|
| 138 |
+
]],
|
| 139 |
+
|
| 140 |
+
float specular_constant = 1.f
|
| 141 |
+
[[
|
| 142 |
+
anno::display_name("Specular amount"),
|
| 143 |
+
anno::hard_range(0.0, 1.0),
|
| 144 |
+
anno::description("Scale of the specular component"),
|
| 145 |
+
anno::in_group("Specular")
|
| 146 |
+
]],
|
| 147 |
+
uniform texture_2d specular_texture = texture_2d()
|
| 148 |
+
[[
|
| 149 |
+
anno::display_name("Specular Map"),
|
| 150 |
+
anno::in_group("Specular")
|
| 151 |
+
]],
|
| 152 |
+
|
| 153 |
+
// -------------------- ORM ----------------------
|
| 154 |
+
uniform bool enable_ORM_texture = true
|
| 155 |
+
[[
|
| 156 |
+
anno::display_name("Enable ORM Texture"),
|
| 157 |
+
anno::description("When True the ORM texture will be used to extract the Occlusion, Roughness and Metallic Map"),
|
| 158 |
+
anno::in_group("Reflectivity")
|
| 159 |
+
]],
|
| 160 |
+
uniform texture_2d ORM_texture = texture_2d()
|
| 161 |
+
[[
|
| 162 |
+
anno::display_name("ORM Map"),
|
| 163 |
+
anno::description("Texture that hae Occlusion, Roughness and Metallic map stored in the respective r, g and b channels"),
|
| 164 |
+
anno::in_group("Reflectivity")
|
| 165 |
+
]],
|
| 166 |
+
|
| 167 |
+
// -------------------- Clearcoat ----------------------
|
| 168 |
+
uniform bool enable_clearcoat = false
|
| 169 |
+
[[
|
| 170 |
+
anno::display_name("Enable Clearcoat Layer"),
|
| 171 |
+
anno::description("Adds a clearcoat layer on top of the material when enabled"),
|
| 172 |
+
anno::in_group("Clearcoat")
|
| 173 |
+
]],
|
| 174 |
+
color clearcoat_tint = color(1.0f)
|
| 175 |
+
[[
|
| 176 |
+
anno::display_name("Clearcoat Tint"),
|
| 177 |
+
anno::description("Clearcoat is tinted and affects the underlying material"),
|
| 178 |
+
anno::in_group("Clearcoat")
|
| 179 |
+
]],
|
| 180 |
+
float clearcoat_transparency = 1.0f
|
| 181 |
+
[[
|
| 182 |
+
anno::display_name("Clearcoat Transparency"),
|
| 183 |
+
anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat "
|
| 184 |
+
"covering the underlying layer"),
|
| 185 |
+
anno::in_group("Clearcoat")
|
| 186 |
+
]],
|
| 187 |
+
float clearcoat_reflection_roughness = 0.0f
|
| 188 |
+
[[
|
| 189 |
+
anno::display_name("Clearcoat Roughness"),
|
| 190 |
+
anno::description("Higher roughness values lead to more blurry reflections"),
|
| 191 |
+
anno::hard_range(0.0f, 1.0f),
|
| 192 |
+
anno::in_group("Clearcoat")
|
| 193 |
+
]],
|
| 194 |
+
float clearcoat_weight = 1.0f
|
| 195 |
+
[[
|
| 196 |
+
anno::display_name("Clearcoat Weight"),
|
| 197 |
+
anno::description("Sets the weight for clearcoat layer"),
|
| 198 |
+
anno::hard_range(0.0f, 1.0f),
|
| 199 |
+
anno::in_group("Clearcoat")
|
| 200 |
+
]],
|
| 201 |
+
float clearcoat_flatten = 1.0f
|
| 202 |
+
[[
|
| 203 |
+
anno::display_name("Clearcoat Flatten"),
|
| 204 |
+
anno::description("Flattens the clearcoat to even out the underlying bump maps"),
|
| 205 |
+
anno::hard_range(0.0f, 1.0f),
|
| 206 |
+
anno::in_group("Clearcoat")
|
| 207 |
+
]],
|
| 208 |
+
float clearcoat_ior = 1.56f
|
| 209 |
+
[[
|
| 210 |
+
anno::display_name("Clearcoat IOR"),
|
| 211 |
+
anno::description("Sets the Index of refraction for the clearcoat layer"),
|
| 212 |
+
anno::soft_range(1.0f, 4.0f),
|
| 213 |
+
anno::in_group("Clearcoat")
|
| 214 |
+
]],
|
| 215 |
+
uniform float clearcoat_bump_factor = 1.f
|
| 216 |
+
[[
|
| 217 |
+
anno::display_name("Clearcoat Normal Map Strength"),
|
| 218 |
+
anno::description("Strength of normal map."),
|
| 219 |
+
anno::in_group("Clearcoat")
|
| 220 |
+
]],
|
| 221 |
+
|
| 222 |
+
float3 clearcoat_normal_input = float3(0.0, 0.0, 0.0),
|
| 223 |
+
uniform texture_2d clearcoat_normalmap_texture = texture_2d()
|
| 224 |
+
[[
|
| 225 |
+
anno::display_name("Clearcoat Normal Map"),
|
| 226 |
+
anno::description("Enables the usage of the normalmap texture"),
|
| 227 |
+
anno::in_group("Clearcoat")
|
| 228 |
+
]],
|
| 229 |
+
|
| 230 |
+
uniform bool clearcoat_flip_tangent_u = false
|
| 231 |
+
[[
|
| 232 |
+
anno::display_name("Clearcoat Normal Map Flip U Tangent"),
|
| 233 |
+
anno::in_group("Clearcoat")
|
| 234 |
+
]],
|
| 235 |
+
uniform bool clearcoat_flip_tangent_v = true
|
| 236 |
+
[[
|
| 237 |
+
anno::display_name("Clearcoat Normal Map Flip V Tangent"),
|
| 238 |
+
anno::in_group("Clearcoat")
|
| 239 |
+
]],
|
| 240 |
+
|
| 241 |
+
|
| 242 |
+
// -------------------- REFLECTIVITY ----------------------
|
| 243 |
+
uniform bool enable_retroreflection = false
|
| 244 |
+
[[
|
| 245 |
+
anno::display_name("Enable Retroreflection"),
|
| 246 |
+
anno::in_group("Reflectivity")
|
| 247 |
+
]],
|
| 248 |
+
color retroreflection_tint = color(.182,.800,.000)
|
| 249 |
+
[[
|
| 250 |
+
anno::display_name("Retro-reflection tint"),
|
| 251 |
+
anno::description("The tint of the retroreflection"),
|
| 252 |
+
anno::in_group("Reflectivity")
|
| 253 |
+
]],
|
| 254 |
+
uniform float normal_reflectivity = 0.5
|
| 255 |
+
[[
|
| 256 |
+
anno::display_name("Retro-reflection weight facing"),
|
| 257 |
+
anno::hard_range(0.0,1.),
|
| 258 |
+
anno::description("Reflectivity control for geometry facing the viewer"),
|
| 259 |
+
anno::in_group("Reflectivity")
|
| 260 |
+
]],
|
| 261 |
+
uniform float grazing_reflectivity = 1.0
|
| 262 |
+
[[
|
| 263 |
+
anno::display_name("Retro-reflection weight edge"),
|
| 264 |
+
anno::hard_range(0.0,1.),
|
| 265 |
+
anno::description("Reflectivity control for the reflectivity at geometry edges"),
|
| 266 |
+
anno::in_group("Reflectivity")
|
| 267 |
+
]],
|
| 268 |
+
|
| 269 |
+
// -------------------- AMBIENT OCCLUSION ----------------------
|
| 270 |
+
float ao_to_diffuse = 0.0
|
| 271 |
+
[[
|
| 272 |
+
anno::display_name("AO to Diffuse"),
|
| 273 |
+
anno::description("Controls the amount of ambient occlusion multiplied into the diffuse color channel"),
|
| 274 |
+
anno::in_group("AO")
|
| 275 |
+
]],
|
| 276 |
+
float ao_input = float(1.0),
|
| 277 |
+
uniform texture_2d ao_texture = texture_2d()
|
| 278 |
+
[[
|
| 279 |
+
anno::display_name("Ambient Occlusion Map"),
|
| 280 |
+
anno::description("The Ambient Occlusion texture for the material"),
|
| 281 |
+
anno::in_group("AO")
|
| 282 |
+
]],
|
| 283 |
+
|
| 284 |
+
// -------------------- EMISSIVE ----------------------
|
| 285 |
+
uniform bool enable_emission = false
|
| 286 |
+
[[
|
| 287 |
+
anno::display_name("Enable Emission"),
|
| 288 |
+
anno::description("Enables the emission of light from the material"),
|
| 289 |
+
anno::in_group("Emissive")
|
| 290 |
+
]],
|
| 291 |
+
uniform color emissive_color = color(1.0, 0.1, 0.1)
|
| 292 |
+
[[
|
| 293 |
+
anno::enable_if("enable_emission == true"),
|
| 294 |
+
anno::display_name("Emissive Color"),
|
| 295 |
+
anno::description("The emission color"),
|
| 296 |
+
anno::in_group("Emissive")
|
| 297 |
+
]],
|
| 298 |
+
|
| 299 |
+
color emissive_mask_input = color(1.0),
|
| 300 |
+
uniform texture_2d emissive_mask_texture = texture_2d()
|
| 301 |
+
[[
|
| 302 |
+
anno::enable_if("enable_emission == true"),
|
| 303 |
+
anno::display_name("Emissive Mask Map"),
|
| 304 |
+
anno::description("The texture masking the emissive color"),
|
| 305 |
+
anno::in_group("Emissive")
|
| 306 |
+
]],
|
| 307 |
+
uniform float emissive_intensity = 40.f
|
| 308 |
+
[[
|
| 309 |
+
anno::enable_if("enable_emission == true"),
|
| 310 |
+
anno::display_name("Emissive Intensity"),
|
| 311 |
+
anno::description("Intensity of the emission"),
|
| 312 |
+
anno::in_group("Emissive")
|
| 313 |
+
]],
|
| 314 |
+
uniform bool enable_emissive_flipbook = false
|
| 315 |
+
[[
|
| 316 |
+
anno::display_name("Enable Flipbook for emission"),
|
| 317 |
+
anno::description("Allows the use of animated emissive textures (e.g. video screens)"),
|
| 318 |
+
anno::in_group("Emissive")
|
| 319 |
+
]],
|
| 320 |
+
uniform int2 flipbook_dim = int2(1,1)
|
| 321 |
+
[[
|
| 322 |
+
anno::enable_if("enable_emissive_flipbook == true"),
|
| 323 |
+
anno::display_name("Flipbook Rows/Columns"),
|
| 324 |
+
anno::description("How many rows and columns are in the flipbook?"),
|
| 325 |
+
anno::in_group("Emissive")
|
| 326 |
+
]],
|
| 327 |
+
uniform int target_fps = 1
|
| 328 |
+
[[
|
| 329 |
+
anno::enable_if("enable_emissive_flipbook == true"),
|
| 330 |
+
anno::display_name("Flipbook Target FPS"),
|
| 331 |
+
anno::description("Playback speed in frames per second"),
|
| 332 |
+
anno::in_group("Emissive")
|
| 333 |
+
]],
|
| 334 |
+
|
| 335 |
+
// -------------------- ALPHA ----------------------
|
| 336 |
+
uniform bool enable_opacity = false
|
| 337 |
+
[[
|
| 338 |
+
anno::display_name("Enable Opacity"),
|
| 339 |
+
anno::description("Enables or disables alpha functionality"),
|
| 340 |
+
anno::in_group("Alpha")
|
| 341 |
+
]],
|
| 342 |
+
float alpha_constant = 1.0
|
| 343 |
+
[[
|
| 344 |
+
anno::enable_if("enable_opacity == true"),
|
| 345 |
+
anno::display_name("Opacity Fallback Constant"),
|
| 346 |
+
anno::hard_range(0.0, 1.0),
|
| 347 |
+
anno::description("The base alpha constant to use if no texture is specified"),
|
| 348 |
+
anno::in_group("Alpha")
|
| 349 |
+
]],
|
| 350 |
+
uniform texture_2d opacity_texture = texture_2d()
|
| 351 |
+
[[
|
| 352 |
+
anno::enable_if("enable_opacity == true"),
|
| 353 |
+
anno::display_name("Opacity Map"),
|
| 354 |
+
anno::description("The texture specifying the opacity value to use"),
|
| 355 |
+
anno::in_group("Alpha")
|
| 356 |
+
]],
|
| 357 |
+
uniform bool enable_opacity_cutout = false
|
| 358 |
+
[[
|
| 359 |
+
anno::enable_if("enable_opacity == true"),
|
| 360 |
+
anno::display_name("Enable Alpha Cutout"),
|
| 361 |
+
anno::description("Enables or disables alpha cutout functionality"),
|
| 362 |
+
anno::in_group("Alpha")
|
| 363 |
+
]],
|
| 364 |
+
uniform float alpha_cutout_cutoff = 1.f
|
| 365 |
+
[[
|
| 366 |
+
anno::enable_if("enable_opacity == true"),
|
| 367 |
+
anno::enable_if("enable_opacity_cutout == true"),
|
| 368 |
+
anno::hard_range(0.0, 1.0),
|
| 369 |
+
anno::display_name("Alpha Cutout Cutoff"),
|
| 370 |
+
anno::description("The cutoff value to to render as transparent up to and opaque past"),
|
| 371 |
+
anno::in_group("Alpha")
|
| 372 |
+
]],
|
| 373 |
+
|
| 374 |
+
// -------------------- NORMAL ----------------------
|
| 375 |
+
uniform float bump_factor = 1.f
|
| 376 |
+
[[
|
| 377 |
+
anno::display_name("Normal Map Strength"),
|
| 378 |
+
anno::description("Strength of normal map."),
|
| 379 |
+
anno::in_group("Normal")
|
| 380 |
+
]],
|
| 381 |
+
|
| 382 |
+
float3 normal_input = state::normal(),
|
| 383 |
+
uniform texture_2d normalmap_texture = texture_2d()
|
| 384 |
+
[[
|
| 385 |
+
anno::display_name("Normal Map"),
|
| 386 |
+
anno::in_group("Normal")
|
| 387 |
+
]],
|
| 388 |
+
uniform bool flip_tangent_u = false
|
| 389 |
+
[[
|
| 390 |
+
anno::display_name("Normal Map Flip U Tangent"),
|
| 391 |
+
anno::description("Flips the U Tangent vector."),
|
| 392 |
+
anno::in_group("Normal")
|
| 393 |
+
]],
|
| 394 |
+
uniform bool flip_tangent_v = true
|
| 395 |
+
[[
|
| 396 |
+
anno::display_name("Normal Map Flip V Tangent"),
|
| 397 |
+
anno::description("Flips the V Tangent vector. By Default, SimPBR materials setup for DirectX normal maps. Set Normal Map Flip V = false for OpenGL."),
|
| 398 |
+
anno::in_group("Normal")
|
| 399 |
+
]],
|
| 400 |
+
|
| 401 |
+
// -------------------- UV ADJUSTMENTS ----------------------
|
| 402 |
+
uniform bool project_uvw = false
|
| 403 |
+
[[
|
| 404 |
+
anno::display_name("Enable Project UVW Coordinates"),
|
| 405 |
+
anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
|
| 406 |
+
anno::in_group("UV")
|
| 407 |
+
]],
|
| 408 |
+
uniform bool world_or_object = false
|
| 409 |
+
[[
|
| 410 |
+
anno::enable_if("project_uvw == true"),
|
| 411 |
+
anno::display_name("Enable World Space"),
|
| 412 |
+
anno::description("When set to 'true' uses world space for projection, when 'false' object space is used"),
|
| 413 |
+
anno::in_group("UV")
|
| 414 |
+
]],
|
| 415 |
+
uniform float2 texture_translate = float2(0.0f)
|
| 416 |
+
[[
|
| 417 |
+
anno::display_name("Texture Translate"),
|
| 418 |
+
anno::description("Controls position of texture."),
|
| 419 |
+
anno::in_group("UV")
|
| 420 |
+
]],
|
| 421 |
+
uniform float2 texture_scale = float2(1.0f)
|
| 422 |
+
[[
|
| 423 |
+
anno::display_name("Texture Tiling"),
|
| 424 |
+
anno::description("Controls repetition of the texture."),
|
| 425 |
+
anno::in_group("UV")
|
| 426 |
+
]],
|
| 427 |
+
uniform float2 texture_speed = float2(0.0f)
|
| 428 |
+
[[
|
| 429 |
+
anno::display_name("Texture Speed"),
|
| 430 |
+
anno::description("Scrolling texture animation speed in UVs per sec."),
|
| 431 |
+
anno::in_group("UV")
|
| 432 |
+
]]
|
| 433 |
+
)
|
| 434 |
+
[[
|
| 435 |
+
anno::display_name("Sim PBR"),
|
| 436 |
+
anno::description("Supports the opaque alpha cutout material model of the Sim Renderer"),
|
| 437 |
+
anno::in_group("SimReady"),
|
| 438 |
+
anno::version( 1, 0, 0),
|
| 439 |
+
anno::author("NVIDIA CORPORATION"),
|
| 440 |
+
anno::key_words(string[]("Sim", "PBR", "opaque", "alpha", "cutout", "omniverse", "generic"))
|
| 441 |
+
]]
|
| 442 |
+
= let {
|
| 443 |
+
base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
|
| 444 |
+
|
| 445 |
+
base::texture_coordinate_info uvw = project_uvw ?
|
| 446 |
+
base::coordinate_projection(
|
| 447 |
+
coordinate_system: the_system,
|
| 448 |
+
texture_space: 0,
|
| 449 |
+
projection_type: base::projection_cubic
|
| 450 |
+
) : base::coordinate_source(
|
| 451 |
+
coordinate_system: base::texture_coordinate_uvw,
|
| 452 |
+
texture_space: 0
|
| 453 |
+
);
|
| 454 |
+
|
| 455 |
+
// Need to use a small value so the compiler doesnt optimize out this var...
|
| 456 |
+
float t = 0.00000001;//state::animation_time();
|
| 457 |
+
base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
|
| 458 |
+
transform: base::rotation_translation_scale(
|
| 459 |
+
scaling: float3(texture_scale.x, texture_scale.y, 1.0),
|
| 460 |
+
rotation: float3(0.0, 0.0, 0.0 ),
|
| 461 |
+
translation: float3(texture_translate.x + t * texture_speed.x, texture_translate.y + t * texture_speed.y, 0.0)),
|
| 462 |
+
coordinate: uvw
|
| 463 |
+
);
|
| 464 |
+
float2 uv = float2(transformed_uvw.position.x, transformed_uvw.position.y);
|
| 465 |
+
|
| 466 |
+
// Diffuse Color Lookup and AO
|
| 467 |
+
float4 base_lookup = tex::texture_isvalid(diffuse_texture) ? tex::lookup_float4(tex: diffuse_texture, coord: uv) : float4(1, 1, 1, 1);
|
| 468 |
+
|
| 469 |
+
float opacityValue = tex::texture_isvalid(opacity_texture) ? tex::lookup_float4(tex: opacity_texture, coord: uv).w : alpha_constant;
|
| 470 |
+
|
| 471 |
+
// Normal calculations
|
| 472 |
+
float3 normal_lookup = tex::texture_isvalid(normalmap_texture) ?
|
| 473 |
+
base::tangent_space_normal_texture(
|
| 474 |
+
texture: normalmap_texture,
|
| 475 |
+
factor: bump_factor,
|
| 476 |
+
uvw: transformed_uvw,
|
| 477 |
+
flip_tangent_u: flip_tangent_u,
|
| 478 |
+
flip_tangent_v: flip_tangent_v
|
| 479 |
+
) : normal_input;
|
| 480 |
+
|
| 481 |
+
float3 clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ?
|
| 482 |
+
base::tangent_space_normal_texture(
|
| 483 |
+
texture: clearcoat_normalmap_texture,
|
| 484 |
+
factor: clearcoat_bump_factor,
|
| 485 |
+
uvw: uvw,
|
| 486 |
+
flip_tangent_u: clearcoat_flip_tangent_u,
|
| 487 |
+
flip_tangent_v: clearcoat_flip_tangent_v
|
| 488 |
+
) : clearcoat_normal_input;
|
| 489 |
+
|
| 490 |
+
float3 flattened_clearcoat_normal = ::math::lerp(normal_lookup, ::state::normal(), clearcoat_flatten);
|
| 491 |
+
float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? clearcoat_normal : flattened_clearcoat_normal;
|
| 492 |
+
|
| 493 |
+
float ao_lookup = tex::texture_isvalid(ao_texture) ? tex::lookup_float4(tex: ao_texture, coord: uv).x : ao_input;
|
| 494 |
+
|
| 495 |
+
color diffuse_color = tex::texture_isvalid(diffuse_texture) ? color(base_lookup.x, base_lookup.y, base_lookup.z) : diffuse_color_constant;
|
| 496 |
+
|
| 497 |
+
float3 ORM_lookup = tex::lookup_float3(
|
| 498 |
+
tex: ORM_texture,
|
| 499 |
+
coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
|
| 500 |
+
);
|
| 501 |
+
|
| 502 |
+
float roughness_lookup = tex::texture_isvalid(reflectionroughness_texture) ?
|
| 503 |
+
tex::lookup_float4(tex: reflectionroughness_texture, coord: uv).x : reflection_roughness_constant;
|
| 504 |
+
float anisotropy_lookup = tex::texture_isvalid(anisotropy_texture) ?
|
| 505 |
+
(tex::lookup_float4(tex: anisotropy_texture, coord: uv).x * 2.0f - 1.0f) : anisotropy_constant;
|
| 506 |
+
float metallic_lookup = tex::texture_isvalid(metallic_texture) ?
|
| 507 |
+
tex::lookup_float4(tex: metallic_texture, coord: uv).x : metallic_constant;
|
| 508 |
+
float specular_lookup = tex::texture_isvalid(specular_texture) ?
|
| 509 |
+
tex::lookup_float4(tex: specular_texture, coord: uv).x : specular_constant;
|
| 510 |
+
|
| 511 |
+
float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup;
|
| 512 |
+
float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup;
|
| 513 |
+
float ao = enable_ORM_texture ? ORM_lookup.x : ao_lookup;
|
| 514 |
+
|
| 515 |
+
float reflection_roughness = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
|
| 516 |
+
float anisotropy = math::lerp(anisotropy_constant, anisotropy_lookup, anisotropy_texture_influence);
|
| 517 |
+
float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
|
| 518 |
+
|
| 519 |
+
int rows = flipbook_dim.x;
|
| 520 |
+
int columns = flipbook_dim.y;
|
| 521 |
+
int numFrames = rows * columns;
|
| 522 |
+
varying int frameIdx = int(state::animation_time() * target_fps) % numFrames;
|
| 523 |
+
varying float2 baseUV = float2(transformed_uvw.position.x, transformed_uvw.position.y);
|
| 524 |
+
varying float2 emissiveUV = enable_emissive_flipbook ?
|
| 525 |
+
((baseUV + float2(frameIdx % rows, frameIdx / rows)) / float2(rows, columns)) : baseUV;
|
| 526 |
+
|
| 527 |
+
color emissive_mask = tex::texture_isvalid(emissive_mask_texture) ?
|
| 528 |
+
tex::lookup_color(emissive_mask_texture, emissiveUV, tex::wrap_repeat, tex::wrap_repeat) : emissive_mask_input;
|
| 529 |
+
|
| 530 |
+
} in SimPBR_Model(
|
| 531 |
+
diffuse_color: diffuse_color,
|
| 532 |
+
diffuse_tint: diffuse_tint,
|
| 533 |
+
roughness: reflection_roughness,
|
| 534 |
+
anisotropy: anisotropy,
|
| 535 |
+
metallic: metallic,
|
| 536 |
+
specular: specular_lookup,
|
| 537 |
+
normal: normal_lookup,
|
| 538 |
+
enable_clearcoat: enable_clearcoat,
|
| 539 |
+
clearcoat_tint: clearcoat_tint,
|
| 540 |
+
clearcoat_transparency: clearcoat_transparency,
|
| 541 |
+
clearcoat_reflection_roughness: clearcoat_reflection_roughness,
|
| 542 |
+
clearcoat_weight: clearcoat_weight,
|
| 543 |
+
clearcoat_ior: clearcoat_ior,
|
| 544 |
+
clearcoat_normal: final_clearcoat_normal,
|
| 545 |
+
enable_retroreflection: enable_retroreflection,
|
| 546 |
+
retroreflection_tint: retroreflection_tint,
|
| 547 |
+
normal_reflectivity: normal_reflectivity,
|
| 548 |
+
grazing_reflectivity: grazing_reflectivity,
|
| 549 |
+
ao_to_diffuse: ao_to_diffuse,
|
| 550 |
+
ao: ao,
|
| 551 |
+
enable_emission: enable_emission,
|
| 552 |
+
emissive_color: emissive_color,
|
| 553 |
+
emissive_mask: emissive_mask,
|
| 554 |
+
emissive_intensity: emissive_intensity,
|
| 555 |
+
enable_opacity: enable_opacity,
|
| 556 |
+
alpha: opacityValue,
|
| 557 |
+
enable_opacity_cutout: enable_opacity_cutout,
|
| 558 |
+
alpha_cutout_cutoff: alpha_cutout_cutoff,
|
| 559 |
+
opacity_ratio: enable_transmission ? opacity_ratio : 1.0,
|
| 560 |
+
opacity_tint : opacity_tint,
|
| 561 |
+
opacity_multipl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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*****************************************************************************
|
| 2 |
+
* Copyright 1986-2020 NVIDIA Corporation. All rights reserved.
|
| 3 |
+
******************************************************************************
|
| 4 |
+
|
| 5 |
+
MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,
|
| 6 |
+
WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,
|
| 7 |
+
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
| 8 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
| 9 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
| 10 |
+
COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA
|
| 11 |
+
CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
|
| 12 |
+
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
|
| 13 |
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
| 14 |
+
THE USE OR INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN
|
| 15 |
+
THE MDL MATERIALS.
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
mdl 1.4;
|
| 19 |
+
|
| 20 |
+
import ::df::*;
|
| 21 |
+
import ::state::*;
|
| 22 |
+
import ::math::*;
|
| 23 |
+
import ::base::*;
|
| 24 |
+
import ::tex::*;
|
| 25 |
+
import ::anno::*;
|
| 26 |
+
|
| 27 |
+
using baking_annotations import *;
|
| 28 |
+
|
| 29 |
+
base::texture_return multiply_colors(
|
| 30 |
+
color color_1 = color(1.0, 1.0, 1.0),
|
| 31 |
+
color color_2 = color(.5, .5, .5),
|
| 32 |
+
float weight = 1.0
|
| 33 |
+
)
|
| 34 |
+
[[
|
| 35 |
+
anno::hidden()
|
| 36 |
+
]]
|
| 37 |
+
{
|
| 38 |
+
return base::blend_color_layers(
|
| 39 |
+
layers: base::color_layer[](
|
| 40 |
+
base::color_layer(
|
| 41 |
+
layer_color: color_2,
|
| 42 |
+
weight: weight,
|
| 43 |
+
mode: base::color_layer_multiply
|
| 44 |
+
)
|
| 45 |
+
), base: color_1
|
| 46 |
+
);
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
export material SimPBR_Model(
|
| 50 |
+
color diffuse_color = color(0.2f) [[ target_baked_argument("diffuse_texture", "diffuse_color_constant", "RGBA8_UNORM") ]],
|
| 51 |
+
uniform color diffuse_tint = color(1.0f),
|
| 52 |
+
float roughness = 0.5f [[ target_baked_argument("reflectionroughness_texture", "reflection_roughness_constant", "R8_UNORM") ]],
|
| 53 |
+
float anisotropy = 0.0f [[ target_baked_argument("anisotropy_texture", "anisotropy_constant", "R8_SNORM") ]],
|
| 54 |
+
float metallic = 0.f [[ target_baked_argument("metallic_texture", "metallic_constant", "R8_UNORM") ]],
|
| 55 |
+
float specular = 1.f [[ target_baked_argument("specular_texture", "specular_constant", "R8_UNORM") ]],
|
| 56 |
+
float3 normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("normalmap_texture", "normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
|
| 57 |
+
uniform bool enable_clearcoat = false,
|
| 58 |
+
color clearcoat_tint = color(1.0f),
|
| 59 |
+
float clearcoat_transparency = 1.0f,
|
| 60 |
+
float clearcoat_reflection_roughness = 0.0f,
|
| 61 |
+
float clearcoat_weight = 1.0f,
|
| 62 |
+
float clearcoat_ior = 1.56f,
|
| 63 |
+
float3 clearcoat_normal = float3(0.0, 0.0, 0.0) [[ target_baked_argument("clearcoat_normalmap_texture", "clearcoat_normal_input", "RGBA8_SNORM", baking_annotations::TRANSFORM_UNORM_VECTOR) ]],
|
| 64 |
+
uniform bool enable_retroreflection = false,
|
| 65 |
+
color retroreflection_tint = color(.182,.800,.000),
|
| 66 |
+
uniform float normal_reflectivity = 0.5,
|
| 67 |
+
uniform float grazing_reflectivity = 1.0,
|
| 68 |
+
float ao_to_diffuse = 0.0,
|
| 69 |
+
float ao = 1.0f [[ target_baked_argument("ao_texture", "ao_input", "R8_UNORM") ]],
|
| 70 |
+
uniform bool enable_emission = false,
|
| 71 |
+
uniform color emissive_color = color(1.0, 0.1, 0.1),
|
| 72 |
+
color emissive_mask = color(1.0, 0.1, 0.1) [[ target_baked_argument("emissive_mask_texture", "emissive_mask_input", "R8_UNORM") ]],
|
| 73 |
+
uniform float emissive_intensity = 40.f,
|
| 74 |
+
uniform bool enable_opacity = false,
|
| 75 |
+
float alpha = 1.0,
|
| 76 |
+
uniform bool enable_opacity_cutout = false,
|
| 77 |
+
uniform float alpha_cutout_cutoff = 1.f,
|
| 78 |
+
uniform float opacity_ratio = 1.f,
|
| 79 |
+
uniform color opacity_tint = color(1.0f),
|
| 80 |
+
uniform float opacity_multiplier = 1.f
|
| 81 |
+
)
|
| 82 |
+
[[
|
| 83 |
+
target_material_model(),
|
| 84 |
+
target_material_rendering("..::SimPBR::SimPBR")
|
| 85 |
+
]]
|
| 86 |
+
= let {
|
| 87 |
+
color base_color = multiply_colors(diffuse_color, diffuse_tint, 1.0).tint;
|
| 88 |
+
color ao_weighted_base_color = multiply_colors(base_color, color(ao), ao_to_diffuse).tint;
|
| 89 |
+
|
| 90 |
+
float squared_roughness = roughness * roughness;
|
| 91 |
+
float roughness_u = squared_roughness * (1 + anisotropy);
|
| 92 |
+
float roughness_v = squared_roughness * (1 - anisotropy);
|
| 93 |
+
|
| 94 |
+
color diffuse_transmission_color = base_color * opacity_tint * opacity_multiplier;
|
| 95 |
+
|
| 96 |
+
bsdf diffuse_bsdf = df::weighted_layer(
|
| 97 |
+
weight: opacity_ratio,
|
| 98 |
+
layer: df::diffuse_reflection_bsdf(
|
| 99 |
+
tint: ao_weighted_base_color,
|
| 100 |
+
roughness: 0.0f
|
| 101 |
+
),
|
| 102 |
+
base: df::diffuse_transmission_bsdf(tint: diffuse_transmission_color),
|
| 103 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 104 |
+
);
|
| 105 |
+
|
| 106 |
+
bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
|
| 107 |
+
roughness_u: roughness_u,
|
| 108 |
+
roughness_v: roughness_v,
|
| 109 |
+
tint: color(1.0, 1.0, 1.0),
|
| 110 |
+
mode: df::scatter_reflect
|
| 111 |
+
);
|
| 112 |
+
|
| 113 |
+
bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
|
| 114 |
+
normal_reflectivity: 0.03,
|
| 115 |
+
grazing_reflectivity: 1.0,
|
| 116 |
+
exponent: 5.0,
|
| 117 |
+
weight: specular,
|
| 118 |
+
layer: ggx_smith_bsdf,
|
| 119 |
+
base: diffuse_bsdf,
|
| 120 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 121 |
+
);
|
| 122 |
+
|
| 123 |
+
//
|
| 124 |
+
// Begin RETROREFLECTION SUPPORT
|
| 125 |
+
//
|
| 126 |
+
color final_retroreflection_color = multiply_colors(retroreflection_tint, base_color, 1.0).tint;
|
| 127 |
+
bsdf backscattering_glossy_bsdf = df::backscattering_glossy_reflection_bsdf(
|
| 128 |
+
tint: final_retroreflection_color,
|
| 129 |
+
roughness_u: squared_roughness
|
| 130 |
+
);
|
| 131 |
+
|
| 132 |
+
/*bsdf retroreflection_bsdf = df::custom_curve_layer(
|
| 133 |
+
normal_reflectivity: 1.-normal_reflectivity,
|
| 134 |
+
grazing_reflectivity: 1.-grazing_reflectivity,
|
| 135 |
+
base: backscattering_glossy_bsdf,
|
| 136 |
+
layer: custom_curve_layer_bsdf,
|
| 137 |
+
normal: enable_clearcoat ? normal_lookup : state::normal()
|
| 138 |
+
);*/
|
| 139 |
+
|
| 140 |
+
// if normal_reflectivity and grazing_reflectivity are 1 and weight is 1, just the layer is used
|
| 141 |
+
bsdf opt_retroreflection_bsdf = df::custom_curve_layer(
|
| 142 |
+
normal_reflectivity: enable_retroreflection ? 1.-normal_reflectivity : 1,
|
| 143 |
+
grazing_reflectivity: enable_retroreflection ? 1.-grazing_reflectivity : 1,
|
| 144 |
+
base: backscattering_glossy_bsdf,
|
| 145 |
+
layer: custom_curve_layer_bsdf,
|
| 146 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 147 |
+
);
|
| 148 |
+
|
| 149 |
+
//
|
| 150 |
+
// End RETROREFLECTION SUPPORT
|
| 151 |
+
//
|
| 152 |
+
|
| 153 |
+
bsdf directional_factor_bsdf = df::directional_factor(
|
| 154 |
+
normal_tint: ao_weighted_base_color,
|
| 155 |
+
grazing_tint: color(1.0, 1.0, 1.0),
|
| 156 |
+
exponent: 5.0f,
|
| 157 |
+
base: ggx_smith_bsdf
|
| 158 |
+
);
|
| 159 |
+
|
| 160 |
+
// CLEARCOAT
|
| 161 |
+
bsdf omni_PBR_bsdf = df::weighted_layer(
|
| 162 |
+
weight: metallic,
|
| 163 |
+
layer: directional_factor_bsdf,
|
| 164 |
+
base: opt_retroreflection_bsdf, //enable_retroreflection ? retroreflection_bsdf : custom_curve_layer_bsdf,
|
| 165 |
+
normal: enable_clearcoat ? normal : state::normal()
|
| 166 |
+
);
|
| 167 |
+
|
| 168 |
+
bsdf clearcoat_bsdf = df::microfacet_ggx_smith_bsdf(
|
| 169 |
+
roughness_u: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
|
| 170 |
+
roughness_v: clearcoat_reflection_roughness * clearcoat_reflection_roughness,
|
| 171 |
+
tint: color(1.0f),
|
| 172 |
+
mode: df::scatter_reflect
|
| 173 |
+
);
|
| 174 |
+
|
| 175 |
+
// bsdf omni_PBR_coated_bsdf = df::custom_curve_layer(
|
| 176 |
+
// normal_reflectivity: clearcoat_reflectivity * 0.08,
|
| 177 |
+
// grazing_reflectivity: 1.0,
|
| 178 |
+
// weight: clearcoat_weight,
|
| 179 |
+
// layer: clearcoat_bsdf,
|
| 180 |
+
// base: omni_PBR_bsdf,
|
| 181 |
+
// normal: final_clearcoat_normal
|
| 182 |
+
// );
|
| 183 |
+
|
| 184 |
+
bsdf opt_opaque_clearcoat = df::weighted_layer(
|
| 185 |
+
weight: enable_clearcoat ? clearcoat_transparency : 1,
|
| 186 |
+
layer: ::df::tint(tint: enable_clearcoat ? clearcoat_tint : color(1), base: omni_PBR_bsdf),
|
| 187 |
+
base: ::df::diffuse_reflection_bsdf(tint: clearcoat_tint)
|
| 188 |
+
);
|
| 189 |
+
|
| 190 |
+
bsdf opt_omni_PBR_coated_bsdf = df::fresnel_layer(
|
| 191 |
+
ior: clearcoat_ior,
|
| 192 |
+
weight: enable_clearcoat ? clearcoat_weight : 0,
|
| 193 |
+
layer: clearcoat_bsdf,
|
| 194 |
+
base: opt_opaque_clearcoat,
|
| 195 |
+
normal: clearcoat_normal
|
| 196 |
+
);
|
| 197 |
+
|
| 198 |
+
bsdf final_bsdf = opt_omni_PBR_coated_bsdf;
|
| 199 |
+
} in material(
|
| 200 |
+
thin_walled: false,
|
| 201 |
+
surface: material_surface(
|
| 202 |
+
scattering: final_bsdf,
|
| 203 |
+
emission: material_emission(
|
| 204 |
+
df::diffuse_edf(),
|
| 205 |
+
intensity: enable_emission ? emissive_color * emissive_mask * color(emissive_intensity) : color(0)
|
| 206 |
+
)
|
| 207 |
+
),
|
| 208 |
+
geometry: material_geometry(
|
| 209 |
+
normal: enable_clearcoat ? state::normal() : normal,
|
| 210 |
+
cutout_opacity: enable_opacity ? (enable_opacity_cutout ? (alpha < alpha_cutout_cutoff ? 0.0 : 1.0) : alpha) : 1.0
|
| 211 |
+
)
|
| 212 |
+
);
|
objects/orange_02/materials/robolab/objects/fruits_veggies/materials/baking_annotations.mdl
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
mdl 1.4;
|
| 2 |
+
import ::anno::*;
|
| 3 |
+
|
| 4 |
+
export const string TRANSFORM_NONE = "NONE";
|
| 5 |
+
export const string TRANSFORM_UNORM_VECTOR = "UNORM_VECTOR";
|
| 6 |
+
|
| 7 |
+
export const string FORMAT_RGBA8_UNORM = "RGBA8_UNORM";
|
| 8 |
+
export const string FORMAT_R8_UNORM = "R8_UNORM";
|
| 9 |
+
export const string FORMAT_RGBA16_SFLOAT = "RGBA16_SFLOAT";
|
| 10 |
+
|
| 11 |
+
export const string BLEND_MODE_OPACITY = "opacity_blend";
|
| 12 |
+
export const string BLEND_MODE_REPLACE = "replace";
|
| 13 |
+
|
| 14 |
+
// This annotation is used to mark a material as target material for baking.
|
| 15 |
+
// It is that is detected by the MDL SDK and neuray.
|
| 16 |
+
export annotation target_material_model();
|
| 17 |
+
|
| 18 |
+
export annotation target_material_rendering(
|
| 19 |
+
string rendering_material_override = "" // if set, the baked material will be rendering using this material,
|
| 20 |
+
// otherwise the target itself is used
|
| 21 |
+
);
|
| 22 |
+
|
| 23 |
+
export annotation target_baked_argument(
|
| 24 |
+
// the name of the baked texture parameter in the rendering material
|
| 25 |
+
string baked_name,
|
| 26 |
+
|
| 27 |
+
// the name of the constant parameter in the rendering material in case baking was not necessary
|
| 28 |
+
string constant_name = "",
|
| 29 |
+
|
| 30 |
+
// texture format to bake to
|
| 31 |
+
string format = "",
|
| 32 |
+
|
| 33 |
+
// transformations, like encoding normals into [0,1] range
|
| 34 |
+
string transform = TRANSFORM_NONE,
|
| 35 |
+
|
| 36 |
+
// blending, e.g., based on alpha or replace
|
| 37 |
+
string blend_mode = BLEND_MODE_OPACITY
|
| 38 |
+
);
|