Upload EXLS1 2026.09.25_01
Browse filesFiles changed (27)
- .gitattributes+3
- EXLS1/.metadata/com.nvidia.simready.root_usds.jsonAdded+6
- EXLS1/com.nvidia.simready.packaging.jsonAdded+6
- EXLS1/simready_usd/.thumbs/256x256/EXLS1_main.usd.pngAdded
- EXLS1/simready_usd/EXLS1_main.usdAdded+3
- EXLS1/simready_usd/layers/.thumbs/256x256/EXLS1_ConnectionPoints.usd.pngAdded
- EXLS1/simready_usd/layers/.thumbs/256x256/EXLS1_Properties.usda.pngAdded
- EXLS1/simready_usd/layers/EXLS1_ConnectionPoints.usdAdded
- EXLS1/simready_usd/layers/EXLS1_Properties.jsonAdded+278
- EXLS1/simready_usd/layers/EXLS1_Properties.usdaAdded+539
- EXLS1/simready_usd/layers/apply_metadata.pyAdded+356
- EXLS1/simready_usd/layers/excel_to_json.pyAdded+229
- EXLS1/simready_usd/layers/properties.xlsxAdded
- EXLS1/simready_usd/materials/OmniPBR/OmniPBR.mdlAdded+419
- EXLS1/simready_usd/materials/OmniPBR/OmniPBRBase.mdlAdded+493
- EXLS1/simready_usd/materials/OmniPBR/OmniPBR_ClearCoat.mdlAdded+734
- EXLS1/simready_usd/materials/Polycarbonate_Opaque.mdlAdded+1031
- EXLS1/simready_usd/materials/Polypropylene_Opaque.mdlAdded+1049
- EXLS1/simready_usd/materials/Semi_Aniline_Leather.mdlAdded+718
- EXLS1/simready_usd/materials/Stainless_Steel.mdlAdded+1543
- EXLS1/simready_usd/materials/Stainless_Steel_Brushed.mdlAdded
- EXLS1/simready_usd/materials/WhiteMode.mdlAdded+31
- EXLS1/simready_usd/payloads/.thumbs/256x256/external.usd.pngAdded
- EXLS1/simready_usd/payloads/.thumbs/256x256/internal.usd.pngAdded
- EXLS1/simready_usd/payloads/external.usdAdded+3
- EXLS1/simready_usd/payloads/internal.usdAdded+3
- EXLS1/simready_usd/textures/image screen.pngAdded
86 unmodified lines87888986 unmodified linesCW181DCHA1SAEX/simready_usd/payloads/internal.usd filter=lfs diff=lfs merge=lfs -textCW415H1TA1S9BT/simready_usd/payloads/external.usd filter=lfs diff=lfs merge=lfs -textCW415H1TA1S9BT/simready_usd/payloads/internal.usd filter=lfs diff=lfs merge=lfs -text86 unmodified lines87888990919286 unmodified linesCW181DCHA1SAEX/simready_usd/payloads/internal.usd filter=lfs diff=lfs merge=lfs -textCW415H1TA1S9BT/simready_usd/payloads/external.usd filter=lfs diff=lfs merge=lfs -textCW415H1TA1S9BT/simready_usd/payloads/internal.usd filter=lfs diff=lfs merge=lfs -textEXLS1/simready_usd/EXLS1_main.usd filter=lfs diff=lfs merge=lfs -textEXLS1/simready_usd/payloads/external.usd filter=lfs diff=lfs merge=lfs -textEXLS1/simready_usd/payloads/internal.usd filter=lfs diff=lfs merge=lfs -text
123456{ "format_version": "1.0", "entries": [ "simready_usd/EXLS1_main.usd" ]}123456{
"format_version": "1.0",
"package_id": "simready.hf.Vertiv.simready-assets.EXLS1.2026.09.25_01",
"license": "cc-by-4.0",
"metadata": []
}123version https://git-lfs.github.com/spec/v1oid sha256:932abf691def7632a26ba363a6cf7d3d9657f4f1534ac4c4d51e55a73f06dee4size 8514765123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278{
"properties": {
"aif:spec": {
"type": "string",
"value": "",
"description": ""
},
"aif:spec:upsRating": {
"type": "int",
"value": 1200,
"description": "UPS Rating in KW"
},
"aif:spec:outputActivePower": {
"type": "int",
"value": 1200,
"description": "Output Active Power at 104degF (kW)"
},
"aif:spec:electricalInputVoltage": {
"type": "int",
"value": 480,
"description": "Electrical Nominal Voltage in V"
},
"aif:spec:electricalCurrent": {
"type": "string",
"value": "",
"description": "Electrical Current"
},
"aif:spec:inputCurrentDistortion": {
"type": "string",
"value": "",
"description": "Input Current Distortion (THDi) at Nominal Voltage at Full Load"
},
"aif:spec:electricalInputFrequency": {
"type": "int",
"value": 60,
"description": "Electrical Input Frequency in HZ"
},
"aif:spec:electricalInputPhase": {
"type": "int",
"value": 3,
"description": "Electrical Input Phase"
},
"aif:spec:inputPowerFactor": {
"type": "float",
"value": 0.99,
"description": "Electrical Power Factor"
},
"aif:spec:electricalPowerWalkIn": {
"type": "string",
"value": "",
"description": "Power Walk-in (seconds)"
},
"aif:spec:batteryType": {
"type": "string",
"value": "Lithium ion, VRLA",
"description": "Battery Type"
},
"aif:spec:batteryFloatVoltage": {
"type": "int",
"value": 540,
"description": "Battery Float Voltage"
},
"aif:spec:dcRippleVoltage": {
"type": "string",
"value": "",
"description": "DC Ripple at Float Voltage"
},
"aif:spec:nominalBatteryBus": {
"type": "string",
"value": "480 V",
"description": "Nominal Battery Bus"
},
"aif:spec:temperatureCompensatedBatteryCharging": {
"type": "string",
"value": "",
"description": "Temperature Compensated Battery Charging"
},
"aif:spec:loadPowerFactor": {
"type": "string",
"value": "",
"description": "Load Power Factor Supported (Without Derating)"
},
"aif:spec:outputVoltage": {
"type": "int",
"value": 480,
"description": "Output Voltage"
},
"aif:spec:electricalOutputFrequency": {
"type": "int",
"value": 60,
"description": "Electrical Output Frequency in HZ"
},
"aif:spec:electricalOutputPhase": {
"type": "int",
"value": 3,
"description": "Electrical Output Phase"
},
"aif:spec:outputThdNominalVoltage": {
"type": "float",
"value": 1.5,
"description": "Output THD at Nominal Voltage at RMS value"
},
"aif:spec:outputThdNominalVoltageWithNonLinearLoad": {
"type": "int",
"value": 5,
"description": "Output THD at Nominal Voltage including a 100kVA Non Linear Load per IEC 6204 at RMS value"
},
"aif:spec:transientRecoveryLoad": {
"type": "float",
"value": 0.04,
"description": "Transient Recovery 100 Load Step"
},
"aif:spec:voltageDisplacement": {
"type": "int",
"value": 120,
"description": "Voltage Displacement"
},
"aif:spec:overloadAtNominalVoltage": {
"type": "int",
"value": 110,
"description": "Overload at Nominal Voltage and 77degF (25degC)"
},
"aif:spec:upsEnclosureClass": {
"type": "string",
"value": "IP 20",
"description": "UPS Enclosure Class with and without front door open"
},
"aif:spec:color": {
"type": "string",
"value": "Black, RAL 7021",
"description": "Color"
},
"aif:spec:operatingTemperature": {
"type": "float",
"value": 273.15,
"description": "Operating Temperature in degC"
},
"aif:spec:relativeHumidity": {
"type": "string",
"value": "",
"description": "Relative Humidity non-condensing"
},
"aif:spec:operatingAltitude": {
"type": "float",
"value": 1005.84,
"description": "Operating Altitude without derating"
},
"aif:spec:communicationOptions": {
"type": "string",
"value": "",
"description": "Communication Options"
},
"aif:spec:cardCompatibility": {
"type": "string",
"value": "IS-UNITY-DP, IS-485EXI",
"description": "Card Compatibility"
},
"aif:spec:protocolsAvailable": {
"type": "string",
"value": "MODBUS-IP, MODBUS-485, BACNET-IP, BACNET-MSTP, SNMP, HTTP, LIFE Services",
"description": "Protocols Available"
},
"aif:core": {
"type": "string",
"value": "",
"description": ""
},
"aif:core:manufacturer": {
"type": "string",
"value": "Vertiv",
"description": "Equipment manufacturer name"
},
"aif:core:modelNumber": {
"type": "string",
"value": "Liebert EXL S1 1200 kW",
"description": "Equipment model number [AIF-MANAGED]"
},
"aif:core:overallGeometryDimensions": {
"type": "vector3f",
"value": [
2654.0,
914.0,
2009.0
],
"description": "Overall Geometry (WxDxH) (metric)"
},
"aif:core:weight": {
"type": "int",
"value": 2117,
"description": "Equipment weight in kilograms"
},
"aif:core:height": {
"type": "int",
"value": 2009,
"description": "Equipment height in mm"
},
"aif:core:width": {
"type": "int",
"value": 2654,
"description": "Equipment width in mm"
},
"aif:core:depth": {
"type": "int",
"value": 914,
"description": "Equipment depth in mm"
},
"aif:core:installationClearance": {
"type": "int",
"value": 2000,
"description": "Installation Clearance in mm"
},
"aif:core:accessibilityRequirement": {
"type": "int",
"value": 1500,
"description": "Service clearance in mm"
},
"aif:core:assetVersion": {
"type": "float",
"value": 0.1,
"description": "Design Revision of Digital Twin Asset"
},
"aif:core:assetClass": {
"type": "string",
"value": "UPS",
"description": "Class of AI Factory Equipment"
},
"aif:core:sceneOptimizerVersion": {
"type": "string",
"value": "get_scene_optimizer_id()",
"description": "Scene Optimizer version"
},
"aif:core:assetValidatorVersion": {
"type": "string",
"value": "get_asset_validator_id()",
"description": "Asset Validator version"
},
"aif:core:assetDescription": {
"type": "string",
"value": "Vertiv Liebert EXL S1 1200 kW monolithic uninterruptible power supply.",
"description": "Human Readable Description of Asset [AIF-MANAGED]"
},
"aif:core:connectsToModelDocumentation": {
"type": "string",
"value": "https://www.vertiv.com/en-in/products-catalog/critical-power/uninterruptible-power-supplies-ups/liebert-exl-s1-1000-1200kvakw/",
"description": "Url to online documentation"
},
"aif:core:assetCreationDate": {
"type": "string",
"value": "8/26/2026",
"description": "Creation Date of Revision of Asset ISO 8601 format (YYYY-MM-DD)"
},
"aif:core:simreadyVersion": {
"type": "float",
"value": 0.1,
"description": "SimReady version"
},
"aif:core:geometrympv": {
"type": "string",
"value": "",
"description": "Geometry_MPV"
},
"aif:core:aifthermal": {
"type": "string",
"value": "",
"description": "AIF_Thermal"
},
"aif:core:aifelectrical": {
"type": "string",
"value": "",
"description": "AIF_Electrical"
}
},
"metadata": {
"description": "AIF properties for USD equipment models",
"version": "1.0",
"created": "2025-12-02"
}
}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539#usda 1.0( defaultPrim = "EXLS1")
over "EXLS1"{ custom string aif:core = "" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "[AIF-MANAGED]" ) custom int aif:core:accessibilityRequirement = 1500 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Service clearance in mm [AIF-MANAGED]" ) custom string aif:core:aifelectrical = "" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "AIF_Electrical [AIF-MANAGED]" ) custom string aif:core:aifthermal = "" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "AIF_Thermal [AIF-MANAGED]" ) custom string aif:core:assetClass = "UPS" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Class of AI Factory Equipment [AIF-MANAGED]" ) custom string aif:core:assetCreationDate = "8/26/2026" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Creation Date of Revision of Asset ISO 8601 format (YYYY-MM-DD) [AIF-MANAGED]" ) custom string aif:core:assetDescription = "Vertiv Liebert EXL S1 1200 kW monolithic uninterruptible power supply." ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Human Readable Description of Asset [AIF-MANAGED]" ) custom string aif:core:assetValidatorVersion = "get_asset_validator_id()" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Asset Validator version [AIF-MANAGED]" ) custom float aif:core:assetVersion = 0.1 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Design Revision of Digital Twin Asset [AIF-MANAGED]" ) custom string aif:core:connectsToModelDocumentation = "https://www.vertiv.com/en-in/products-catalog/critical-power/uninterruptible-power-supplies-ups/liebert-exl-s1-1000-1200kvakw/" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Url to online documentation [AIF-MANAGED]" ) custom int aif:core:depth = 914 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Equipment depth in mm [AIF-MANAGED]" ) custom string aif:core:geometrympv = "" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Geometry_MPV [AIF-MANAGED]" ) custom int aif:core:height = 2009 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Equipment height in mm [AIF-MANAGED]" ) custom int aif:core:installationClearance = 2000 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Installation Clearance in mm [AIF-MANAGED]" ) custom string aif:core:manufacturer = "Vertiv" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Equipment manufacturer name [AIF-MANAGED]" ) custom string aif:core:modelNumber = "Liebert EXL S1 1200 kW" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Equipment model number [AIF-MANAGED]" ) custom vector3f aif:core:overallGeometryDimensions = (2654, 914, 2009) ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Overall Geometry (WxDxH) (metric) [AIF-MANAGED]" ) custom string aif:core:sceneOptimizerVersion = "get_scene_optimizer_id()" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Scene Optimizer version [AIF-MANAGED]" ) custom float aif:core:simreadyVersion = 0.1 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "SimReady version [AIF-MANAGED]" ) custom int aif:core:weight = 2117 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Equipment weight in kilograms [AIF-MANAGED]" ) custom int aif:core:width = 2654 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Equipment width in mm [AIF-MANAGED]" ) custom string aif:spec = "" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "[AIF-MANAGED]" ) custom int aif:spec:batteryFloatVoltage = 540 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Battery Float Voltage [AIF-MANAGED]" ) custom string aif:spec:batteryType = "Lithium ion, VRLA" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Battery Type [AIF-MANAGED]" ) custom string aif:spec:cardCompatibility = "IS-UNITY-DP, IS-485EXI" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Card Compatibility [AIF-MANAGED]" ) custom string aif:spec:color = "Black, RAL 7021" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Color [AIF-MANAGED]" ) custom string aif:spec:communicationOptions = "" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Communication Options [AIF-MANAGED]" ) custom string aif:spec:dcRippleVoltage = "" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "DC Ripple at Float Voltage [AIF-MANAGED]" ) custom string aif:spec:electricalCurrent = "" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Electrical Current [AIF-MANAGED]" ) custom int aif:spec:electricalInputFrequency = 60 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Electrical Input Frequency in HZ [AIF-MANAGED]" ) custom int aif:spec:electricalInputPhase = 3 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Electrical Input Phase [AIF-MANAGED]" ) custom int aif:spec:electricalInputVoltage = 480 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Electrical Nominal Voltage in V [AIF-MANAGED]" ) custom int aif:spec:electricalOutputFrequency = 60 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Electrical Output Frequency in HZ [AIF-MANAGED]" ) custom int aif:spec:electricalOutputPhase = 3 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Electrical Output Phase [AIF-MANAGED]" ) custom string aif:spec:electricalPowerWalkIn = "" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Power Walk-in (seconds) [AIF-MANAGED]" ) custom string aif:spec:inputCurrentDistortion = "" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Input Current Distortion (THDi) at Nominal Voltage at Full Load [AIF-MANAGED]" ) custom float aif:spec:inputPowerFactor = 0.99 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Electrical Power Factor [AIF-MANAGED]" ) custom string aif:spec:loadPowerFactor = "" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Load Power Factor Supported (Without Derating) [AIF-MANAGED]" ) custom string aif:spec:nominalBatteryBus = "480 V" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Nominal Battery Bus [AIF-MANAGED]" ) custom float aif:spec:operatingAltitude = 1005.84 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Operating Altitude without derating [AIF-MANAGED]" ) custom float aif:spec:operatingTemperature = 273.15 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Operating Temperature in degC [AIF-MANAGED]" ) custom int aif:spec:outputActivePower = 1200 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Output Active Power at 104degF (kW) [AIF-MANAGED]" ) custom float aif:spec:outputThdNominalVoltage = 1.5 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Output THD at Nominal Voltage at RMS value [AIF-MANAGED]" ) custom int aif:spec:outputThdNominalVoltageWithNonLinearLoad = 5 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Output THD at Nominal Voltage including a 100kVA Non Linear Load per IEC 6204 at RMS value [AIF-MANAGED]" ) custom int aif:spec:outputVoltage = 480 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Output Voltage [AIF-MANAGED]" ) custom int aif:spec:overloadAtNominalVoltage = 110 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Overload at Nominal Voltage and 77degF (25degC) [AIF-MANAGED]" ) custom string aif:spec:protocolsAvailable = "MODBUS-IP, MODBUS-485, BACNET-IP, BACNET-MSTP, SNMP, HTTP, LIFE Services" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Protocols Available [AIF-MANAGED]" ) custom string aif:spec:relativeHumidity = "" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Relative Humidity non-condensing [AIF-MANAGED]" ) custom string aif:spec:temperatureCompensatedBatteryCharging = "" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Temperature Compensated Battery Charging [AIF-MANAGED]" ) custom float aif:spec:transientRecoveryLoad = 0.04 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Transient Recovery 100 Load Step [AIF-MANAGED]" ) custom string aif:spec:upsEnclosureClass = "IP 20" ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "UPS Enclosure Class with and without front door open [AIF-MANAGED]" ) custom int aif:spec:upsRating = 1200 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "UPS Rating in KW [AIF-MANAGED]" ) custom int aif:spec:voltageDisplacement = 120 ( customData = { dictionary omni = { dictionary kit = { bool locked = 1 } } } doc = "Voltage Displacement [AIF-MANAGED]" )}
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356"""Apply Metadata to USD=====================
Reads a metadata JSON file, validates it, and creates a USD properties layer.The layer is written to the specified output location as a .usda file.Properties are namespaced as aif:<type>:property_name (e.g., aif:core:Manufacturer).
Usage: python apply_metadata.py --input <metadata.json> --output <properties.usda> --default_prim <prim_name> python apply_metadata.py --input core.json --output core_props.usda --default_prim Root python apply_metadata.py --input electrical.json --output elec_props.usda --default_prim Root --namespace electrical"""
import jsonimport argparseimport osfrom pxr import Usd, Sdf, Vt, Gffrom typing import Optional
def validate_metadata_json(json_data): """ Validate the metadata JSON structure. Returns (is_valid, error_message) """ if not isinstance(json_data, dict): return False, "Root JSON must be an object/dictionary" if "properties" not in json_data: return False, "Missing required 'properties' key" properties = json_data["properties"] if not isinstance(properties, dict): return False, "'properties' must be an object/dictionary" # Validate each property for prop_name, prop_config in properties.items(): if not isinstance(prop_config, dict): return False, f"Property '{prop_name}' must be an object/dictionary" if "type" not in prop_config: return False, f"Property '{prop_name}' missing required 'type' field" if "value" not in prop_config: return False, f"Property '{prop_name}' missing required 'value' field" return True, None
def get_usd_type_from_string(type_str, value): """ Convert JSON type specs to USD's strongly-typed attribute system. """ # Basic type mapping basic_type_mapping = { "string": Sdf.ValueTypeNames.String, "float": Sdf.ValueTypeNames.Float, "double": Sdf.ValueTypeNames.Double, "int": Sdf.ValueTypeNames.Int, "bool": Sdf.ValueTypeNames.Bool, "vector3f": Sdf.ValueTypeNames.Vector3f, "vector3d": Sdf.ValueTypeNames.Vector3d, "color3f": Sdf.ValueTypeNames.Color3f, "token": Sdf.ValueTypeNames.Token, "asset": Sdf.ValueTypeNames.Asset, } # 2D Array type mapping array_type_mapping = { "float2d_array": Sdf.ValueTypeNames.Float2Array, "double2d_array": Sdf.ValueTypeNames.Double2Array, "int2d_array": Sdf.ValueTypeNames.Int2Array, "string2d_array": Sdf.ValueTypeNames.StringArray, "bool2d_array": Sdf.ValueTypeNames.BoolArray, "vector3f2d_array": Sdf.ValueTypeNames.Vector3fArray, "vector3d2d_array": Sdf.ValueTypeNames.Vector3dArray, "color3f2d_array": Sdf.ValueTypeNames.Color3fArray, "color3d2d_array": Sdf.ValueTypeNames.Color3dArray, "token2d_array": Sdf.ValueTypeNames.TokenArray, "asset2d_array": Sdf.ValueTypeNames.AssetArray } # Fallback mapping for types that don't exist as 2D arrays fallback_mapping = { "float2d_array": Sdf.ValueTypeNames.FloatArray, "double2d_array": Sdf.ValueTypeNames.DoubleArray, "int2d_array": Sdf.ValueTypeNames.IntArray, "string2d_array": Sdf.ValueTypeNames.StringArray, "bool2d_array": Sdf.ValueTypeNames.BoolArray, "vector3f2d_array": Sdf.ValueTypeNames.Vector3fArray, "vector3d2d_array": Sdf.ValueTypeNames.Vector3dArray, "color3f2d_array": Sdf.ValueTypeNames.Color3fArray, "color3d2d_array": Sdf.ValueTypeNames.Color3dArray, "token2d_array": Sdf.ValueTypeNames.TokenArray, "asset2d_array": Sdf.ValueTypeNames.AssetArray } # Check basic types first if type_str.lower() in basic_type_mapping: return basic_type_mapping[type_str.lower()] # Check 2D array types with validation if type_str.lower() in array_type_mapping: usd_type = array_type_mapping[type_str.lower()] try: _ = getattr(Sdf.ValueTypeNames, usd_type.typeName) return usd_type except AttributeError: print(f"Warning: 2D array type '{type_str}' not available, using fallback") return fallback_mapping.get(type_str.lower(), Sdf.ValueTypeNames.StringArray) print(f"Warning: Unknown type '{type_str}', defaulting to String") return Sdf.ValueTypeNames.String
def make_valid_usd_attr_name(prop_name): """ Convert human-readable names to USD-compliant attribute identifiers. """ return prop_name.replace(" ", "_").replace("-", "_").replace("(", "").replace(")", "")
def convert_value_for_usd(value, usd_type): """ Transform Python data types into USD's native representation. """ # Handle 2D array types if usd_type == Sdf.ValueTypeNames.Float2Array: if isinstance(value, list) and all(isinstance(row, list) and len(row) == 2 for row in value): return Vt.Float2Array([Vt.Float2(row[0], row[1]) for row in value]) elif usd_type == Sdf.ValueTypeNames.Double2Array: if isinstance(value, list) and all(isinstance(row, list) and len(row) == 2 for row in value): return Vt.Double2Array([Vt.Double2(row[0], row[1]) for row in value]) elif usd_type == Sdf.ValueTypeNames.Int2Array: if isinstance(value, list) and all(isinstance(row, list) and len(row) == 2 for row in value): return Vt.Int2Array([Vt.Int2(row[0], row[1]) for row in value]) # Handle array fallback types elif usd_type == Sdf.ValueTypeNames.FloatArray: if isinstance(value, list) and all(isinstance(row, list) for row in value): flattened = [item for row in value for item in row] return Vt.FloatArray(flattened) elif isinstance(value, list): return Vt.FloatArray(value) elif usd_type == Sdf.ValueTypeNames.DoubleArray: if isinstance(value, list) and all(isinstance(row, list) for row in value): flattened = [item for row in value for item in row] return Vt.DoubleArray(flattened) elif isinstance(value, list): return Vt.DoubleArray(value) elif usd_type == Sdf.ValueTypeNames.IntArray: if isinstance(value, list) and all(isinstance(row, list) for row in value): flattened = [item for row in value for item in row] return Vt.IntArray(flattened) elif isinstance(value, list): return Vt.IntArray(value) # Handle single value types elif usd_type == Sdf.ValueTypeNames.Vector3f: if isinstance(value, list) and len(value) == 3: return Gf.Vec3f(value[0], value[1], value[2]) elif usd_type == Sdf.ValueTypeNames.Color3f: if isinstance(value, list) and len(value) == 3: return Gf.Vec3f(value[0], value[1], value[2]) elif usd_type == Sdf.ValueTypeNames.Asset: return Sdf.AssetPath(str(value)) return value
def create_properties_layer(metadata_config, output_path, default_prim_name): """ Create isolated USD layer containing only custom properties. """ print(f"Creating properties layer: {output_path}") # Create new USD layer layer = Sdf.Layer.CreateNew(output_path) if not layer: raise RuntimeError(f"Failed to create layer at: {output_path}") # Create stage from layer stage = Usd.Stage.Open(layer) # Create default prim - handle both with and without leading slash if default_prim_name.startswith('/'): default_prim_path = default_prim_name else: default_prim_path = f"/{default_prim_name}" default_prim = stage.OverridePrim(default_prim_path) print(f" Created default prim: {default_prim_path}") stage.SetDefaultPrim(default_prim) # Set edit target properties_layer = stage.GetRootLayer() stage.SetEditTarget(properties_layer) print(f" Set authoring layer to: {properties_layer.identifier}") print(f" Adding properties to: {default_prim_path}") # Get namespace from metadata or override metadata = metadata_config.get("metadata", {}) base_namespace = metadata.get("namespace", "aif") template_type = metadata.get("template_type", "custom") print(f" Base namespace: {base_namespace}") # Add custom properties properties = metadata_config.get("properties", {}) for prop_name, prop_config in properties.items(): prop_type = prop_config.get("type", "string") prop_value = prop_config.get("value") prop_description = prop_config.get("description", "") # Get USD type usd_type = get_usd_type_from_string(prop_type, prop_value) # Convert value if needed converted_value = convert_value_for_usd(prop_value, usd_type) # If property name already contains namespace (has colons), use it as-is # Otherwise, construct namespace using template_type if ":" in prop_name: # Property already has namespace (e.g., "aif:core:manufacturer") attr_name = make_valid_usd_attr_name(prop_name) valid_prop_name = prop_name else: # Property needs namespace prefix (e.g., "manufacturer" -> "aif:custom:manufacturer") valid_prop_name = make_valid_usd_attr_name(prop_name) attr_name = f"{base_namespace}:{template_type}:{valid_prop_name}" if prop_name != valid_prop_name: print(f" Converted property name: '{prop_name}' -> '{valid_prop_name}'") # Create typed attribute attr = default_prim.CreateAttribute(attr_name, usd_type) attr.Set(converted_value) print(f" Created: {attr_name} = {converted_value} ({prop_type})") # Add documentation managed_doc = f"{prop_description} [AIF-MANAGED]" if prop_description else "[AIF-MANAGED]" attr.SetDocumentation(managed_doc) # Lock property in UI using customData custom_data = { 'omni': { 'kit': { 'locked': True } } } attr.SetCustomData(custom_data) print(f" Locked property: {attr_name}") # Add layer metadata metadata = metadata_config.get("metadata", {}) if metadata: root_layer = stage.GetRootLayer() for key, value in metadata.items(): root_layer.customLayerData[key] = value # Save the layer stage.Save() print(f" Created and saved properties layer: {output_path}") return output_path
def main(): """Apply metadata from JSON to create USD properties layer.""" parser = argparse.ArgumentParser( description="Apply metadata from JSON to create a USD properties layer", formatter_class=argparse.RawDescriptionHelpFormatter ) parser.add_argument( "--input", required=True, help="Input metadata.json file path" ) parser.add_argument( "--output", required=True, help="Output .usda properties layer file path" ) parser.add_argument( "--default_prim", required=True, help="Name of the default prim to create (e.g., 'Root', 'Asset')" ) parser.add_argument( "--namespace", required=False, help="Optional namespace override (e.g., 'core', 'electrical'). If not specified, uses template_type from metadata." ) args = parser.parse_args() print("=== Applying Metadata to USD ===") print(f"Input JSON: {args.input}") print(f"Output USDA: {args.output}") print(f"Default Prim: {args.default_prim}") if args.namespace: print(f"Namespace Override: {args.namespace}") # Validate input file exists if not os.path.exists(args.input): print(f"X Error: Input file does not exist: {args.input}") return 1 # Load and validate JSON print("\nLoading metadata JSON...") try: with open(args.input, 'r') as f: metadata_config = json.load(f) except json.JSONDecodeError as e: print(f"X Error: Invalid JSON in input file: {e}") return 1 print("Validating metadata structure...") is_valid, error_msg = validate_metadata_json(metadata_config) if not is_valid: print(f"X Error: Invalid metadata structure: {error_msg}") return 1 print("OK Metadata validated successfully") print(f" Properties: {len(metadata_config['properties'])}") # Apply namespace override if provided if args.namespace: if "metadata" not in metadata_config: metadata_config["metadata"] = {} metadata_config["metadata"]["template_type"] = args.namespace print(f" Namespace overridden to: {args.namespace}") # Create output directory if needed output_dir = os.path.dirname(args.output) if output_dir and not os.path.exists(output_dir): os.makedirs(output_dir) print(f"Created output directory: {output_dir}") # Create properties layer print("\nCreating USD properties layer...") try: create_properties_layer(metadata_config, args.output, args.default_prim) print(f"\nOK Successfully created properties layer: {args.output}") return 0 except Exception as e: print(f"\nX Error creating properties layer: {e}") return 1
if __name__ == "__main__": exit(main())
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
import json
import os
from openpyxl import load_workbook
def convert_value_from_string(value_str, value_type):
"""
Convert string values from Excel to appropriate Python types.
Args:
value_str: String value from Excel
value_type: Target type (string, int, float, bool, etc.)
Returns:
Converted value in appropriate Python type
"""
if value_str is None or value_str == "":
return ""
value_type_lower = value_type.lower().strip()
try:
if value_type_lower == "int":
return int(float(value_str)) # Handle cases like "123.0"
elif value_type_lower == "float" or value_type_lower == "double":
return float(value_str)
elif value_type_lower == "bool":
if isinstance(value_str, bool):
return value_str
value_str_lower = str(value_str).lower().strip()
return value_str_lower in ["true", "1", "yes"]
elif value_type_lower in ["vector3f", "vector3d", "color3f"]:
# Handle vector types - expect format like "[1.0, 2.0, 3.0]" or "1.0, 2.0, 3.0"
if isinstance(value_str, str):
# Remove brackets and split
clean_str = value_str.strip().strip("[]()").strip()
values = [float(x.strip()) for x in clean_str.split(",")]
if len(values) == 3:
return values
else:
print(f"Warning: Vector type expects 3 values, got {len(values)}. Using as string.")
return str(value_str)
return str(value_str)
else:
# Default to string
return str(value_str)
except Exception as e:
print(f"Warning: Could not convert '{value_str}' to type '{value_type}': {e}")
print(f"Using original value as string.")
return str(value_str)
def create_json_from_excel(excel_path, json_path=None):
"""
Create a properties.json file from an Excel file.
Args:
excel_path: Path to the Excel file
json_path: Optional output path for JSON file (defaults to same directory as Excel)
Returns:
Path to created JSON file or None if failed
"""
print(f"Loading Excel file: {excel_path}")
try:
# Load workbook
wb = load_workbook(excel_path, data_only=True)
# Get Properties sheet
if "Properties" in wb.sheetnames:
ws = wb["Properties"]
else:
# Use active sheet if Properties sheet doesn't exist
ws = wb.active
print(f"Warning: 'Properties' sheet not found, using active sheet: {ws.title}")
except Exception as e:
print(f"Error: Failed to load Excel file: {e}")
return None
# Determine output path
if json_path is None:
excel_dir = os.path.dirname(os.path.abspath(excel_path))
json_path = os.path.join(excel_dir, "properties.json")
print(f"Creating JSON file: {json_path}")
# Read headers to find column positions
headers = {}
for col_num in range(1, ws.max_column + 1):
cell_value = ws.cell(row=1, column=col_num).value
if cell_value:
headers[cell_value.strip().lower()] = col_num
print(f"Found columns: {list(headers.keys())}")
# Verify required columns exist
required_columns = ["key", "type", "value", "description"]
missing_columns = [col for col in required_columns if col not in headers]
if missing_columns:
print(f"Error: Missing required columns: {missing_columns}")
print(f"Available columns: {list(headers.keys())}")
return None
# Get column indices
key_col = headers["key"]
type_col = headers["type"]
value_col = headers["value"]
desc_col = headers["description"]
# Build properties dictionary
properties = {}
row_count = 0
for row_num in range(2, ws.max_row + 1):
key = ws.cell(row=row_num, column=key_col).value
# Skip empty rows
if not key:
continue
key = str(key).strip()
prop_type = ws.cell(row=row_num, column=type_col).value
prop_value = ws.cell(row=row_num, column=value_col).value
prop_description = ws.cell(row=row_num, column=desc_col).value
# Set defaults for missing values
if not prop_type:
prop_type = "string"
print(f"Warning: No type specified for '{key}', defaulting to 'string'")
if prop_value is None:
prop_value = ""
if not prop_description:
prop_description = ""
# Convert value to appropriate type
converted_value = convert_value_from_string(prop_value, prop_type)
# Add to properties dictionary
properties[key] = {
"type": str(prop_type).strip(),
"value": converted_value,
"description": str(prop_description).strip()
}
row_count += 1
print(f"Processed {row_count} properties")
# Load metadata if Metadata sheet exists
metadata = {}
if "Metadata" in wb.sheetnames:
ws_meta = wb["Metadata"]
print("Loading metadata from Metadata sheet...")
for row_num in range(2, ws_meta.max_row + 1):
meta_key = ws_meta.cell(row=row_num, column=1).value
meta_value = ws_meta.cell(row=row_num, column=2).value
if meta_key:
metadata[str(meta_key).strip()] = str(meta_value).strip() if meta_value else ""
else:
# Use default metadata
metadata = {
"description": "AIF properties for USD equipment models",
"version": "1.0",
"created": "2025-12-02"
}
print("No Metadata sheet found, using default metadata")
# Create final JSON structure
json_data = {
"properties": properties,
"metadata": metadata
}
# Save JSON file
try:
with open(json_path, 'w', encoding='utf-8') as f:
json.dump(json_data, f, indent=2, ensure_ascii=False)
print(f"JSON file created successfully: {json_path}")
print(f"Total properties: {len(properties)}")
print(f"Metadata entries: {len(metadata)}")
return json_path
except Exception as e:
print(f"Error: Failed to save JSON file: {e}")
return None
if __name__ == "__main__":
# Get the directory where this script is located
script_dir = os.path.dirname(os.path.abspath(__file__))
# Excel file is in the same directory as this script
excel_path = os.path.join(script_dir, "properties.xlsx")
# Check if Excel file exists
if not os.path.exists(excel_path):
print(f"Error: Excel file not found at {excel_path}")
print("Please ensure properties.xlsx is in the same directory as this script.")
print(f"\nScript directory: {script_dir}")
print("\nLooking for Excel files in current directory...")
# Try to find any Excel files in the directory
excel_files = [f for f in os.listdir(script_dir) if f.endswith(('.xlsx', '.xls'))]
if excel_files:
print(f"Found Excel files: {excel_files}")
print(f"Please rename one of these to 'properties.xlsx' or update the script.")
else:
print("No Excel files found in the current directory.")
else:
# Create JSON file (will save to same directory as Excel)
json_path = create_json_from_excel(excel_path)
if json_path:
print(f"\n=== Conversion Complete ===")
print(f"Input: {excel_path}")
print(f"Output: {json_path}")
print(f"\nYou can now use this properties.json file with the USD property scripts.")
else:
print("\n=== Conversion Failed ===")
print("Please check the error messages above and ensure:")
print("1. Excel file has 'Key', 'Type', 'Value', and 'Description' columns")
print("2. Excel file is not open in another program")
print("3. You have write permissions in the directory")123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419/***************************************************************************************************
* Copyright 2022 NVIDIA Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of NVIDIA CORPORATION nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**************************************************************************************************/
mdl 1.7;
import ::df::*;
import ::state::*;
import ::math::*;
import ::base::*;
import ::state::*;
import ::tex::*;
import ::anno::*;
import ::debug::*;
import ::nvidia::core_definitions::file_texture;
import ::nvidia::core_definitions::normalmap_texture;
import OmniPBR_ClearCoat::*;
// OmniPBR //
export material OmniPBR(
// Albdeo //
color diffuse_color_constant = color(0.2) [[
anno::display_name("Albedo Color"),
anno::description("This is the albedo base color"),
anno::in_group("Albedo")
]],
uniform texture_2d diffuse_texture = texture_2d() [[
anno::display_name("Albedo Map"),
anno::in_group("Albedo")
]],
float albedo_desaturation = float(0.0) [[
anno::display_name("Albedo Map Desaturation"),
anno::description("Desaturates the albedo map"),
anno::in_group("Albedo"),
anno::soft_range(float(0.0), float(1.0))
]],
float albedo_add = float(0.0) [[
anno::display_name("Albedo Add"),
anno::description("Adds a constant value to the diffuse color "),
anno::in_group("Albedo"),
anno::soft_range(float(-1.0), float(1.0))
]],
float albedo_brightness = float(1.0) [[
anno::display_name("Albedo Brightness"),
anno::description("Multiplier for the diffuse color "),
anno::in_group("Albedo"),
anno::soft_range(float(0.0), float(1.0))
]],
color diffuse_tint = color(1.0) [[
anno::display_name("Color Tint"),
anno::description("When enabled, this color value is multiplied over the final albedo color"),
anno::in_group("Albedo")
]],
// Reflectivity //
float reflection_roughness_constant = float(0.5) [[
anno::display_name("Roughness Amount"),
anno::description("Higher roughness values lead to more blurry reflections"),
anno::in_group("Reflectivity"),
anno::hard_range(float(0.0), float(1.0))
]],
float reflection_roughness_texture_influence = float(0.0) [[
anno::display_name("Roughness Map Influence"),
anno::description("Blends between the constant value and the lookup of the roughness texture"),
anno::in_group("Reflectivity"),
anno::hard_range(float(0.0), float(1.0))
]],
uniform texture_2d reflectionroughness_texture = texture_2d() [[
anno::display_name("Roughness Map"),
anno::in_group("Reflectivity"),
anno::usage("roughness")
]],
float metallic_constant = float(0.0) [[
anno::display_name("Metallic Amount"),
anno::description("Metallic Material"),
anno::in_group("Reflectivity"),
anno::hard_range(float(0.0), float(1.0))
]],
float metallic_texture_influence = float(0.0) [[
anno::display_name("Metallic Map Influence"),
anno::description("Blends between the constant value and the lookup of the metallic texture"),
anno::in_group("Reflectivity"),
anno::hard_range(float(0.0), float(1.0))
]],
uniform texture_2d metallic_texture = texture_2d() [[
anno::display_name("Metallic Map"),
anno::in_group("Reflectivity"),
anno::usage("metalness")
]],
float specular_level = float(0.5) [[
anno::display_name("Specular"),
anno::description("The specular level (intensity) of the material"),
anno::in_group("Reflectivity"),
anno::soft_range(float(0.0), float(1.0))
]],
// ORM //
uniform bool enable_ORM_texture = false [[
anno::display_name("Enable ORM Texture"),
anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"),
anno::in_group("Reflectivity")
]],
uniform texture_2d ORM_texture = texture_2d() [[
anno::display_name("ORM Map"),
anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"),
anno::in_group("Reflectivity"),
anno::usage("roughness")
]],
// AO Group //
float ao_to_diffuse = 0.0 [[
anno::display_name("AO to diffuse"),
anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"),
anno::in_group("AO"),
anno::hard_range(float(0.0), float(1.0))
]],
uniform texture_2d ao_texture = texture_2d() [[
anno::display_name("Ambient Occlusion Map"),
anno::description("The ambient occlusion texture for the material"),
anno::in_group("AO"),
anno::usage("occlusion")
]],
// Emission //
uniform bool enable_emission = false [[
anno::display_name("Enable Emission"),
anno::description("Enables the emission of light from the material"),
anno::in_group("Emissive")
]],
color emissive_color = color(1.0,0.1,0.1) [[
anno::display_name("Emissive Color"),
anno::description("The emission color"),
anno::in_group("Emissive"),
anno::enable_if("enable_emission == true")
]],
uniform texture_2d emissive_color_texture = texture_2d() [[
anno::display_name("Emissive Color map"),
anno::in_group("Emissive"),
anno::description("The emissive color texture"),
anno::enable_if("enable_emission == true")
]],
uniform texture_2d emissive_mask_texture = texture_2d() [[
anno::display_name("Emissive Mask map"),
anno::description("The texture masking the emissive color"),
anno::in_group("Emissive"),
anno::enable_if("enable_emission == true"),
anno::usage("occlusion")
]],
float emissive_intensity = float(40.0) [[
anno::display_name("Emissive Intensity"),
anno::description("Intensity of the emission"),
anno::in_group("Emissive"),
anno::enable_if("enable_emission == true")
]],
// Cutout Opacity //
uniform bool enable_opacity = false [[
anno::display_name("Enable Opacity"),
anno::description("Enables the use of cutout opacity"),
anno::in_group("Opacity")
]],
uniform texture_2d opacity_texture = texture_2d() [[
anno::display_name("Opacity Map"),
anno::in_group("Opacity"),
anno::usage("opacity")
]],
float opacity_constant = float(1.0) [[
anno::display_name("Opacity Amount"),
anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
anno::in_group("Opacity"),
anno::hard_range(float(0.0), float(1.0))
]],
uniform bool enable_opacity_texture = false [[
anno::display_name("Enable Opacity Texture"),
anno::description("Enables or disables the usage of the opacity texture map"),
anno::in_group("Opacity")
]],
uniform base::mono_mode opacity_mode = base::mono_average [[
anno::display_name("Opacity Mono Source"),
anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
anno::in_group("Opacity")
]],
uniform float opacity_threshold = float(0.0) [[
anno::hard_range(0.0, 1.0),
anno::display_name("Opacity Threshold"),
anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
anno::in_group("Opacity")
]],
// Normal //
uniform float geometry_normal_roughness_strength = 1.f
[[
anno::hard_range(0.0, 1.0),
anno::display_name("Normal map to roughness weight"),
anno::description("Enables and weights roughness induced by normal maps"),
anno::in_group("Normal")
]],
uniform float bump_factor = float(1.0) [[
anno::display_name("Normal Strength"),
anno::description("Strength of normal map"),
anno::in_group("Normal"),
anno::soft_range(float(0.0), float(1.0))
]],
uniform texture_2d normalmap_texture = texture_2d() [[
anno::display_name("Normal Map"),
anno::in_group("Normal"),
anno::usage("normal")
]],
uniform float detail_bump_factor = float(0.3) [[
anno::display_name("Detail Normal Strength"),
anno::in_group("Normal"),
anno::description("Strength of the detail normal"),
anno::soft_range(float(0.0), float(1.0))
]],
uniform texture_2d detail_normalmap_texture = texture_2d() [[
anno::display_name("Detail Normal Map"),
anno::in_group("Normal"),
anno::usage("normal")
]],
uniform bool flip_tangent_u = false [[
anno::display_name("Normal Map Flip U Tangent"),
anno::in_group("Normal")
]],
uniform bool flip_tangent_v = true [[
anno::display_name("Normal Map Flip V Tangent"),
anno::in_group("Normal")
]],
// UVW Projection Group //
uniform bool project_uvw = false [[
anno::display_name("Enable Project UVW Coordinates"),
anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
anno::in_group("UV")
]],
uniform bool world_or_object = false [[
anno::display_name("Enable World Space"),
anno::description("When enabled, uses world space for projection, otherwise object space is used"),
anno::in_group("UV"),
anno::enable_if("project_uvw == true")
]],
uniform int uv_space_index = 0 [[
anno::display_name("UV Space Index"),
anno::description("UV Space Index."),
anno::in_group("UV"),
anno::enable_if("project_uvw == true"),
anno::hard_range(int(0), int(3))
]],
// UVW Adjustments Group //
uniform float2 texture_translate = float2(0.0) [[
anno::display_name("Texture Translate"),
anno::description("Controls position of texture."),
anno::in_group("UV"),
anno::enable_if("project_uvw == true")
]],
uniform float texture_rotate = float(0.0) [[
anno::display_name("Texture Rotate"),
anno::description("Rotates angle of texture in degrees."),
anno::in_group("UV"),
anno::enable_if("project_uvw == true")
]],
uniform float2 texture_scale = float2(1.0) [[
anno::display_name("Texture Tiling"),
anno::description("Controls the repetition of the texture."),
anno::in_group("UV"),
anno::enable_if("project_uvw == true")
]],
uniform float2 detail_texture_translate = float2(0.0) [[
anno::display_name("Detail Texture Translate"),
anno::description("Controls the position of the detail texture."),
anno::in_group("UV"),
anno::enable_if("project_uvw == true")
]],
uniform float detail_texture_rotate = float(0.0) [[
anno::display_name("Detail Texture Rotate"),
anno::description("Rotates angle of the detail texture in degrees."),
anno::in_group("UV"),
anno::enable_if("project_uvw == true")
]],
uniform float2 detail_texture_scale = float2(1.0) [[
anno::display_name("Detail Texture Tiling"),
anno::description("Controls the repetition of the detail texture."),
anno::in_group("UV"),
anno::enable_if("project_uvw == true")
]],
// Geometry //
uniform float round_edges_radius = float(0.0) [[
anno::display_name("Round Edge Radius"),
anno::description("Influence radius around the edges in meters"),
anno::in_group("Geometry"),
anno::soft_range(0.0, 1.0)
]],
uniform float round_edges_roundness = float(1.0) [[
anno::display_name("Round Edge Roundness"),
anno::description("Determines how round the edge will look"),
anno::in_group("Geometry"),
anno::hard_range(0.0, 1.0)
]],
uniform bool round_edges_across_materials = false [[
anno::display_name("Round Edge Across Materials"),
anno::description("Normal smoothing happens only between facets of equal material, \n"
"\t\tunless this parameter is set true, in which case the smoothing \n"
"\t\thappens between facets irrespective of their materials"),
anno::in_group("Geometry")
]]
)
[[
anno::display_name("OmniPBR"),
anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."),
anno::in_group("Base"),
anno::version( 2, 1, 2),
anno::author("NVIDIA CORPORATION"),
anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic"))
]] = let {
material base = OmniPBR_ClearCoat::OmniPBR_ClearCoat(
diffuse_color_constant: diffuse_color_constant,
diffuse_texture: diffuse_texture,
albedo_desaturation: albedo_desaturation,
albedo_add: albedo_add,
albedo_brightness: albedo_brightness,
diffuse_tint: diffuse_tint,
reflection_roughness_constant: reflection_roughness_constant,
reflection_roughness_texture_influence: reflection_roughness_texture_influence,
reflectionroughness_texture: reflectionroughness_texture,
metallic_constant: metallic_constant,
metallic_texture_influence: metallic_texture_influence,
metallic_texture: metallic_texture,
specular_level: specular_level,
enable_ORM_texture: enable_ORM_texture,
ORM_texture: ORM_texture,
ao_to_diffuse: ao_to_diffuse,
ao_texture: ao_texture,
enable_emission: enable_emission,
emissive_color: emissive_color,
emissive_color_texture: emissive_color_texture,
emissive_mask_texture: emissive_mask_texture,
emissive_intensity: emissive_intensity,
enable_opacity: enable_opacity,
opacity_texture: opacity_texture,
opacity_constant: opacity_constant,
enable_opacity_texture: enable_opacity_texture,
opacity_mode: opacity_mode,
opacity_threshold: opacity_threshold,
geometry_normal_roughness_strength: geometry_normal_roughness_strength,
bump_factor: bump_factor,
normalmap_texture: normalmap_texture,
detail_bump_factor: detail_bump_factor,
detail_normalmap_texture: detail_normalmap_texture,
flip_tangent_u: flip_tangent_u,
flip_tangent_v: flip_tangent_v,
project_uvw: project_uvw,
world_or_object: world_or_object,
uv_space_index: uv_space_index,
texture_translate: texture_translate,
texture_rotate: texture_rotate,
texture_scale: texture_scale,
detail_texture_translate: detail_texture_translate,
detail_texture_rotate: detail_texture_rotate,
detail_texture_scale: detail_texture_scale,
round_edges_radius: round_edges_radius,
round_edges_roundness: round_edges_roundness,
round_edges_across_materials: round_edges_across_materials
);
} in material(
surface: base.surface,
geometry: base.geometry
);123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493/***************************************************************************************************
* Copyright 2022 NVIDIA Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of NVIDIA CORPORATION nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**************************************************************************************************/
mdl 1.7;
import ::df::*;
import ::state::*;
import ::math::*;
import ::base::*;
import ::tex::*;
import ::anno::*;
import ::anno::*;
export float3 HemiOctahedronToUnitVector( float2 Oct ) [[
anno::hidden()
]]
{
Oct = float2( Oct.x + Oct.y, Oct.x - Oct.y ) * 0.5;
float3 N = float3( Oct.x, Oct.y, 1.0 - math::dot( float2(1.0), math::abs(Oct) ) );
return math::normalize(N);
}
export struct NormalData [[
anno::hidden()
]]
{
float3 normal;
float2 roughness;
};
export NormalData tangent_space_normal_roughness_texture(
uniform texture_2d texture
[[
anno::description("The input texture"),
anno::usage("normal")
]],
uniform float factor = 1.0f
[[ anno::description("Determines the degree of bumpiness") ]],
uniform bool flip_tangent_u = false
[[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]],
uniform bool flip_tangent_v = false
[[ anno::description("Can be used to fix mismatches between the object's tangent space and the normal map's tangent space") ]],
base::texture_coordinate_info uvw = base::texture_coordinate_info()
[[ anno::description("Parameterization to be used for texture mapping. Defaults to texture channel 0.") ]],
uniform float2 crop_u = float2( 0.0, 1.0)
[[ anno::description("Restricts the texture access to sub-domain of the texture in the u direction") ]],
uniform float2 crop_v = float2( 0.0, 1.0)
[[ anno::description("Restricts the texture access to sub-domain of the texture in the v direction") ]],
uniform tex::wrap_mode wrap_u = tex::wrap_repeat
[[ anno::description("Wrapping mode in the u direction") ]],
uniform tex::wrap_mode wrap_v = tex::wrap_repeat
[[ anno::description("Wrapping mode in the v direction") ]],
uniform bool clip = false
[[
anno::description("deprecated, usewrap_mode=tex::wrap_clip. Defines wrap_clamp behavior. If true, lookup outside [0,1] results in no bump"),
anno::hidden()
]],
uniform float scale = 1.
[[
anno::description("Scales the value red from the texture file. Can be used to adapt to different normal map formats"),
anno::unused()
]],
uniform float offset = 0.
[[
anno::description("Offset applied to the value red from the texture file. Can be used to adapt to different normal map formats"),
anno::unused()
]],
uniform float animation_start_time = 0.
[[ anno::description("When to start playing first frame of the animation ") ]],
uniform int2 animation_crop = int2(0, 0)
[[ anno::description("If the texture is an animation, the range of frames to be played can be specified.") ]],
uniform tex::wrap_mode animation_wrap = tex::wrap_repeat
[[ anno::description("Defines what to do outside of regular animation time") ]],
uniform float animation_fps = 30
[[ anno::description("Framerate to use for animation playback") ]]
)
[[
anno::description("Interprets the color values of a bitmap as a vector in tangent space"),
anno::hidden(),
anno::noinline()
]]
{
NormalData normalData;
normalData.roughness = float2(0);
normalData.normal = state::normal();
float frame = 0.0;
if(animation_crop != int2(0,0)) //only if we have an animation
{
frame = (::state::animation_time()-animation_start_time) * animation_fps ; //start playing at first frame of the animation
switch ( animation_wrap) {
case tex::wrap_repeat:
frame=frame>0? math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.x:
math::fmod(frame,animation_crop.y-animation_crop.x)+animation_crop.y;
break;
case tex::wrap_mirrored_repeat:
float animation_crop_2y = 2.0*animation_crop.y;
frame=frame>0? math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop.x:
math::fmod(frame,(animation_crop.y-animation_crop.x)*2.0)+animation_crop_2y-animation_crop.x;
if(frame>animation_crop.y)
frame = animation_crop_2y-frame;
break;
case tex::wrap_clamp:
frame = math::clamp( frame+animation_crop.x, animation_crop.x, animation_crop.y);
break;
case tex::wrap_clip:
frame += animation_crop.x;
if(frame < animation_crop.x || frame > animation_crop.y) return normalData;
break;
}
}
if (tex::width(texture) == 0 || tex::height(texture) == 0 || // avoid division by zero in texremapu for invalid resource
factor == 0.0f)
return normalData;
{
if (clip) {
if (wrap_u == tex::wrap_clamp && (uvw.position.x < 0. || uvw.position.x > 1.)) {
return normalData;
}
if (wrap_v == tex::wrap_clamp && (uvw.position.y < 0. || uvw.position.y > 1.)) {
return normalData;
}
}
if (wrap_u == tex::wrap_clip && (uvw.position.x < 0. || uvw.position.x > 1.)) {
return normalData;
}
if (wrap_v == tex::wrap_clip && (uvw.position.y < 0. || uvw.position.y > 1.)) {
return normalData;
}
}
bool pixel_flip_u = flip_tangent_u;
bool pixel_flip_v = flip_tangent_v;
//if we mirror repeat a tangent space texture, tangent space needs to be flipped for every other tile
if (wrap_u == tex::wrap_mirrored_repeat) {
if( uvw.position.x > 0. && int(uvw.position.x) % 2 == 1)
pixel_flip_u = ! pixel_flip_u;
else if( uvw.position.x < 0. && int(uvw.position.x) % 2 == 0)
pixel_flip_u = ! pixel_flip_u;
}
if (wrap_v == tex::wrap_mirrored_repeat) {
if( uvw.position.y > 0. && int(uvw.position.y) % 2 == 1)
pixel_flip_v = ! pixel_flip_v;
else if( uvw.position.y < 0. && int(uvw.position.y) % 2 == 0)
pixel_flip_v = ! pixel_flip_v;
}
float3 transformed_tangent_u = uvw.tangent_u;
float3 transformed_tangent_v = uvw.tangent_v;
if (pixel_flip_u)
transformed_tangent_u=-transformed_tangent_u;
if (pixel_flip_v)
transformed_tangent_v=-transformed_tangent_v;
float3 tangent_space_normal;
float4 normal_raw = tex::lookup_float4(texture,float2(uvw.position.x,uvw.position.y), wrap_u, wrap_v, crop_u, crop_v, frame);
if(normal_raw.x > 1.5)
{
// octahedron packed by OV
normal_raw.x -= 2.0;
normal_raw.x -= 0.5;
normal_raw.y -= 0.5;
tangent_space_normal = HemiOctahedronToUnitVector(float2(normal_raw.x, normal_raw.y) * 2.0);
normalData.roughness = float2(normal_raw.z, normal_raw.w);
}
else
{
// regular
tangent_space_normal = (float3(normal_raw.x, normal_raw.y, normal_raw.z) - float3(0.5)) * 2.0;
normalData.roughness = float2(0);
}
normalData.normal = math::normalize(
transformed_tangent_u * tangent_space_normal.x * factor +
transformed_tangent_v * tangent_space_normal.y * factor +
state::normal() * tangent_space_normal.z);
return normalData;
}
export material OmniPBRBase(
// Albdeo //
color diffuse_reflection_color = color(0.2) [[
anno::display_name("Albedo Color"),
anno::description("This is the albedo base color"),
anno::in_group("Albedo")
]],
color diffuse_tint = color(1.0) [[
anno::display_name("Albedo Tint"),
anno::description("When enabled, this color value is multiplied over the final albedo color"),
anno::in_group("Albedo")
]],
// Reflecitivity //
float specular_reflection_roughness = float(0.0) [[
anno::display_name("Roughness"),
anno::description("Higher roughness values lead to more blurry reflections"),
anno::in_group("Reflectivity"),
anno::hard_range(0.0, 1.0)
]],
float2 specular_reflection_aniso_roughness = float2(0.0, 0.0) [[
anno::display_name("Aniso roughness"),
anno::description("Higher roughness values lead to more blurry reflections"),
anno::in_group("Reflectivity"),
anno::hidden()
]],
float metalness = float(0.0) [[
anno::display_name("Metalness"),
anno::description("Bias towards pure specular reflection"),
anno::in_group("Reflectivity"),
anno::hard_range(0.0, 1.0)
]],
float specular_level = float(0.5) [[
anno::display_name("Specular"),
anno::description("The specular level (intensity) of the material"),
anno::in_group("Reflectivity"),
anno::soft_range(0.0, 1.0)
]],
// Emission //
uniform bool enable_emission = false [[
anno::display_name("Enable Emission"),
anno::description("Enables the emission of light from the material"),
anno::in_group("Emissive")
]],
color emission_color = color(1.0,0.1,0.1) [[
anno::display_name("Emissive Color"),
anno::description("The emission color"),
anno::in_group("Emissive"),
anno::enable_if("enable_emission == true")
]],
float emission_intensity = float(40.0) [[
anno::display_name("Emissive Intensity"),
anno::description("Intensity of the emission"),
anno::in_group("Emissive"),
anno::soft_range(0.0, 1000.0),
anno::enable_if("enable_emission == true")
]],
// Geometry Opacity //
uniform bool enable_opacity = false [[
anno::display_name("Enable Opacity"),
anno::description("Enables the use of cutout opacity"),
anno::in_group("Opacity")
]],
float geometry_opacity = float(1.0) [[
anno::display_name("Opacity Amount"),
anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
anno::in_group("Opacity"),
anno::hard_range(0.0, 1.0)
]],
uniform float geometry_opacity_threshold = 0.f
[[
anno::display_name("Opacity Threshold"),
anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
anno::in_group("Opacity"),
anno::hard_range(0.0, 1.0)
]],
// Clearcoat //
uniform bool enable_coat = false [[
anno::display_name("Enable Clearcoat Layer"),
anno::description("Adds a coat layer on top of the material when enabled"),
anno::in_group("Clearcoat")
]],
float coat_weight = float(1.0) [[
anno::display_name("Clearcoat Weight"),
anno::description("Sets the weight for coat layer"),
anno::in_group("Clearcoat"),
anno::hard_range(0.0, 1.0)
]],
color coat_color = color(1.0) [[
anno::display_name("Clearcoat Tint"),
anno::description("Clearcoat is tinted and affects the underlying material"),
anno::in_group("Clearcoat")
]],
float coat_transparency = float(1.0) [[
anno::display_name("Clearcoat Transparency"),
anno::description("Adjusts the transparency of the coat. Can be turned into a fully opaque coat covering the underlying layer"),
anno::in_group("Clearcoat"),
anno::hard_range(0.0, 1.0)
]],
float coat_roughness = float(0.0) [[
anno::display_name("Clearcoat Roughness"),
anno::description("Higher roughness values lead to more blurry reflections"),
anno::in_group("Clearcoat"),
anno::hard_range(0.0, 1.0)
]],
float2 coat_aniso_roughness = float2(0.0, 0.0) [[
anno::display_name("Clearcoat aniso roughness"),
anno::description("Higher roughness values lead to more blurry reflections"),
anno::in_group("Clearcoat"),
anno::hidden()
]],
float coat_ior = float(1.56) [[
anno::display_name("Clearcoat IOR"),
anno::description("Sets the Index of refraction for the coat layer"),
anno::in_group("Clearcoat"),
anno::soft_range(0.0, 4.0)
]],
float3 clearcoat_geometry_normal = state::normal() [[
anno::display_name("Clearcoat Normal"),
anno::in_group("Clearcoat"),
anno::usage("normal")
]],
// Geometry //
uniform float round_edges_radius = float(0.0) [[
anno::display_name("Round Edge Radius"),
anno::description("Influence radius around the edges in meters"),
anno::in_group("Geometry"),
anno::soft_range(0.0, 1.0)
]],
uniform float round_edges_roundness = float(1.0) [[
anno::display_name("Round Edge Roundness"),
anno::description("Determines how round the edge will look"),
anno::in_group("Geometry"),
anno::hard_range(0.0, 1.0)
]],
uniform bool round_edges_across_materials = false [[
anno::display_name("Round Edge Across Materials"),
anno::description("Normal smoothing happens only between facets of equal material, \n"
"\t\tunless this parameter is set true, in which case the smoothing \n"
"\t\thappens between facets irrespective of their materials"),
anno::in_group("Geometry")
]],
float3 geometry_normal = state::normal() [[
anno::display_name("Geometry Normal"),
anno::in_group("Geometry"),
anno::usage("normal")
]]
)
[[
anno::display_name("OmniPBR Base"),
anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."),
anno::in_group("Omni Materials"),
anno::version( 2, 1, 1),
anno::author("NVIDIA CORPORATION"),
anno::key_words(string[]("omni", "PBR", "opacity", "omniverse", "generic"))
]]
= let{
// Diffuse Bsdf //
color tinted_diffuse_color = diffuse_reflection_color * diffuse_tint;
color base_color = tinted_diffuse_color;
bsdf diffuse_bsdf = df::weighted_layer(
weight: 1.0,
layer: df::diffuse_reflection_bsdf(
tint: base_color,
roughness: float(0.0)
),
base: bsdf(),
normal: geometry_normal
);
// Glossy Reflection Bsdf //
float roughness_u = math::clamp(specular_reflection_roughness * specular_reflection_roughness
+ specular_reflection_aniso_roughness.x * specular_reflection_aniso_roughness.x, 0, 1);
float roughness_v = math::clamp(specular_reflection_roughness * specular_reflection_roughness
+ specular_reflection_aniso_roughness.y * specular_reflection_aniso_roughness.y, 0, 1);
bsdf ggx_smith_bsdf = df::microfacet_ggx_smith_bsdf(
roughness_u: roughness_u,
roughness_v: roughness_v,
tint: color(1.0),
mode: df::scatter_reflect
);
bsdf custom_curve_layer_bsdf = df::custom_curve_layer(
normal_reflectivity: 0.08,
grazing_reflectivity: 1.0,
exponent: 5.0,
weight: specular_level,
layer: ggx_smith_bsdf,
base: diffuse_bsdf,
normal: geometry_normal
);
bsdf directional_factor_bsdf = df::tint(base_color, ggx_smith_bsdf);
bsdf omni_PBR_bsdf = df::weighted_layer(
weight: metalness,
layer: directional_factor_bsdf,
base: custom_curve_layer_bsdf,
normal: geometry_normal
);
// Clear Coat //
float coat_roughness_u = math::clamp(coat_roughness * coat_roughness
+ coat_aniso_roughness.x * coat_aniso_roughness.x, 0, 1);
float coat_roughness_v = math::clamp(coat_roughness * coat_roughness
+ coat_aniso_roughness.y * coat_aniso_roughness.y, 0, 1);
bsdf coat_bsdf = df::microfacet_ggx_smith_bsdf(
roughness_u: coat_roughness_u,
roughness_v: coat_roughness_v,
tint: color(1.0),
mode: df::scatter_reflect
);
bsdf opaque_coat = df::weighted_layer(
weight: coat_transparency,
layer: ::df::tint(
tint: coat_color,
base: omni_PBR_bsdf
),
base: ::df::diffuse_reflection_bsdf(
tint: coat_color
)
);
bsdf omni_PBR_coated_bsdf = df::fresnel_layer(
ior: coat_ior,
weight: coat_weight,
layer: coat_bsdf,
base: opaque_coat,
normal: clearcoat_geometry_normal
);
bsdf final_bsdf = enable_coat ? omni_PBR_coated_bsdf : omni_PBR_bsdf;
color emission_value = enable_emission ? emission_color * color(emission_intensity) : color(0.0);
float opacity_value = geometry_opacity;
float cutout_opacity = enable_opacity ? ((geometry_opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= geometry_opacity_threshold) ? 1.0 : 0)) : 1.0;
material_emission emission = material_emission(
df::diffuse_edf(),
intensity: emission_value
);
material_surface surface = material_surface(
scattering: final_bsdf,
emission: emission
);
material_geometry geometry = material_geometry(
normal: state::rounded_corner_normal(
radius: round_edges_radius,
across_materials: round_edges_across_materials,
roundness: round_edges_roundness
),
cutout_opacity: cutout_opacity
);
} in material(
surface: surface,
geometry: geometry
);123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734/***************************************************************************************************
* Copyright 2022 NVIDIA Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of NVIDIA CORPORATION nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**************************************************************************************************/
mdl 1.7;
import ::df::*;
import ::state::*;
import ::math::*;
import ::base::*;
import ::state::*;
import ::tex::*;
import ::anno::*;
import ::debug::*;
import ::nvidia::core_definitions::file_texture;
import ::nvidia::core_definitions::normalmap_texture;
import OmniPBRBase::*;
// Functions //
// Returns a matrix from R,T,S. inputs //
uniform float4x4 rotation_translation_scale(
uniform float3 rotation = float3(0.)
[[ anno::description("Rotation applied to every UVW coordinate") ]],
uniform float3 translation = float3(0.)
[[ anno::description("Offset applied to every UVW coordinate") ]],
uniform float3 scaling = float3(1.)
[[ anno::description("Scale applied to every UVW coordinate") ]]
)
[[
anno::description("Construct a transformation matrix from euler rotation, translation and scale"),
anno::hidden()
]]
{
float4x4 scale =
float4x4(scaling.x , 0.0 , 0.0 , 0.0,
0.0 , scaling.y , 0.0 , 0.0,
0.0 , 0.0 , scaling.z , 0.0,
translation.x , translation.y , translation.z , 1.0);
float3 s = math::sin(rotation);
float3 c = math::cos(rotation);
float4x4 rotate =
float4x4( c.y*c.z , -c.x*s.z + s.x*s.y*c.z , s.x*s.z + c.x*s.y*c.z , 0.0,
c.y*s.z , c.x*c.z + s.x*s.y*s.z , -s.x*c.z + c.x*s.y*s.z , 0.0,
-s.y , s.x*c.y , c.x*c.y , 0.0,
0.0 , 0.0 , 0 , 1.0);
return scale * rotate;
}
// Returns the normal n in tangent space, given n is in internal space. //
float3 transform_internal_to_tangent(float3 n)
{
/* flip_tangent_v */
return
n.x* float3(state::texture_tangent_u(0).x,-state::texture_tangent_v(0).x,state::normal().x)+
n.y* float3(state::texture_tangent_u(0).y,-state::texture_tangent_v(0).y,state::normal().y)+
n.z* float3(state::texture_tangent_u(0).z,-state::texture_tangent_v(0).z,state::normal().z);
}
// Returns the normal n in internal space, given n is in tangent space.
float3 transform_tangent_to_internal(float3 n)
{
return state::texture_tangent_u(0) * n.x -
state::texture_tangent_v(0) * n.y + /* flip_tangent_v */
state::normal() * n.z;
}
// Returns a normal by adding a detail normal to a global normal.
export float3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal())
{
// http://blog.selfshadow.com/publications/blending-in-detail/
float3 n_t = transform_internal_to_tangent(n);
float3 nd_t = transform_internal_to_tangent(nd);
n_t = n_t + float3(0.,0.,1.);
nd_t = nd_t * float3(-1.,-1.,1.);
n = n_t * math::dot(n_t, nd_t)/n_t.z - nd_t;
return math::normalize(transform_tangent_to_internal(n));
}
base::texture_return multiply_colors(
color color_1 = color(1.0, 1.0, 1.0),
color color_2 = color(.5, .5, .5),
float weight = 1.0
)
[[
anno::hidden()
]]
{
return base::blend_color_layers(
layers: base::color_layer[](
base::color_layer(
layer_color: color_2,
weight: weight,
mode: base::color_layer_multiply
)),
base: color_1
);
}
// OmniPBR Clearcoat //
export material OmniPBR_ClearCoat(
// Albdeo //
color diffuse_color_constant = color(0.2) [[
anno::display_name("Albedo Color"),
anno::description("This is the albedo base color"),
anno::in_group("Albedo")
]],
uniform texture_2d diffuse_texture = texture_2d() [[
anno::display_name("Albedo Map"),
anno::in_group("Albedo")
]],
float albedo_desaturation = float(0.0) [[
anno::display_name("Albedo Map Desaturation"),
anno::description("Desaturates the albedo map"),
anno::in_group("Albedo"),
anno::soft_range(float(0.0), float(1.0))
]],
float albedo_add = float(0.0) [[
anno::display_name("Albedo Add"),
anno::description("Adds a constant value to the diffuse color "),
anno::in_group("Albedo"),
anno::soft_range(float(-1.0), float(1.0))
]],
float albedo_brightness = float(1.0) [[
anno::display_name("Albedo Brightness"),
anno::description("Multiplier for the diffuse color "),
anno::in_group("Albedo"),
anno::soft_range(float(0.0), float(1.0))
]],
color diffuse_tint = color(1.0) [[
anno::display_name("Color Tint"),
anno::description("When enabled, this color value is multiplied over the final albedo color"),
anno::in_group("Albedo")
]],
// Reflectivity //
float reflection_roughness_constant = float(0.5) [[
anno::display_name("Roughness Amount"),
anno::description("Higher roughness values lead to more blurry reflections"),
anno::in_group("Reflectivity"),
anno::hard_range(float(0.0), float(1.0))
]],
float reflection_roughness_texture_influence = float(0.0) [[
anno::display_name("Roughness Map Influence"),
anno::description("Blends between the constant value and the lookup of the roughness texture"),
anno::in_group("Reflectivity"),
anno::hard_range(float(0.0), float(1.0))
]],
uniform texture_2d reflectionroughness_texture = texture_2d() [[
anno::display_name("Roughness Map"),
anno::in_group("Reflectivity"),
anno::usage("roughness")
]],
float metallic_constant = float(0.0) [[
anno::display_name("Metallic Amount"),
anno::description("Metallic Material"),
anno::in_group("Reflectivity"),
anno::hard_range(float(0.0), float(1.0))
]],
float metallic_texture_influence = float(0.0) [[
anno::display_name("Metallic Map Influence"),
anno::description("Blends between the constant value and the lookup of the metallic texture"),
anno::in_group("Reflectivity"),
anno::hard_range(float(0.0), float(1.0))
]],
uniform texture_2d metallic_texture = texture_2d() [[
anno::display_name("Metallic Map"),
anno::in_group("Reflectivity"),
anno::usage("metalness")
]],
float specular_level = float(0.5) [[
anno::display_name("Specular"),
anno::description("The specular level (intensity) of the material"),
anno::in_group("Reflectivity"),
anno::soft_range(float(0.0), float(1.0))
]],
// ORM //
uniform bool enable_ORM_texture = false [[
anno::display_name("Enable ORM Texture"),
anno::description("The ORM texture will be used to extract the Occlusion, Roughness and Metallic textures from R,G,B channels"),
anno::in_group("Reflectivity")
]],
uniform texture_2d ORM_texture = texture_2d() [[
anno::display_name("ORM Map"),
anno::description("Texture that has Occlusion, Roughness and Metallic maps stored in their respective R, G and B channels"),
anno::in_group("Reflectivity"),
anno::usage("roughness")
]],
// AO Group //
float ao_to_diffuse = 0.0 [[
anno::display_name("AO to diffuse"),
anno::description("Controls the amount of ambient occlusion multiplied against the diffuse color channel"),
anno::in_group("AO"),
anno::hard_range(float(0.0), float(1.0))
]],
uniform texture_2d ao_texture = texture_2d() [[
anno::display_name("Ambient Occlusion Map"),
anno::description("The ambient occlusion texture for the material"),
anno::in_group("AO"),
anno::usage("occlusion")
]],
// Emission //
uniform bool enable_emission = false [[
anno::display_name("Enable Emission"),
anno::description("Enables the emission of light from the material"),
anno::in_group("Emissive")
]],
color emissive_color = color(1.0,0.1,0.1) [[
anno::display_name("Emissive Color"),
anno::description("The emission color"),
anno::in_group("Emissive"),
anno::enable_if("enable_emission == true")
]],
uniform texture_2d emissive_color_texture = texture_2d() [[
anno::display_name("Emissive Color map"),
anno::in_group("Emissive"),
anno::description("The emissive color texture"),
anno::enable_if("enable_emission == true")
]],
uniform texture_2d emissive_mask_texture = texture_2d() [[
anno::display_name("Emissive Mask map"),
anno::description("The texture masking the emissive color"),
anno::in_group("Emissive"),
anno::enable_if("enable_emission == true"),
anno::usage("occlusion")
]],
float emissive_intensity = float(40.0) [[
anno::display_name("Emissive Intensity"),
anno::description("Intensity of the emission"),
anno::in_group("Emissive"),
anno::enable_if("enable_emission == true")
]],
// Cutout Opacity //
uniform bool enable_opacity = false [[
anno::display_name("Enable Opacity"),
anno::description("Enables the use of cutout opacity"),
anno::in_group("Opacity")
]],
uniform texture_2d opacity_texture = texture_2d() [[
anno::display_name("Opacity Map"),
anno::in_group("Opacity"),
anno::usage("opacity")
]],
float opacity_constant = float(1.0) [[
anno::display_name("Opacity Amount"),
anno::description("Opacity value between 0 and 1, when Opacity Map is not valid"),
anno::in_group("Opacity"),
anno::hard_range(float(0.0), float(1.0))
]],
uniform bool enable_opacity_texture = false [[
anno::display_name("Enable Opacity Texture"),
anno::description("Enables or disables the usage of the opacity texture map"),
anno::in_group("Opacity")
]],
uniform base::mono_mode opacity_mode = base::mono_average [[
anno::display_name("Opacity Mono Source"),
anno::description("Determines how to lookup opacity from the supplied texture. mono_alpha, mono_average, mono_luminance, mono_maximum"),
anno::in_group("Opacity")
]],
uniform float opacity_threshold = float(0.0) [[
anno::display_name("Opacity Threshold"),
anno::description("If 0, use fractional opacity values 'as is'; if > 0, remap opacity values to 1 when >= threshold and to 0 otherwise"),
anno::in_group("Opacity"),
anno::hard_range(float(0.0), float(1.0))
]],
// Clearcoat //
uniform bool enable_clearcoat = false [[
anno::display_name("Enable Clearcoat Layer"),
anno::description("Adds a clearcoat layer on top of the material when enabled"),
anno::in_group("Clearcoat")
]],
float clearcoat_weight = float(1.0) [[
anno::display_name("Clearcoat Weight"),
anno::description("Sets the weight for clearcoat layer"),
anno::in_group("Clearcoat"),
anno::hard_range(float(0.0), float(1.0))
]],
color clearcoat_tint = color(1.0) [[
anno::display_name("Clearcoat Tint"),
anno::description("Clearcoat is tinted and affects the underlying material"),
anno::in_group("Clearcoat")
]],
float clearcoat_transparency = float(1.0) [[
anno::display_name("Clearcoat Transparency"),
anno::description("Adjusts the transparency of the clearcoat. Can be turned into a fully opaque clearcoat covering the underlying layer"),
anno::in_group("Clearcoat"),
anno::hard_range(float(0.0), float(1.0))
]],
float clearcoat_reflection_roughness = float(0.0) [[
anno::display_name("Clearcoat Roughness"),
anno::description("Higher roughness values lead to more blurry reflections"),
anno::in_group("Clearcoat"),
anno::hard_range(float(0.0), float(1.0))
]],
float clearcoat_ior = float(1.56) [[
anno::display_name("Clearcoat IOR"),
anno::description("Sets the Index of refraction for the clearcoat layer"),
anno::in_group("Clearcoat"),
anno::soft_range(float(0.0), float(4.0))
]],
uniform float clearcoat_bump_factor = float(1.0) [[
anno::display_name("Clearcoat Normal Map Strength"),
anno::description("Strength of normal map."),
anno::in_group("Clearcoat"),
anno::soft_range(float(0.0), float(1.0))
]],
uniform texture_2d clearcoat_normalmap_texture = texture_2d() [[
anno::display_name("Clearcoat Normal Map"),
anno::description("Enables the usage of the normalmap texture"),
anno::in_group("Clearcoat"),
anno::usage("normal")
]],
uniform float2 clearcoat_texture_translate = float2(0.0) [[
anno::display_name("Clearcoat Texture Translate"),
anno::description("Controls the position of the clearcoat texture"),
anno::ui_order(1),
anno::in_group("UV")
]],
uniform float clearcoat_texture_rotate = float(0.0) [[
anno::display_name("Clearcoat Texture Rotate"),
anno::description("Rotates angle of the clearcoat texture in degrees"),
anno::ui_order(2),
anno::in_group("UV")
]],
uniform float2 clearcoat_texture_scale = float2(1.0) [[
anno::display_name("Clearcoat Texture Tiling"),
anno::description("Controls the repetition of the clearcoat texture"),
anno::ui_order(3),
anno::in_group("UV")
]],
float clearcoat_flatten = float(1.0) [[
anno::display_name("Clearcoat Flatten"),
anno::description("Flattens the clearcoat to even out the underlying bump maps"),
anno::in_group("Clearcoat"),
anno::hard_range(float(0.0), float(1.0))
]],
// Normal //
uniform float geometry_normal_roughness_strength = 1.f
[[
anno::hard_range(0.0, 1.0),
anno::display_name("Normal map to roughness weight"),
anno::description("Enables and weights roughness induced by normal maps"),
anno::in_group("Normal")
]],
uniform float bump_factor = float(1.0) [[
anno::display_name("Normal Strength"),
anno::description("Strength of normal map"),
anno::in_group("Normal"),
anno::soft_range(float(0.0), float(1.0))
]],
uniform texture_2d normalmap_texture = texture_2d() [[
anno::display_name("Normal Map"),
anno::in_group("Normal"),
anno::usage("normal")
]],
uniform float detail_bump_factor = float(0.3) [[
anno::display_name("Detail Normal Strength"),
anno::in_group("Normal"),
anno::description("Strength of the detail normal"),
anno::soft_range(float(0.0), float(1.0))
]],
uniform texture_2d detail_normalmap_texture = texture_2d() [[
anno::display_name("Detail Normal Map"),
anno::in_group("Normal"),
anno::usage("normal")
]],
uniform bool flip_tangent_u = false [[
anno::display_name("Normal Map Flip U Tangent"),
anno::in_group("Normal")
]],
uniform bool flip_tangent_v = true [[
anno::display_name("Normal Map Flip V Tangent"),
anno::in_group("Normal")
]],
// UVW Projection Group //
uniform bool project_uvw = false [[
anno::display_name("Enable Project UVW Coordinates"),
anno::description("When enabled, UV coordinates will be generated by projecting them from a coordinate system"),
anno::in_group("UV")
]],
uniform bool world_or_object = false [[
anno::display_name("Enable World Space"),
anno::description("When enabled, uses world space for projection, otherwise object space is used"),
anno::in_group("UV"),
anno::enable_if("project_uvw == true")
]],
uniform int uv_space_index = 0 [[
anno::display_name("UV Space Index"),
anno::description("UV Space Index"),
anno::in_group("UV"),
anno::enable_if("project_uvw == true"),
anno::hard_range(int(0), int(3))
]],
// UVW Adjustments Group //
uniform float2 texture_translate = float2(0.0) [[
anno::display_name("Texture Translate"),
anno::description("Controls position of texture."),
anno::in_group("UV"),
anno::enable_if("project_uvw == true")
]],
uniform float texture_rotate = float(0.0) [[
anno::display_name("Texture Rotate"),
anno::description("Rotates angle of texture in degrees."),
anno::in_group("UV"),
anno::enable_if("project_uvw == true")
]],
uniform float2 texture_scale = float2(1.0) [[
anno::display_name("Texture Tiling"),
anno::description("Controls repetition of the texture."),
anno::in_group("UV"),
anno::enable_if("project_uvw == true")
]],
uniform float2 detail_texture_translate = float2(0.0) [[
anno::display_name("Detail Texture Translate"),
anno::description("Controls the position of the detail texture."),
anno::in_group("UV"),
anno::enable_if("project_uvw == true")
]],
uniform float detail_texture_rotate = float(0.0) [[
anno::display_name("Detail Texture Rotate"),
anno::description("Rotates angle of the detail texture in degrees."),
anno::in_group("UV"),
anno::enable_if("project_uvw == true")
]],
uniform float2 detail_texture_scale = float2(1.0) [[
anno::display_name("Detail Texture Tiling"),
anno::description("Controls repetition of the detail texture."),
anno::in_group("UV"),
anno::enable_if("project_uvw == true")
]],
// Geometry //
uniform float round_edges_radius = float(0.0) [[
anno::display_name("Round Edge Radius"),
anno::description("Influence radius around the edges in meters"),
anno::in_group("Geometry"),
anno::soft_range(0.0, 1.0)
]],
uniform float round_edges_roundness = float(1.0) [[
anno::display_name("Round Edge Roundness"),
anno::description("Determines how round the edge will look"),
anno::in_group("Geometry"),
anno::hard_range(0.0, 1.0)
]],
uniform bool round_edges_across_materials = false [[
anno::display_name("Round Edge Across Materials"),
anno::description("Normal smoothing happens only between facets of equal material, \n"
"\t\tunless this parameter is set true, in which case the smoothing \n"
"\t\thappens between facets irrespective of their materials"),
anno::in_group("Geometry")
]]
)
[[
anno::display_name("OmniPBR ClearCoat "),
anno::description("OmniPBR Base with support for clear coat, opacity and ORM textures."),
anno::in_group("Base"),
anno::version( 2, 1, 1),
anno::author("NVIDIA CORPORATION"),
anno::key_words(string[]("omni", "PBR", "opacity", "clearcoat", "omniverse", "generic"))
]] = let {
// UVW lookup and transformation //
base::texture_coordinate_system the_system = world_or_object ? base::texture_coordinate_world : base::texture_coordinate_object;
base::texture_coordinate_info uvw = project_uvw ? base::coordinate_projection(
coordinate_system: the_system,
texture_space: uv_space_index,
projection_type: base::projection_cubic
) :
base::coordinate_source(
coordinate_system: base::texture_coordinate_uvw,
texture_space: uv_space_index
);
base::texture_coordinate_info transformed_uvw = base::transform_coordinate(
transform: rotation_translation_scale(
scaling: float3(texture_scale.x, texture_scale.y, 1.0),
rotation: float3(0.0, 0.0, texture_rotate/180.*math::PI ),
translation: float3(texture_translate.x, texture_translate.y, 0.0)
),
coordinate: uvw
);
base::texture_coordinate_info detail_transformed_uvw = base::transform_coordinate(
transform: rotation_translation_scale(
scaling: float3(detail_texture_scale.x, detail_texture_scale.y, 1.0),
rotation: float3(0.0, 0.0, detail_texture_rotate/180.*math::PI ),
translation: float3(detail_texture_translate.x, detail_texture_translate.y, 0.0)
),
coordinate: uvw
);
base::texture_coordinate_info clearcoat_transformed_uvw = base::transform_coordinate(
transform: rotation_translation_scale(
scaling: float3(clearcoat_texture_scale.x, clearcoat_texture_scale.y, 1.0),
rotation: float3(0.0, 0.0, clearcoat_texture_rotate/180.*math::PI ),
translation: float3(clearcoat_texture_translate.x, clearcoat_texture_translate.y, 0.f)
),
coordinate: uvw
);
// Normal calculations //
OmniPBRBase::NormalData defaultData = OmniPBRBase::NormalData(state::normal(), float2(0));
OmniPBRBase::NormalData normal_data = tex::texture_isvalid(normalmap_texture) ?
OmniPBRBase::tangent_space_normal_roughness_texture(
texture: normalmap_texture,
factor: bump_factor,
uvw: transformed_uvw,
flip_tangent_u: flip_tangent_u,
flip_tangent_v: flip_tangent_v // true for dx, false for opengl
//flip_tangent_v: true
) : defaultData;
float3 the_normal = normal_data.normal;
OmniPBRBase::NormalData detail_normal_data = tex::texture_isvalid(detail_normalmap_texture) ?
OmniPBRBase::tangent_space_normal_roughness_texture(
texture: detail_normalmap_texture,
factor: detail_bump_factor,
uvw: detail_transformed_uvw,
flip_tangent_u: flip_tangent_u,
flip_tangent_v: flip_tangent_v // true for dx, false for opengl
) : defaultData;
float3 detail_normal = detail_normal_data.normal;
OmniPBRBase::NormalData clearcoat_normal_data = tex::texture_isvalid(clearcoat_normalmap_texture) ?
OmniPBRBase::tangent_space_normal_roughness_texture(
texture: clearcoat_normalmap_texture,
factor: clearcoat_bump_factor,
uvw: clearcoat_transformed_uvw,
flip_tangent_u: flip_tangent_u,
flip_tangent_v: flip_tangent_v // true for dx, false for opengl
) : defaultData;
float3 clearcoat_normal = clearcoat_normal_data.normal;
float3 diffuse_gloss_normal = tex::texture_isvalid(detail_normalmap_texture) ? add_detail_normal(detail_normal, the_normal) : the_normal;
float3 flattened_clearcoat_normal = ::math::lerp(diffuse_gloss_normal, ::state::normal(), clearcoat_flatten);
float3 final_clearcoat_normal = tex::texture_isvalid(clearcoat_normalmap_texture) ? add_detail_normal(flattened_clearcoat_normal, clearcoat_normal)
: flattened_clearcoat_normal;
// ORM Handling //
float3 ORM_lookup = tex::lookup_float3(
tex: ORM_texture,
coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
);
float3 roughness_lookup = tex::lookup_float3(
tex: reflectionroughness_texture,
coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
);
float roughness_selection = enable_ORM_texture ? ORM_lookup.y : roughness_lookup.x;
float reflection_roughness_s = math::lerp(reflection_roughness_constant, roughness_selection, reflection_roughness_texture_influence);
float2 reflection_roughness = float2(math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.x * normal_data.roughness.x)),
math::sqrt(reflection_roughness_s*reflection_roughness_s + (geometry_normal_roughness_strength * normal_data.roughness.y * normal_data.roughness.y)));
float2 clearcoat_reflection_roughness2 = float2(math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.x * clearcoat_normal_data.roughness.x)),
math::sqrt(clearcoat_reflection_roughness*clearcoat_reflection_roughness + (geometry_normal_roughness_strength * clearcoat_normal_data.roughness.y * clearcoat_normal_data.roughness.y)));
// Diffuse Color Lookup and AO //
base::texture_return base_lookup = base::file_texture(
texture: diffuse_texture,
color_offset: color(albedo_add),
color_scale: color(albedo_brightness),
mono_source: base::mono_luminance,
uvw: transformed_uvw,
clip: false
);
base::texture_return ao_lookup = base::file_texture(
texture: ao_texture,
color_offset: color(0.0, 0.0, 0.0),
color_scale: color(1.0, 1.0, 1.0),
mono_source: base::mono_average,
uvw: transformed_uvw,
clip: false
);
color ao_color = enable_ORM_texture ? color(ORM_lookup.x) : ao_lookup.tint;
color desaturated_base = math::lerp(base_lookup.tint, color(base_lookup.mono), albedo_desaturation);
color diffuse = tex::texture_isvalid(diffuse_texture)? desaturated_base : diffuse_color_constant;
color tinted_diffuse = multiply_colors(diffuse, diffuse_tint, 1.0).tint;
color base_color = multiply_colors(
color_1: tinted_diffuse,
color_2: ao_color,
weight: ao_to_diffuse
).tint;
// Metalness //
float3 metallic_lookup = tex::lookup_float3(
tex: metallic_texture,
coord: float2(transformed_uvw.position.x, transformed_uvw.position.y)
);
float metallic_selection = enable_ORM_texture ? ORM_lookup.z : metallic_lookup.x;
float metallic = math::lerp(metallic_constant, metallic_selection, metallic_texture_influence);
// Emission //
color emission_color_texture = tex::texture_isvalid(emissive_color_texture) ?
base::file_texture(
texture: emissive_color_texture,
color_offset: color(0.0, 0.0, 0.0),
color_scale: color(1.0, 1.0, 1.0),
mono_source: base::mono_average,
uvw: transformed_uvw,
clip: false
).tint : emissive_color;
color emission_mask_texture = tex::texture_isvalid(emissive_mask_texture) ?
base::file_texture(
texture: emissive_mask_texture,
color_offset: color(0.0, 0.0, 0.0),
color_scale: color(1.0, 1.0, 1.0),
mono_source: base::mono_average,
uvw: transformed_uvw,
clip: false
).tint : color(1.0);
color final_emission_color = enable_emission ? emission_color_texture * emission_mask_texture: color(0.0);
// Opacity //
float opacity_value = enable_opacity_texture ? base::file_texture(
texture: opacity_texture,
mono_source: opacity_mode,
uvw: transformed_uvw
).mono : opacity_constant;
float cutout_opacity = enable_opacity ? ((opacity_threshold == 0.0) ? opacity_value : ((opacity_value >= opacity_threshold) ? 1.0 : 0)) : 1.0;
material base = OmniPBRBase::OmniPBRBase(
diffuse_reflection_color: base_color,
specular_reflection_aniso_roughness: reflection_roughness,
specular_level: specular_level,
metalness: metallic,
enable_emission: enable_emission,
emission_color: final_emission_color,
emission_intensity: emissive_intensity,
enable_coat: enable_clearcoat,
coat_weight: clearcoat_weight,
coat_color: clearcoat_tint,
coat_transparency: clearcoat_transparency,
coat_aniso_roughness: clearcoat_reflection_roughness2,
coat_ior: clearcoat_ior,
enable_opacity: enable_opacity,
geometry_opacity: cutout_opacity,
clearcoat_geometry_normal: final_clearcoat_normal,
round_edges_radius: round_edges_radius,
round_edges_roundness: round_edges_roundness,
round_edges_across_materials: round_edges_across_materials,
geometry_normal: diffuse_gloss_normal
);
} in material(
surface: base.surface,
geometry: base.geometry
);12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031/****************************************************************************** * Copyright 2023 NVIDIA Corporation. All rights reserved. * ****************************************************************************** Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,to any person obtaining a copy of the sample definition code that uses our Material Definition Language (the "MDL Materials"), to reproduce and distributethe MDL Materials, including without limitation the rights to use, copy, merge,publish, distribute, and sell modified and unmodified copies of the MDL Materials, and to permit persons to whom the MDL Materials is furnished to doso, in all cases solely for use with NVIDIA's Material Definition Language,subject to the following further conditions:
1. The above copyright notices, this list of conditions, and the disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, including in any software with which the MDL Materials are bundled,redistributed, and/or sold, and included either as stand-alone text files,human-readable headers or in the appropriate machine-readable metadata fieldswithin text or binary files as long as those fields can be easily viewed by theuser, as applicable.2. The name of NVIDIA shall not be used to promote, endorse or advertise any Modified Version without specific prior written permission, except a) to comply with the notice requirements otherwise contained herein; or b) to acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.5;
import ::anno::*;import ::base::*;import ::df::*;import ::math::*;import ::state::*;import ::tex::*;import ::nvidia::core_definitions::blend_colors;import ::nvidia::core_definitions::dimension;
const string COPYRIGHT = " Copyright 2023 NVIDIA Corporation. All rights reserved.\n"" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
const string DESCRIPTION = "Diffuse plastic polycarbonate material for rendering of diffuse plastic with volumetric exhaustion.";
export enum unit_scale[[ ::anno::hidden()]]{ unit_mm = 1, unit_cm = 2, unit_m = 3};
struct volume_info[[ ::anno::hidden()]]{ color absorption_coefficient; color scattering_coefficient;};
// simplified volume coefficients// This function takes a transmittance value and and albedo and translates it into meaningful// scattering and volume coefficients that are userfriendly//volume_info volume_transmittance_albedo( uniform float density_scale = 1.0, uniform color transmittance = color(0.5f), // transmittance color after unit distance uniform color albedo = color(1.0f)){ color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; color sigma_s = sigma_t * ::math::saturate(albedo); return volume_info( scattering_coefficient: sigma_s, absorption_coefficient: sigma_t - sigma_s);}
// This function calculates the apropriate scattering and volume coefficients// for a material of a given thickness. // The user specifies the thickness of the material, e.g. 3mm and the amount // of light passing through. The rest is automatically calculated for the material// and the material_volume is returned.volume_info custom_volume_transmittance( uniform unit_scale unit_scale_select = unit_mm, uniform float absorption_thickness = 3.0f, uniform color transmittance = color(0.5f), uniform color albedo = color(0.0f)){ absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; float scalefactor; switch(unit_scale_select){ case unit_mm: scalefactor = 0.001f; break; case unit_cm: scalefactor = 0.01f; break; case unit_m: scalefactor = 1.0f; break; default: scalefactor = 1.0f; } volume_info vol_coefficients = volume_transmittance_albedo( density_scale: 1.0f/(absorption_thickness * scalefactor), transmittance: transmittance, albedo: albedo ); return vol_coefficients;}
::base::texture_coordinate_info transform_coordinate_2( float4x4 transform [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix") ]], ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection") ]]) [[ ::anno::description("Transform a texture coordinate by a matrix") , ::anno::noinline() ]]{ // Version 2 float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. //just pretend there is no other rotation happening //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. float4 u = transform[0]; float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); float cos = ru.x; float sin = -ru.y; //TODO: at least also handle sign of z? //TODO: handle tangent becoming 0 return ::base::texture_coordinate_info( float3(r_position.x,r_position.y,r_position.z), ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));}
// Takes the standard input that every material has. It combines a couple of// functions in one convenience function.::base::texture_coordinate_info vmat_transform( float2 translation = float2(0.0, 0.0), float rotation = 0.0, // rotation in degrees float2 scaling = float2(1.0, 1.0), uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, uniform int uv_space = 0){ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; float4x4 scale = float4x4(1.0 /scaling.x, 0. , 0. , 0., 0. , 1.0 /scaling.y , 0. , 0., 0. , 0. , 1.0, 0., translation.x , translation.y , 0.0, 1.);
float s = ::math::sin(rotation_rad); float c = ::math::cos(rotation_rad); float4x4 rotate = float4x4( c , -s , 0.0 , 0.0, s , c , 0.0 , 0.0, 0.0, 0.0 , 1.0 , 0.0, 0. , 0.0 , 0.0 , 1.); return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));}
float2x2 invert_2x2(float2x2 M){ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);}
// https://nullprogram.com/blog/2018/07/31///bias: 0.17353355999581582 ( very probably the best of its kind )// NOTE: To turn this back to a float, one must divide the value by 4294967296.f // which corresponds to 0xffffffff, however MDL seems to turn this into -1.int lowbias32(int x){ x ^= x >>> 16; x *= 0x7feb352d; x ^= x >>> 15; x *= 0x846ca68b; x ^= x >>> 16; return x;}
float uint2float(int x){ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);}
float2 rnd22(int2 p) { float2 ret_val = float2( uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f ); return ret_val;}
float3 srgb2rgb(float3 val) { return ::math::pow(::math::max(val, float3(0.0f)), 2.2);}
float3 nonrepeat_lookup( uniform texture_2d texture = texture_2d(), ::base::texture_coordinate_info uvw = ::base::coordinate_source(), float texture_scale = 1.0, float3 average_color = float3(0.5), float patch_size = 8.0){ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; float Z = patch_size; // patch scale inside example texture float3 O = float3(0.f); float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space float2 U = uv_in; float2 V = M * uv_in; //pre-tilted hexa coordinates int2 I = int2(::math::floor(V)); // hexa-tile id // The mean color needs to be determined in Photoshop float3 m = average_color; float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates if( F[2] > 0.f )
O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); else O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); O = m + O/::math::length(W); O = ::math::clamp( (O), 0.0, 1.0); return float3(O);}
// NOTE: tex_resource must be in linear space (ensure that ::tex::gamma_linear is used)color endless_texture( uniform texture_2d texture = texture_2d(), ::base::texture_coordinate_info uvw = ::base::coordinate_source(), float texture_scale = 10.0, float3 average_color = float3(0.5, 0.5, 1.0), float patch_size = 8.0, bool gamma_correct_lookup = true){ return gamma_correct_lookup ? color(srgb2rgb( nonrepeat_lookup ( texture: texture, uvw: uvw, texture_scale: texture_scale, average_color: average_color, patch_size: patch_size )) ) : color(nonrepeat_lookup ( texture: texture, uvw: uvw, texture_scale: texture_scale, average_color: average_color, patch_size: patch_size ));}
export material Polycarbonate_Opaque( uniform bool thin_walled = false [[ ::anno::description("Makes the material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), ::anno::display_name("Thin Walled"), ::anno::ui_order(0) ]], float IOR = 1.586f [[ ::anno::description("Sets the Index of refraction."), ::anno::display_name("IOR"), ::anno::in_group("Appearance"), ::anno::ui_order(1) ]], float roughness = 0.f [[ ::anno::description("Hight values lead to a blurrier reflection."), ::anno::display_name("Roughness"), ::anno::in_group("Appearance"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(2) ]], uniform color diffuse_tint = color(0.752942f) [[ ::anno::description("Adjusts the diffuse color of the surface."), ::anno::display_name("Diffuse Tint"), ::anno::in_group("Appearance"), ::anno::ui_order(3) ]], uniform unit_scale units_absorption_thickness = unit_cm [[ ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), ::anno::display_name("Units Absorption Thickness "), ::anno::in_group("Appearance"), ::anno::ui_order(4) ]], uniform float absorption_thickness = 20.f [[ ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), ::anno::display_name("Absorption Thickness"), ::anno::in_group("Appearance"), ::anno::ui_order(5) ]], uniform color transmissive_tint = color(0.98f) [[ ::anno::description("Adjusts the transmissive color of the material. The color is influenced by the \"Diffuse Tint\" color parameter."), ::anno::display_name("Transmissive Tint"), ::anno::in_group("Appearance"), ::anno::ui_order(6) ]],// Smudges float smudges = 0.66f [[ ::anno::description("Adds smudges and fingerprints for a less clean and perfect look"), ::anno::display_name("Smudges"), ::anno::in_group("Appearance", "Smudges"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(7) ]], float2 smudge_scale = float2(1.f) [[ ::anno::description("Larger numbers increase the size."), ::anno::display_name("Smudge Scale"), ::anno::in_group("Appearance", "Smudges"), ::anno::soft_range(float2(0.f), float2(2.f)), ::anno::ui_order(8) ]], // Round Corners uniform bool round_corners = true [[// Transform ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are rquired to evaluate the round corner effect"), ::anno::display_name("Round Corners"), ::anno::in_group("Round Corners"), ::anno::ui_order(9) ]], uniform float radius = 1.5f [[ ::anno::description("Radius of the rounded corners"), ::anno::display_name("Radius mm"), ::anno::in_group("Round Corners"), ::anno::soft_range(0.f, 10.f), ::anno::ui_order(10) ]], uniform bool across_materials = false [[ ::anno::description("Applies the round corner effect across different materials when enabled."), ::anno::display_name("Across Materials"), ::anno::in_group("Round Corners"), ::anno::ui_order(11) ]], float2 texture_translate = float2(0.f) [[ ::anno::description("Controls the position of the texture."), ::anno::display_name("Texture Translate"), ::anno::in_group("Transform"), ::anno::ui_order(12) ]], float texture_rotate = 0.f [[ ::anno::description("Rotates angle of the texture in degrees."), ::anno::display_name("Texture Rotate"), ::anno::in_group("Transform"), ::anno::soft_range(0.f, 360.f), ::anno::ui_order(13) ]], float2 texture_scale = float2(1.f) [[ ::anno::description("Larger numbers increase the size."), ::anno::display_name("Texture Scale"), ::anno::in_group("Transform"), ::nvidia::core_definitions::dimension(float2(0.45f, .45f)), ::anno::soft_range(float2(0.f), float2(2.f)), ::anno::ui_order(14) ]], uniform int uv_space_index = 0 [[ ::anno::description("uses the selected UV space index."), ::anno::display_name("UV Space Index"), ::anno::in_group("Advanced"), ::anno::soft_range(0, 4), ::anno::ui_order(15) ]], float3 normal = ::state::normal() [[ ::anno::description("Override this input to provide a custom normal for the material."), ::anno::display_name("Normal"), ::anno::in_group("Advanced"), ::anno::ui_order(16) ]])[[ ::anno::display_name("Polycarbonate Opaque - White"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Opaque.png"), ::anno::copyright_notice(COPYRIGHT)]] = let { bool tmp0 = thin_walled; material_surface tmp1(::df::fresnel_layer(IOR, 1.f, ::df::microfacet_ggx_smith_bsdf((::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))) + roughness * 0.5f) * (::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))) + roughness * 0.5f), (::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))) + roughness * 0.5f) * (::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))) + roughness * 0.5f), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.508000016f, ::df::diffuse_reflection_bsdf(diffuse_tint, 0.f), ::df::weighted_layer(1.f, ::df::diffuse_transmission_bsdf(transmissive_tint), bsdf(), normal), normal), normal), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); color tmp3 = color(1.f, 1.f, 1.f); material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, color(0.214040995f, 0.214040995f, 0.214040995f), transmissive_tint).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, color(0.214040995f, 0.214040995f, 0.214040995f), transmissive_tint).scattering_coefficient); material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 0.00100000005f, across_materials, 1.f) : ::state::normal()); hair_bsdf tmp6 = hair_bsdf(); } in material( thin_walled: tmp0, surface: tmp1, backface: tmp2, ior: tmp3, volume: tmp4, geometry: tmp5, hair: tmp6);
export material Polycarbonate_Ivory(*)[[ ::anno::display_name("Polycarbonate Opaque - Ivory"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "ivory", "white", "light", "neutral")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Ivory.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.896269f, 0.838799f, 0.686685f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.955973f, 0.896269f, 0.730461f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Lemon(*)[[ ::anno::display_name("Polycarbonate Opaque - Lemon"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "lemon", "yellow", "saturated", "warm", "light")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Lemon.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.715694f, 0.715694f, 0.045186f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.964686f, 0.964686f, 0.059511f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Yellow(*)[[ ::anno::display_name("Polycarbonate Opaque - Yellow"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "yellow", "warm", "saturated", "light")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Yellow.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.871367f, 0.603827f, 0.045186f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.955973f, 0.686685f, 0.049707f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Dark_Orange(*)[[ ::anno::display_name("Polycarbonate Opaque - Dark Orange"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "dark", "orange", "saturated", "warm")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Orange.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.527115f, 0.127438f, 0.026241f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.955973f, 0.514918f, 0.040915f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Red(*)[[ ::anno::display_name("Polycarbonate Opaque - Red"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "red", "saturated", "warm")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Red.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.644480f, 0.036889f, 0.036889f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.921582f, 0.049707f, 0.049707f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Magenta(*)[[ ::anno::display_name("Polycarbonate Opaque - Magenta"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "magenta", "saturated", "warm")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Magenta.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.539479f, 0.051269f, 0.545724f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.921582f, 0.049707f, 0.144128f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Purple(*)[[ ::anno::display_name("Polycarbonate Opaque - Purple"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "purple", "saturated")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Purple.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.191202f, 0.022174f, 0.456411f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.412543f, 0.049707f, 0.921582f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Dark_Blue(*)[[ ::anno::display_name("Polycarbonate Opaque - Dark Blue"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "saturated", "cool", "dark")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Blue.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.031896f, 0.061246f, 0.304987f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.056128f, 0.135633f, 0.955973f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Blue(*)[[ ::anno::display_name("Polycarbonate Opaque - Blue"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "saturated", "cool")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Blue.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.038204f, 0.171441f, 0.838799f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.042311f, 0.194618f, 0.955973f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Sky_Blue(*)[[ ::anno::display_name("Polycarbonate Opaque - Sky Blue"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "sky", "light", "cool")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Sky_Blue.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.135633f, 0.356400f, 0.871367f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.070360f, 0.346704f, 0.964686f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Light_Blue(*)[[ ::anno::display_name("Polycarbonate Opaque - Light Blue"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "light", "cool")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Sky_Blue.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.258183f, 0.768151f, 0.822786f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.300544f, 0.896269f, 0.955973f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Teal(*)[[ ::anno::display_name("Polycarbonate Opaque - Teal"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "teal", "saturated", "cool")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Teal.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.040915f, 0.571125f, 0.323143f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.064803f, 0.955973f, 0.332452f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Dark_Green(*)[[ ::anno::display_name("Polycarbonate Opaque - Dark Green"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated", "dark")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Green.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.026241f, 0.141263f, 0.026241f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.086500f, 0.854993f, 0.086500f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Green(*)[[ ::anno::display_name("Polycarbonate Opaque - Green"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Green.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.023153f, 0.346704f, 0.023153f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.054480f, 0.938686f, 0.054480f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Light_Green(*)[[ ::anno::display_name("Polycarbonate Opaque - Light Green"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated", "light")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Light_Green.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.034340f, 0.679542f, 0.031896f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.054480f, 0.930111f, 0.054480f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Lime_Green(*)[[ ::anno::display_name("Polycarbonate Opaque - Lime Green"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "lime", "saturated", "light")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Lime_Green.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.208637f, 0.597202f, 0.031896f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.300544f, 0.879622f, 0.043735f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Black(*)[[ ::anno::display_name("Polycarbonate Opaque - Black"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "black", "dark", "neutral")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Black.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.038204f, 0.038204f, 0.038204f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.038204f, 0.038204f, 0.038204f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Dark_Gray(*)[[ ::anno::display_name("Polycarbonate Opaque - Dark Gray"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "gray", "dark", "neutral")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Dark_Gray.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.127438f, 0.127438f, 0.127438f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.822786f, 0.822786f, 0.822786f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polycarbonate_Light_Gray(*)[[ ::anno::display_name("Polycarbonate Opaque - Light Gray"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description(DESCRIPTION), ::anno::key_words(string[]("plastic", "polycarbonate", "PC", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "gray", "light", "neutral")), ::anno::thumbnail("./.thumbs/Polycarbonate_Opaque.Polycarbonate_Light_Gray.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polycarbonate_Opaque( thin_walled: false, IOR: 1.586f, roughness: 0.0f, diffuse_tint: color(0.456411f, 0.456411f, 0.456411f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.991102f, 0.991102f, 0.991102f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049/****************************************************************************** * Copyright 2023 NVIDIA Corporation. All rights reserved. * ****************************************************************************** Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,to any person obtaining a copy of the sample definition code that uses our Material Definition Language (the "MDL Materials"), to reproduce and distributethe MDL Materials, including without limitation the rights to use, copy, merge,publish, distribute, and sell modified and unmodified copies of the MDL Materials, and to permit persons to whom the MDL Materials is furnished to doso, in all cases solely for use with NVIDIA’s Material Definition Language,subject to the following further conditions:
1. The above copyright notices, this list of conditions, and the disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, including in any software with which the MDL Materials are bundled,redistributed, and/or sold, and included either as stand-alone text files,human-readable headers or in the appropriate machine-readable metadata fieldswithin text or binary files as long as those fields can be easily viewed by theuser, as applicable.2. The name of NVIDIA shall not be used to promote, endorse or advertise any Modified Version without specific prior written permission, except a) to comply with the notice requirements otherwise contained herein; or b) to acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::base::*;import ::df::*;import ::math::*;import ::state::*;import ::tex::*;import ::nvidia::core_definitions::blend_colors;import ::nvidia::core_definitions::dimension;
const string COPYRIGHT = " Copyright 2023 NVIDIA Corporation. All rights reserved.\n"" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
export enum unit_scale[[ ::anno::hidden()]]{ unit_mm = 1, unit_cm = 2, unit_m = 3};
struct volume_info[[ ::anno::hidden()]]{ color absorption_coefficient; color scattering_coefficient;};
// simplified volume coefficients// This function takes a transmittance value and and albedo and translates it into meaningful// scattering and volume coefficients that are userfriendly//volume_info volume_transmittance_albedo( uniform float density_scale = 1.0, uniform color transmittance = color(0.5f), // transmittance color after unit distance uniform color albedo = color(1.0f)){ color sigma_t = -::math::log(::math::saturate(transmittance)) * density_scale; color sigma_s = sigma_t * ::math::saturate(albedo); return volume_info( scattering_coefficient: sigma_s, absorption_coefficient: sigma_t - sigma_s);}
// This function calculates the apropriate scattering and volume coefficients// for a material of a given thickness. // The user specifies the thickness of the material, e.g. 3mm and the amount // of light passing through. The rest is automatically calculated for the material// and the material_volume is returned.volume_info custom_volume_transmittance( uniform unit_scale unit_scale_select = unit_mm, uniform float absorption_thickness = 3.0f, uniform color transmittance = color(0.5f), uniform color albedo = color(0.0f)){ absorption_thickness = (absorption_thickness <= 0.0f) ? 0.00001 : absorption_thickness; float scalefactor; switch(unit_scale_select){ case unit_mm: scalefactor = 0.001f; break; case unit_cm: scalefactor = 0.01f; break; case unit_m: scalefactor = 1.0f; break; default: scalefactor = 1.0f; } volume_info vol_coefficients = volume_transmittance_albedo( density_scale: 1.0f/(absorption_thickness * scalefactor), transmittance: transmittance, albedo: albedo ); return vol_coefficients;}
::base::texture_coordinate_info transform_coordinate_2( float4x4 transform [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix") ]], ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection") ]]) [[ ::anno::description("Transform a texture coordinate by a matrix") , ::anno::noinline() ]]{ // Version 2 float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. //just pretend there is no other rotation happening //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. float4 u = transform[0]; float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); float cos = ru.x; float sin = -ru.y; //TODO: at least also handle sign of z? //TODO: handle tangent becoming 0 return ::base::texture_coordinate_info( float3(r_position.x,r_position.y,r_position.z), ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));}
// Takes the standard input that every material has. It combines a couple of// functions in one convenience function.::base::texture_coordinate_info vmat_transform( float2 translation = float2(0.0, 0.0), float rotation = 0.0, // rotation in degrees float2 scaling = float2(1.0, 1.0), uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, uniform int uv_space = 0){ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; float4x4 scale = float4x4(1.0 /scaling.x, 0. , 0. , 0., 0. , 1.0 /scaling.y , 0. , 0., 0. , 0. , 1.0, 0., translation.x , translation.y , 0.0, 1.);
float s = ::math::sin(rotation_rad); float c = ::math::cos(rotation_rad); float4x4 rotate = float4x4( c , -s , 0.0 , 0.0, s , c , 0.0 , 0.0, 0.0, 0.0 , 1.0 , 0.0, 0. , 0.0 , 0.0 , 1.); return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));}
float2x2 invert_2x2(float2x2 M){ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);}
// https://nullprogram.com/blog/2018/07/31///bias: 0.17353355999581582 ( very probably the best of its kind )// NOTE: To turn this back to a float, one must divide the value by 4294967296.f // which corresponds to 0xffffffff, however MDL seems to turn this into -1.int lowbias32(int x){ x ^= x >>> 16; x *= 0x7feb352d; x ^= x >>> 15; x *= 0x846ca68b; x ^= x >>> 16; return x;}
float uint2float(int x){ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);}
float2 rnd22(int2 p) { float2 ret_val = float2( uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f ); return ret_val;}
float3 srgb2rgb(float3 val) { return ::math::pow(::math::max(val, float3(0.0f)), 2.2);}
float3 nonrepeat_lookup( uniform texture_2d texture = texture_2d(), ::base::texture_coordinate_info uvw = ::base::coordinate_source(), float texture_scale = 1.0, float3 average_color = float3(0.5), float patch_size = 8.0){ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; float Z = patch_size; // patch scale inside example texture float3 O = float3(0.f); float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space float2 U = uv_in; float2 V = M * uv_in; //pre-tilted hexa coordinates int2 I = int2(::math::floor(V)); // hexa-tile id // The mean color needs to be determined in Photoshop float3 m = average_color; float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates if( F[2] > 0.f )
O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m) + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m) + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m); else O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m) + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m) + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m); O = m + O/::math::length(W); O = ::math::clamp( (O), 0.0, 1.0); return float3(O);}
// NOTE: tex_resource must be in linear space (ensure that ::tex::gamma_linear is used)color endless_texture( uniform texture_2d texture = texture_2d(), ::base::texture_coordinate_info uvw = ::base::coordinate_source(), float texture_scale = 10.0, float3 average_color = float3(0.5, 0.5, 1.0), float patch_size = 8.0, bool gamma_correct_lookup = true){ return gamma_correct_lookup ? color(srgb2rgb( nonrepeat_lookup ( texture: texture, uvw: uvw, texture_scale: texture_scale, average_color: average_color, patch_size: patch_size )) ) : color(nonrepeat_lookup ( texture: texture, uvw: uvw, texture_scale: texture_scale, average_color: average_color, patch_size: patch_size ));}
export material Polypropylene_Opaque(
// Appearance uniform bool thin_walled = false [[ ::anno::description("Makes t he material thin-walled. This changes the behavior of the material in a way that light attenuation is not calculated volumetrically as light travels through the geometry but at the light surface level. Thin walled geometry mustbe modeled as a single sheet without any volume."), ::anno::display_name("Thin Walled"), ::anno::in_group("Appearance"), ::anno::ui_order(0) ]], float IOR = 1.49f [[ ::anno::description("Sets the Index of refraction. For PP the ior is typically 1.49."), ::anno::display_name("IOR"), ::anno::in_group("Appearance"), ::anno::hard_range(1.1f, 3.0f), ::anno::ui_order(1) ]], float roughness = 0.f [[ ::anno::description("Hight values lead to a blurrier reflection."), ::anno::display_name("Roughness"), ::anno::in_group("Appearance"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(2) ]], color diffuse_tint = color(0.752942f) [[ ::anno::description("Adjusts the diffuse color of the surface."), ::anno::display_name("Diffuse Tint"), ::anno::in_group("Appearance"), ::anno::ui_order(3) ]], uniform unit_scale units_absorption_thickness = unit_cm [[ ::anno::description("Chooses the units that are used for setting the absorption thickness. Can be meters, centimeters or millimeters."), ::anno::display_name("Units Absorption Thickness "), ::anno::in_group("Appearance"), ::anno::ui_order(4) ]], uniform float absorption_thickness = 20.f [[ ::anno::description("The thickness for which the transmittance (color) is set. Example: If thickness is set to 3mm and transmittance to 0.8, then 80% of the light will pass through a 3mm thick material."), ::anno::display_name("Absorption Thickness"), ::anno::in_group("Appearance"), ::anno::ui_order(5) ]], uniform color transmissive_tint = color(1.000000f) [[ ::anno::description("Adjusts the transmissive color of the material. The color is influenced by the \"Diffuse Tint\" color parameter."), ::anno::display_name("Transmissive Tint"), ::anno::in_group("Appearance"), ::anno::ui_order(6) ]], // Smudges float smudges = 0.10f [[ ::anno::description("Determines the amount of smudges that appears on the surface of the material."), ::anno::display_name("Smudges"), ::anno::in_group("Appearance", "Smudges"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(7) ]], float2 smudge_scale = float2(1.f) [[ ::anno::description("Larger numbers increase the size."), ::anno::display_name("Smudge Scale"), ::anno::in_group("Appearance", "Smudges"), ::anno::soft_range(float2(0.f), float2(2.f)), ::anno::ui_order(8) ]], // Transform float2 texture_translate = float2(0.f) [[ ::anno::description("Controls the position of the texture."), ::anno::display_name("Texture Translate"), ::anno::in_group("Transform"), ::anno::ui_order(9) ]], float texture_rotate = 0.f [[ ::anno::description("Rotates angle of the texture in degrees."), ::anno::display_name("Texture Rotate"), ::anno::in_group("Transform"), ::anno::soft_range(0.f, 360.f), ::anno::ui_order(10) ]], float2 texture_scale = float2(1.f) [[ ::anno::description("Larger numbers increase the size."), ::anno::display_name("Texture Scale"), ::nvidia::core_definitions::dimension(float2(0.45f, .45f)), ::anno::in_group("Transform"), ::anno::soft_range(float2(0.f), float2(2.f)), ::anno::ui_order(11) ]], // Round Corners uniform bool round_corners = true [[ ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are required to evaluate the round corner effect."), ::anno::display_name("Round Corners"), ::anno::in_group("Round Corners"), ::anno::ui_order(12) ]], uniform float radius = 0.5f [[ ::anno::description("Radius of the rounded corners."), ::anno::display_name("Radius mm"), ::anno::in_group("Round Corners"), ::anno::soft_range(0.f, 10.f), ::anno::ui_order(13) ]], uniform bool across_materials = false [[ ::anno::description("Applies the round corner effect across different materials when enabled."), ::anno::display_name("Across Materials"), ::anno::in_group("Round Corners"), ::anno::ui_order(14) ]], // Advanced uniform int uv_space_index = 0 [[ ::anno::description("Uses the selected UV space index."), ::anno::display_name("UV Space Index"), ::anno::in_group("Advanced"), ::anno::soft_range(0, 4), ::anno::ui_order(15) ]], float3 normal = ::state::normal() [[ ::anno::description("Override this input to provide a custom normal for the material."), ::anno::display_name("Normal"), ::anno::in_group("Advanced"), ::anno::ui_order(16) ]])[[ ::anno::description("A polypropylene plastic material."), ::anno::display_name("Polypropylene Opaque - White"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Opaque.png"), ::anno::copyright_notice(COPYRIGHT)]] = let { bool tmp0 = thin_walled; material_surface tmp1(::df::fresnel_layer(IOR, 1.f, ::df::microfacet_ggx_smith_bsdf((::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))) + roughness * 0.5f) * (::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))) + roughness * 0.5f), (::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))) + roughness * 0.5f) * (::math::pow(::math::max(float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[0] * smudges, float3(endless_texture(texture_2d("./textures/plastic_smudges.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale * smudge_scale, ::base::texture_coordinate_uvw, uv_space_index), 4.f, float3(0.059f, 0.051f, 0.125f), 4.f, false))[1] * smudges), ::math::lerp(2.5f, 0.5f, ::math::pow(smudges, 0.25f))) + roughness * 0.5f), color(1.f, 1.f, 1.f), color(0.f, 0.f, 0.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.508f, ::df::diffuse_reflection_bsdf(diffuse_tint, 0.f), ::df::weighted_layer(1.f, ::df::diffuse_transmission_bsdf(color(0.196521997f, 1.f, 0.187316999f)), bsdf(), normal), normal), normal), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); color tmp3 = color(1.f, 1.f, 1.f); material_volume tmp4 = thin_walled ? material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)) : material_volume(vdf(), custom_volume_transmittance(units_absorption_thickness, absorption_thickness, color(0.214f, 0.214f, 0.214f), transmissive_tint).absorption_coefficient, custom_volume_transmittance(units_absorption_thickness, absorption_thickness, color(0.214f, 0.214f, 0.214f), transmissive_tint).scattering_coefficient); material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 0.001f, across_materials, 1.f) : ::state::normal()); hair_bsdf tmp6 = hair_bsdf(); } in material( thin_walled: tmp0, surface: tmp1, backface: tmp2, ior: tmp3, volume: tmp4, geometry: tmp5, hair: tmp6);
export material Polypropylene_Ivory(*)[[ ::anno::display_name("Polypropylene Opaque - Ivory"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "ivory", "white", "light", "neutral")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Ivory.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.896269f, 0.838799f, 0.686685f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.955973f, 0.896269f, 0.730461f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Lemon(*)[[ ::anno::display_name("Polypropylene Opaque - Lemon"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "lemon", "yellow", "saturated", "warm", "light")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Lemon.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.715694f, 0.715694f, 0.045186f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.964686f, 0.964686f, 0.059511f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Yellow(*)[[ ::anno::display_name("Polypropylene Opaque - Yellow"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "yellow", "warm", "saturated", "light")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Yellow.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.871367f, 0.603827f, 0.045186f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.955973f, 0.686685f, 0.049707f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Dark_Orange(*)[[ ::anno::display_name("Polypropylene Opaque - Dark Orange"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "dark", "orange", "saturated", "warm")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Orange.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.527115f, 0.127438f, 0.026241f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.955973f, 0.514918f, 0.040915f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Red(*)[[ ::anno::display_name("Polypropylene Opaque - Red"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "red", "saturated", "warm")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Red.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.644480f, 0.036889f, 0.036889f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.921582f, 0.049707f, 0.049707f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Magenta(*)[[ ::anno::display_name("Polypropylene Opaque - Magenta"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "magenta", "saturated", "warm")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Magenta.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.539479f, 0.051269f, 0.545724f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.921582f, 0.049707f, 0.144128f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Purple(*)[[ ::anno::display_name("Polypropylene Opaque - Purple"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "purple", "saturated")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Purple.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.191202f, 0.022174f, 0.456411f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.412543f, 0.049707f, 0.921582f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Dark_Blue(*)[[ ::anno::display_name("Polypropylene Opaque - Dark Blue"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "saturated", "cool", "dark")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Blue.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.031896f, 0.061246f, 0.304987f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.056128f, 0.135633f, 0.955973f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Blue(*)[[ ::anno::display_name("Polypropylene Opaque - Blue"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "saturated", "cool")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Blue.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.038204f, 0.171441f, 0.838799f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.042311f, 0.194618f, 0.955973f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Sky_Blue(*)[[ ::anno::display_name("Polypropylene Opaque - Sky Blue"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "sky", "light", "cool")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Sky_Blue.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.135633f, 0.356400f, 0.871367f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.070360f, 0.346704f, 0.964686f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Light_Blue(*)[[ ::anno::display_name("Polypropylene Opaque - Light Blue"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "blue", "light", "cool")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Sky_Blue.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.258183f, 0.768151f, 0.822786f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.300544f, 0.896269f, 0.955973f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Teal(*)[[ ::anno::display_name("Polypropylene Opaque - Teal"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "teal", "saturated", "cool")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Teal.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.040915f, 0.571125f, 0.323143f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.064803f, 0.955973f, 0.332452f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Dark_Green(*)[[ ::anno::display_name("Polypropylene Opaque - Dark Green"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated", "dark")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Green.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.026241f, 0.141263f, 0.026241f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.086500f, 0.854993f, 0.086500f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Green(*)[[ ::anno::display_name("Polypropylene Opaque - Green"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Green.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.023153f, 0.346704f, 0.023153f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.054480f, 0.938686f, 0.054480f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Light_Green(*)[[ ::anno::display_name("Polypropylene Opaque - Light Green"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "saturated", "light")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Light_Green.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.034340f, 0.679542f, 0.031896f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.054480f, 0.930111f, 0.054480f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Lime_Green(*)[[ ::anno::display_name("Polypropylene Opaque - Lime Green"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "green", "lime", "saturated", "light")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Lime_Green.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.208637f, 0.597202f, 0.031896f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.300544f, 0.879622f, 0.043735f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Black(*)[[ ::anno::display_name("Polypropylene Opaque - Black"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "black", "dark", "neutral")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Black.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.038204f, 0.038204f, 0.038204f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.038204f, 0.038204f, 0.038204f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Dark_Gray(*)[[ ::anno::display_name("Polypropylene Opaque - Dark Gray"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "gray", "dark", "neutral")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Dark_Gray.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.127438f, 0.127438f, 0.127438f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.822786f, 0.822786f, 0.822786f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
export material Polypropylene_Light_Gray(*)[[ ::anno::display_name("Polypropylene Opaque - Light Gray"), ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Ruediger Raab"), ::anno::contributor("Maik Rohland"), ::anno::description("Diffuse plastic polypropylene material for rendering of diffuse plastic with volumetric exhaustion."), ::anno::key_words(string[]("plastic", "polypropylene", "PP", "synthetic", "opaque", "design", "packaging", "molded", "smudged", "smudges", "infinite tiling", "smooth", "gray", "light", "neutral")), ::anno::thumbnail("./.thumbs/Polypropylene_Opaque.Polypropylene_Light_Gray.png"), ::anno::copyright_notice(COPYRIGHT)]] = Polypropylene_Opaque( thin_walled: false, IOR: 1.49f, roughness: 0.0f, diffuse_tint: color(0.456411f, 0.456411f, 0.456411f), units_absorption_thickness: unit_cm, absorption_thickness: 20.0f, transmissive_tint: color(0.991102f, 0.991102f, 0.991102f), smudges: 0.1f, smudge_scale: float2(1.0f), texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: false, uv_space_index: 0);
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718/****************************************************************************** * Copyright 2023 NVIDIA Corporation. All rights reserved. * ******************************************************************************
Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,to any person obtaining a copy of the sample definition code that uses ourMaterial Definition Language (the "MDL Materials"), to reproduce and distributethe MDL Materials, including without limitation the rights to use, copy, merge,publish, distribute, and sell modified and unmodified copies of the MDLMaterials, and to permit persons to whom the MDL Materials is furnished to doso, in all cases solely for use with NVIDIA's Material Definition Language,subject to the following further conditions:
1. The above copyright notices, this list of conditions, and the disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, including in any software with which the MDL Materials are bundled,redistributed, and/or sold, and included either as stand-alone text files,human-readable headers or in the appropriate machine-readable metadata fieldswithin text or binary files as long as those fields can be easily viewed by theuser, as applicable.2. The name of NVIDIA shall not be used to promote, endorse or advertise anyModified Version without specific prior written permission, except a) to comply with the notice requirements otherwise contained herein; or b) to acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FORANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OFCONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.5;
import ::anno::*;import ::base::*;import ::df::*;import ::math::*;import ::state::*;import ::tex::*;import ::nvidia::core_definitions::blend_colors;import ::nvidia::core_definitions::dimension;
const string COPYRIGHT =" Copyright 2023 NVIDIA Corporation. All rights reserved.\n"" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n"" THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n"" COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
const string DESCRIPTION = "A semi aniline leather material";
annotation preview_scale( float f);
float2x2 invert_2x2(float2x2 M){ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);}
float uint2float(int x){ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);}
int lowbias32(int x){ x ^= x >>> 16; x *= 0x7feb352d; x ^= x >>> 15; x *= 0x846ca68b; x ^= x >>> 16; return x;}
float2 rnd22(int2 p) { float2 ret_val = float2( uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f ); return ret_val;}
float3 srgb2rgb(float3 val) { return ::math::pow(::math::max(val, float3(0.0f)), 2.2);}
float3 nonrepeat_lookup( uniform texture_2d texture = texture_2d(), ::base::texture_coordinate_info uvw = ::base::coordinate_source(), float texture_scale = 1.0, float3 average_color = float3(0.5), float patch_size = 8.0){ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; float Z = patch_size; // patch scale inside example texture float CON = 1.0f; float3 O = float3(0.f); float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space float2 U = uv_in; float2 V = M * uv_in; //pre-tilted hexa coordinates int2 I = int2(::math::floor(V)); // hexa-tile id // The mean color needs to be determined in Photoshop then to make the // average color work out, take the float value and calculate the apropriate // mean value as (value^(1/2.2))
float3 m = average_color; float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates if( F[2] > 0.f )
O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); else O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); O = m + O/::math::length(W); O = ::math::clamp( (O), 0.0, 1.0); return float3(O);}
float3 endless_normal( uniform texture_2d texture = texture_2d(), float factor = 1.0, bool flip_tangent_u = false, bool flip_tangent_v = false, ::base::texture_coordinate_info uvw = ::base::coordinate_source(), float texture_scale = 1.0, float3 average_color = float3(0.5, 0.5, 1.0), float patch_size = 8.0 //bool srgb2rgb = false, //bool rgb2srgb = false){ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; if (flip_tangent_u) transformed_tangent_u=-transformed_tangent_u; if (flip_tangent_v) transformed_tangent_v=-transformed_tangent_v;
// normalized Lookup float3 tangent_space_normal = (nonrepeat_lookup ( texture: texture, uvw: uvw, texture_scale: texture_scale, average_color: average_color, patch_size: patch_size ) - 0.5) * (2.0 * factor); return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + uvw.tangent_v * tangent_space_normal.y + ::state::normal()*1.0); //return ::state::normal();}
color endless_texture( uniform texture_2d texture = texture_2d(), ::base::texture_coordinate_info uvw = ::base::coordinate_source(), float texture_scale = 10.0, float3 average_color = float3(0.5, 0.5, 1.0), float patch_size = 8.0, bool gamma_correct_lookup = true){ return gamma_correct_lookup ? color(srgb2rgb( nonrepeat_lookup ( texture: texture, uvw: uvw, texture_scale: texture_scale, average_color: average_color, patch_size: patch_size )) ) : color(nonrepeat_lookup ( texture: texture, uvw: uvw, texture_scale: texture_scale, average_color: average_color, patch_size: patch_size ));}
float histogram_range(float input, float range = 1.0f, float position = 0.5f){ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); return ::math::lerp(low, high, input);}
float remap_xy_to_0_1(float input, float x, float y){ return (input - x)/(y - x);}
float histogram_scan_big(float input, float width, float position){ return ::math::clamp( remap_xy_to_0_1(input, ::math::lerp(-width, 1.0, position), ::math::lerp(0.0, 1.0 + width, position)), 0.0, 1.0);}
float3 normalmap_normal( uniform texture_2d texture, float factor = 1.0, ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info()){ float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0); return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + ::state::normal() * (lookup.z + (1.0 - factor)));}
::base::texture_coordinate_info transform_coordinate_2( float4x4 transform [[ ::anno::description("A transformation to be applied to the source coordinates. rotation_translation_scale() is a suggested means to compute the transformation matrix") ]], ::base::texture_coordinate_info coordinate = ::base::texture_coordinate_info() [[ ::anno::description("Coordinate, typically sourced from coordinate_source or coordinate_projection") ]]) [[ ::anno::description("Transform a texture coordinate by a matrix") , ::anno::noinline() ]]{ /* // Version 1 float4 r_position = float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1)* transform; float4 r_tangent_u = float4(coordinate.tangent_u.x,coordinate.tangent_u.y,coordinate.tangent_u.z,1)* transform; float4 r_tangent_v = float4(coordinate.tangent_v.x,coordinate.tangent_v.y,coordinate.tangent_v.z,1)* transform; return ::base::texture_coordinate_info( float3(r_position.x,r_position.y,r_position.z), float3(r_tangent_u.x,r_tangent_u.y,r_tangent_u.z), // orthogonalization float3(r_tangent_v.x,r_tangent_v.y,r_tangent_v.z));// orthogonalization */ // Version 2 float4 r_position = transform * float4(coordinate.position.x,coordinate.position.y,coordinate.position.z,1); //Try aproximating it for the case that the rotation is only aroud z and assuming the texture layout is nice and z is ~constant. //just pretend there is no other rotation happening //get rid of scaling and translation. Then extract fields where sin and cos would be in a simple 2d transform around z. float4 u = transform[0]; float3 ru = ::math::normalize(float3(u.x,u.y,u.z)); float cos = ru.x; float sin = -ru.y; //TODO: at least also handle sign of z? //TODO: handle tangent becoming 0 return ::base::texture_coordinate_info( float3(r_position.x,r_position.y,r_position.z), ::math::normalize(cos * coordinate.tangent_u - sin * coordinate.tangent_v), ::math::normalize(cos * coordinate.tangent_v + sin * coordinate.tangent_u));}
::base::texture_coordinate_info vmat_transform( float2 translation = float2(0.0, 0.0), float rotation = 0.0, // rotation in degrees float2 scaling = float2(1.0, 1.0), uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, uniform int uv_space = 0){ float rotation_rad = (rotation * 3.1415926535897932384626433832f) / 180.f; float4x4 scale = float4x4(1.0 /scaling.x, 0. , 0. , 0., 0. , 1.0 /scaling.y , 0. , 0., 0. , 0. , 1.0, 0., translation.x , translation.y , 0.0, 1.);
float s = ::math::sin(rotation_rad); float c = ::math::cos(rotation_rad); float4x4 rotate = float4x4( c , -s , 0.0 , 0.0, s , c , 0.0 , 0.0, 0.0, 0.0 , 1.0 , 0.0, 0. , 0.0 , 0.0 , 1.); return transform_coordinate_2(scale*rotate, ::base::coordinate_source(system, uv_space));}
export material Semi_Aniline_Leather( uniform bool infinite_tiling = true [[ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."), ::anno::display_name("Infinite Tiling"), ::anno::in_group("Appearance") ]], float bump_strength = 0.3f [[ ::anno::description("Specifies the strength of the bump."), ::anno::display_name("Bump Strength"), ::anno::in_group("Appearance"), ::anno::hard_range(0.f, 1.f) ]], color leather_color = color(0.176774f, 0.056374f, 0.012664f) [[ ::anno::description("Choose the color of the front side."), ::anno::display_name("Color Front"), ::anno::in_group("Appearance", "Front") ]], float diffuse_brightness_front = 0.3f [[ ::anno::description("Adjusts the lightness of the material"), ::anno::display_name("Brightness Front"), ::anno::in_group("Appearance", "Front"), ::anno::hard_range(0.f, 1.f) ]], float reflection_roughness_front = 0.15f [[ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), ::anno::display_name("Roughness Front"), ::anno::in_group("Appearance", "Front"), ::anno::hard_range(0.f, 1.f) ]], float imperfections_dust = 0.07f [[ ::anno::description("Adds specular variation to the roughness."), ::anno::display_name("Imperfection Dust"), ::anno::in_group("Appearance", "Front", "Imperfections"), ::anno::hard_range(0.f, 1.f) ]], float imperfections_grunge = 0.13f [[ ::anno::description("Adds specular variation to the roughness."), ::anno::display_name("Imperfection Grunge"), ::anno::in_group("Appearance", "Front", "Imperfections"), ::anno::hard_range(0.f, 1.f) ]], float imperfections_smudges = 0.87f [[ ::anno::description("Adds specular variation to the roughness."), ::anno::display_name("Imperfection Smudges"), ::anno::in_group("Appearance", "Front", "Imperfections"), ::anno::hard_range(0.f, 1.f) ]], color color_back_leather = color(0.098689f, 0.046149f, 0.020951f) [[ ::anno::description("Choose the color of the back side."), ::anno::display_name("Color Back"), ::anno::in_group("Appearance", "Back") ]], float color_brightness_back = 0.5f [[ ::anno::description("Adjusts the lightness of the material"), ::anno::display_name("Brightness Back"), ::anno::in_group("Appearance", "Back"), ::anno::hard_range(0.f, 1.f) ]], float reflection_roughness_back = 0.65f [[ ::anno::description("Higher roughness values lead to bigger highlights and blurrier reflections."), ::anno::display_name("Roughness Back"), ::anno::in_group("Appearance", "Back"), ::anno::hard_range(0.f, 1.f) ]], uniform bool dirt_back_on_off = false [[ ::anno::description("Switch on and off the dirt layer on the backside."), ::anno::display_name("Dirt Back"), ::anno::in_group("Appearance", "Dirt") ]], color dirt_color = color(0.160444f, 0.016988f, 0.016988f) [[ ::anno::description("Choose the color of the dirt layer."), ::anno::display_name("Dirt Color"), ::anno::in_group("Appearance", "Dirt") ]], float softness = 0.66f [[ ::anno::description("Adjust the transition between dirt and leather. From hard to soft."), ::anno::display_name("Dirt Softness"), ::anno::in_group("Appearance", "Dirt"), ::anno::hard_range(0.f, 1.f) ]], float position = 0.25f [[ ::anno::description("Adjust the intensity through position."), ::anno::display_name("Dirt Amount"), ::anno::in_group("Appearance", "Dirt"), ::anno::hard_range(0.f, 1.f) ]], float2 texture_translate = float2(0.f) [[ ::anno::description("Controls the position of the texture."), ::anno::display_name("Translate"), ::anno::in_group("Transform") ]], float texture_rotate = 0.f [[ ::anno::description("Rotates angle of the texture in degrees."), ::anno::display_name("Rotate"), ::anno::in_group("Transform") ]], float2 texture_scale = float2(1.0f) [[ ::anno::description("Larger numbers increase the size."), ::anno::display_name("Scale"), ::nvidia::core_definitions::dimension(float2(1.0f, 1.0f)), ::preview_scale(2.5f), ::anno::in_group("Transform") ]], uniform bool round_corners = false [[ ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are rquired to evaluate the round corner effect"), ::anno::display_name("Round Corners"), ::anno::in_group("Round Corners") ]], uniform float radius = 1.5f [[ ::anno::description("Radius of the rounded corners"), ::anno::display_name("Radius mm"), ::anno::in_group("Round Corners"), ::anno::soft_range(0.f, 10.f) ]], uniform bool across_materials = true [[ ::anno::description("Applies the round corner effect across different materials when enabled."), ::anno::display_name("Across Materials"), ::anno::in_group("Round Corners") ]], uniform int uv_space_index = 0 [[ ::anno::description("Use selected UV space for material"), ::anno::display_name("UV Space Index"), ::anno::in_group("Advanced") ]])[[ ::anno::description(DESCRIPTION), ::anno::display_name("Semi Aniline Leather"), ::anno::copyright_notice(COPYRIGHT), ::anno::key_words(string[]("leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi")), ::anno::author("Nvidia vMaterials"), ::anno::contributor("Maik Rohland"), ::anno::contributor("Ruediger Raab"), ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Leather.png")]] = let { float2 texture_scale_rescaled = texture_scale / 5.0f; bool tmp0 = true; material_surface tmp1(::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, position) - softness, ::math::lerp(1.f, 0.f, position) + softness, float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.708999991f, 0.393999994f, 0.836000025f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1])), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.708999991f, 0.393999994f, 0.836000025f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.761000037f, 0.582000017f), ::df::microfacet_ggx_smith_bsdf(((float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfections_dust + histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.708999991f, 0.393999994f, 0.836000025f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.5f, ::math::lerp(0.286000013f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfections_grunge + (float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfections_smudges) * ((float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfections_dust + histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.708999991f, 0.393999994f, 0.836000025f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.5f, ::math::lerp(0.286000013f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfections_grunge + (float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfections_smudges), ((float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfections_dust + histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.708999991f, 0.393999994f, 0.836000025f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.5f, ::math::lerp(0.286000013f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfections_grunge + (float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfections_smudges) * ((float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[0] * imperfections_dust + histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.708999991f, 0.393999994f, 0.836000025f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.5f, ::math::lerp(0.286000013f, 0.75f, reflection_roughness_front)) + (float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[1] * imperfections_grunge + (float3(infinite_tiling ? endless_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 10.f, float3(0.453999996f, 0.832000017f, 0.513999999f), 8.f, false) : ::base::file_texture(texture_2d("./textures/multi_R_dust_G_grunge_B_leather.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) - 0.5f)[2] * imperfections_smudges), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(nvidia::core_definitions::blend_colors(leather_color, (infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_front_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.363999993f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_front_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 3.f, diffuse_brightness_front)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.708999991f, 0.393999994f, 0.836000025f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.796000063f, 0.784000039f)).tint, color(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.708999991f, 0.393999994f, 0.836000025f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 0.5f, ::math::lerp(0.286000013f, 0.75f, reflection_roughness_front))), ::base::color_layer_brightness, 0.449999988f).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/semi_aniline_front_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.5f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.476999998f, 0.474000007f, 0.987999976f), 8.f) : normalmap_normal(texture_2d("./textures/semi_aniline_front_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(texture_2d("./textures/semi_aniline_front_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.5f, bump_strength), false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.476999998f, 0.474000007f, 0.987999976f), 8.f) : normalmap_normal(texture_2d("./textures/semi_aniline_front_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); material_surface tmp2(dirt_back_on_off ? ::df::weighted_layer(::math::pow(::math::lerp(0.f, 1.f, ::math::smoothstep(::math::lerp(1.f, 0.f, position) - softness, ::math::lerp(1.f, 0.f, position) + softness, float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.708999991f, 0.393999994f, 0.836000025f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_front_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1])), 2.43300009f), ::df::diffuse_reflection_bsdf(dirt_color, 0.800000012f), ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.688000023f, 0.890999973f, 0.536000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.688000023f, 0.890999973f, 0.536000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.688000023f, 0.890999973f, 0.536000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.688000023f, 0.890999973f, 0.536000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.688000023f, 0.890999973f, 0.536000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_back_leather, (infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_back_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.492000014f, 0.43900001f, 0.375f), 8.f, true) : ::base::file_texture(texture_2d("./textures/semi_aniline_back_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 2.f, color_brightness_back)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.688000023f, 0.890999973f, 0.536000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 1.f, 0.754000008f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/semi_aniline_back_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.527999997f, 0.5f, 0.995999992f), 8.f) : normalmap_normal(texture_2d("./textures/semi_aniline_back_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(texture_2d("./textures/semi_aniline_back_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.527999997f, 0.5f, 0.995999992f), 8.f) : normalmap_normal(texture_2d("./textures/semi_aniline_back_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), ::state::normal()) : ::df::custom_curve_layer(0.0399999991f, 1.f, 5.f, histogram_scan_big(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.688000023f, 0.890999973f, 0.536000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[2], 0.421000034f, 0.625f), ::df::microfacet_ggx_smith_bsdf(histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.688000023f, 0.890999973f, 0.536000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.688000023f, 0.890999973f, 0.536000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)), histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.688000023f, 0.890999973f, 0.536000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)) * histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.688000023f, 0.890999973f, 0.536000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[0], 1.f, ::math::lerp(0.349999994f, 0.649999976f, reflection_roughness_back)), color(1.f, 1.f, 1.f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(1.f, ::df::diffuse_reflection_bsdf(nvidia::core_definitions::blend_colors(color_back_leather, (infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_back_diff.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.492000014f, 0.43900001f, 0.375f), 8.f, true) : ::base::file_texture(texture_2d("./textures/semi_aniline_back_diff.jpg", ::tex::gamma_srgb), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint) * color(::math::lerp(0.f, 2.f, color_brightness_back)), ::base::color_layer_overlay, histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.688000023f, 0.890999973f, 0.536000013f), 8.f, false) : ::base::file_texture(texture_2d("./textures/semi_aniline_back_multi_rough_ao_height.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false).tint)[1], 1.f, 0.754000008f)).tint, 0.f), bsdf(), infinite_tiling ? endless_normal(texture_2d("./textures/semi_aniline_back_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.527999997f, 0.5f, 0.995999992f), 8.f) : normalmap_normal(texture_2d("./textures/semi_aniline_back_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), infinite_tiling ? endless_normal(texture_2d("./textures/semi_aniline_back_norm.jpg", ::tex::gamma_linear), 1.f, false, false, vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index), 8.f, float3(0.527999997f, 0.5f, 0.995999992f), 8.f) : normalmap_normal(texture_2d("./textures/semi_aniline_back_norm.jpg", ::tex::gamma_linear), ::math::lerp(0.f, 2.5f, bump_strength), vmat_transform(texture_translate, texture_rotate, texture_scale_rescaled, ::base::texture_coordinate_uvw, uv_space_index))), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); color tmp3 = color(1.f, 1.f, 1.f); material_geometry tmp5(float3(0.f), 1.f, round_corners ? ::state::rounded_corner_normal(radius * 0.00100000005f, across_materials, 1.f) : ::state::normal()); } in material( thin_walled: tmp0, surface: tmp1, backface: tmp2, ior: tmp3, geometry: tmp5);
export material Semi_Aniline_Black(*) [[ ::anno::description(DESCRIPTION), ::anno::display_name("Black Semi Aniline Leather"), ::anno::copyright_notice(COPYRIGHT), ::anno::key_words(string[]("black", "leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi")), ::anno::author("Nvidia vMaterials"), ::anno::contributor("Maik Rohland"), ::anno::contributor("Ruediger Raab"), ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Black.png")]]= Semi_Aniline_Leather( infinite_tiling: true, bump_strength: 0.3f, leather_color: color(0.009021f, 0.009021f, 0.009021f), diffuse_brightness_front: 0.3f, reflection_roughness_front: 0.15f, imperfections_dust: 0.07f, imperfections_grunge: 0.13f, imperfections_smudges: 0.87f, color_back_leather: color(0.034230f, 0.034230f, 0.034230f), color_brightness_back: 0.65f, reflection_roughness_back: 0.65f, dirt_back_on_off: true, dirt_color: color(0.067725f, 0.067725f, 0.067725f), softness: 0.66f, position: 0.25f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: true, uv_space_index: 0);
export material Semi_Aniline_Red(*) [[ ::anno::description(DESCRIPTION), ::anno::display_name("Red Semi Aniline Leather"), ::anno::copyright_notice(COPYRIGHT), ::anno::key_words(string[]("red", "leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi")), ::anno::author("Nvidia vMaterials"), ::anno::contributor("Maik Rohland"), ::anno::contributor("Ruediger Raab"), ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Red.png")]]= Semi_Aniline_Leather( infinite_tiling: true, bump_strength: 0.3f, leather_color: color(0.160444f, 0.007751f, 0.007751f), diffuse_brightness_front: 0.3f, reflection_roughness_front: 0.15f, imperfections_dust: 0.07f, imperfections_grunge: 0.13f, imperfections_smudges: 0.87f, color_back_leather: color(0.180144f,0.065754f,0.065754f), color_brightness_back: 0.65f, reflection_roughness_back: 0.65f, dirt_back_on_off: true, dirt_color: color(0.160444f, 0.007751f, 0.007751f), softness: 0.66f, position: 0.25f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: true, uv_space_index: 0);
export material Semi_Aniline_Peach(*) [[ ::anno::description(DESCRIPTION), ::anno::display_name("Peach Semi Aniline Leather"), ::anno::copyright_notice(COPYRIGHT), ::anno::key_words(string[]("peach", "leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi")), ::anno::author("Nvidia vMaterials"), ::anno::contributor("Maik Rohland"), ::anno::contributor("Ruediger Raab"), ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Peach.png")]]= Semi_Aniline_Leather( infinite_tiling: true, bump_strength: 0.4f, leather_color: color(0.827726f, 0.103634f, 0.037029f), diffuse_brightness_front: 0.5f, reflection_roughness_front: 0.22f, imperfections_dust: 0.074f, imperfections_grunge: 0.124f, imperfections_smudges: 0.342f, color_back_leather: color(0.774227f,0.302125f,0.238828f), color_brightness_back: 0.7f, reflection_roughness_back: 0.533f, dirt_back_on_off: true, dirt_color: color(0.160444f, 0.007751f, 0.007751f), softness: 0.807f, position: 0.22f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: true, uv_space_index: 0);
export material Semi_Aniline_Mint(*) [[ ::anno::description(DESCRIPTION), ::anno::display_name("Mint Semi Aniline Leather"), ::anno::copyright_notice(COPYRIGHT), ::anno::key_words(string[]("mint", "leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "soft", "aniline", "semi")), ::anno::author("Nvidia vMaterials"), ::anno::contributor("Maik Rohland"), ::anno::contributor("Ruediger Raab"), ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Mint.png")]]= Semi_Aniline_Leather( infinite_tiling: true, bump_strength: 0.4f, leather_color: color(0.431340f, 0.453456f, 0.280124f), diffuse_brightness_front: 0.696f, reflection_roughness_front: 0.22f, imperfections_dust: 0.074f, imperfections_grunge: 0.124f, imperfections_smudges: 0.342f, color_back_leather: color(0.547994f,0.560499f,0.459080f), color_brightness_back: 0.88f, reflection_roughness_back: 0.533f, dirt_back_on_off: true, dirt_color: color(0.154152f, 0.160444f, 0.106156f), softness: 0.8f, position: 0.25f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: true, uv_space_index: 0);
export material Semi_Aniline_Orange(*) [[ ::anno::description(DESCRIPTION), ::anno::display_name("Orange Semi Aniline Leather"), ::anno::copyright_notice(COPYRIGHT), ::anno::key_words(string[]("orange", "leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi")), ::anno::author("Nvidia vMaterials"), ::anno::contributor("Maik Rohland"), ::anno::contributor("Ruediger Raab"), ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Orange.png")]]= Semi_Aniline_Leather( infinite_tiling: true, bump_strength: 0.45f, leather_color: color(0.680020f, 0.130352f, 0.016988f), diffuse_brightness_front: 0.5f, reflection_roughness_front: 0.22f, imperfections_dust: 0.074f, imperfections_grunge: 0.124f, imperfections_smudges: 0.342f, color_back_leather: color(0.605484f,0.363604f,0.212044f), color_brightness_back: 0.2f, reflection_roughness_back: 0.533f, dirt_back_on_off: true, dirt_color: color(0.666117f, 0.409826f, 0.028991f), softness: 0.615f, position: 0.25f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: true, uv_space_index: 0);
export material Semi_Aniline_Lemon(*) [[ ::anno::description(DESCRIPTION), ::anno::display_name("Lemon Semi Aniline Leather"), ::anno::copyright_notice(COPYRIGHT), ::anno::key_words(string[]("lemon", "leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi")), ::anno::author("Nvidia vMaterials"), ::anno::contributor("Maik Rohland"), ::anno::contributor("Ruediger Raab"), ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Lemon.png") ]]= Semi_Aniline_Leather( infinite_tiling: true, bump_strength: 0.4f, leather_color: color(0.796917f, 0.585973f, 0.011126f), diffuse_brightness_front: 0.3f, reflection_roughness_front: 0.22f, imperfections_dust: 0.074f, imperfections_grunge: 0.124f, imperfections_smudges: 0.342f, color_back_leather: color(0.774227f,0.729919f,0.499505f), color_brightness_back: 0.176f, reflection_roughness_back: 0.533f, dirt_back_on_off: true, dirt_color: color(0.425905f, 0.054592f, 0.012664f), softness: 0.615f, position: 0.3f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: true, uv_space_index: 0);
export material Semi_Aniline_Salmon(*) [[ ::anno::description(DESCRIPTION), ::anno::display_name("Salmon Semi Aniline Leather"), ::anno::copyright_notice(COPYRIGHT), ::anno::key_words(string[]("salmon", "leather", "infinite", "tiling", "new", "natural", "bumped", "interior", "cloth", "warm", "soft", "aniline", "semi")), ::anno::author("Nvidia vMaterials"), ::anno::contributor("Maik Rohland"), ::anno::contributor("Ruediger Raab"), ::anno::thumbnail("./.thumbs/Semi_Aniline_Leather.Semi_Aniline_Salmon.png")]]= Semi_Aniline_Leather( infinite_tiling: true, bump_strength: 0.4f, leather_color: color(0.812241f, 0.204710f, 0.190463f), diffuse_brightness_front: 0.5f, reflection_roughness_front: 0.22f, imperfections_dust: 0.074f, imperfections_grunge: 0.124f, imperfections_smudges: 0.342f, color_back_leather: color(0.751895f,0.579547f,0.573159f), color_brightness_back: 0.2f, reflection_roughness_back: 0.533f, dirt_back_on_off: true, dirt_color: color(0.592438f, 0.124741f, 0.069727f), softness: 0.801f, position: 0.25f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), round_corners: false, radius: 1.5f, across_materials: true, uv_space_index: 0);1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543/****************************************************************************** * Copyright 2022 NVIDIA Corporation. All rights reserved. * ****************************************************************************** Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,to any person obtaining a copy of the sample definition code that uses our Material Definition Language (the "MDL Materials"), to reproduce and distributethe MDL Materials, including without limitation the rights to use, copy, merge,publish, distribute, and sell modified and unmodified copies of the MDL Materials, and to permit persons to whom the MDL Materials is furnished to doso, in all cases solely for use with NVIDIA's Material Definition Language,subject to the following further conditions:
1. The above copyright notices, this list of conditions, and the disclaimerthat follows shall be retained in all copies of one or more of the MDLMaterials, including in any software with which the MDL Materials are bundled,redistributed, and/or sold, and included either as stand-alone text files,human-readable headers or in the appropriate machine-readable metadata fieldswithin text or binary files as long as those fields can be easily viewed by theuser, as applicable.2. The name of NVIDIA shall not be used to promote, endorse or advertise any Modified Version without specific prior written permission, except a) to comply with the notice requirements otherwise contained herein; or b) to acknowledgethe contribution(s) of NVIDIA.
THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USETHE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.*/
mdl 1.6;
import ::anno::*;import ::base::*;import ::df::*;import ::math::*;import ::state::*;import ::tex::*;import ::nvidia::core_definitions::blend_colors;import ::nvidia::core_definitions::dimension;
const string COPYRIGHT = " Copyright 2022 NVIDIA Corporation. All rights reserved.\n"" MDL MATERIALS ARE PROVIDED PURSUANT TO AN END USER LICENSE AGREEMENT,\n"" WHICH WAS ACCEPTED IN ORDER TO GAIN ACCESS TO THIS FILE. IN PARTICULAR,\n" " THE MDL MATERIALS ARE PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n"" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF\n"" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF\n" " COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA\n"" CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY\n"" GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN\n"" AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR\n"" INABILITY TO USE THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.\n";
const string DESCRIPTION = "A stainless steel material with adjustable roughness and controls to add secondary effects \n""such as stains, smudges and mechanical damage";
float4 tile_select(uniform int select = 0){ switch (select) { case 0: return float4(0.000, 0.333, 0.666, 1.000); case 1: return float4(0.333, 0.666, 0.666, 1.000); case 2: return float4(0.666, 1.000, 0.666, 1.000); case 3: return float4(0.000, 0.333, 0.333, 0.666); case 4: return float4(0.333, 0.666, 0.333, 0.666); case 5: return float4(0.666, 1.000, 0.333, 0.666); case 6: return float4(0.000, 0.333, 0.000, 0.333); case 7: return float4(0.333, 0.666, 0.000, 0.333); case 8: return float4(0.666, 1.000, 0.000, 0.333); default: return float4(0.000, 0.333, 0.000, 0.333); }}
export struct vm_coordinates[[ ::anno::hidden()]]{ float2 uv; float rotation; int uv_space_index; float4 carry;};
enum vm_mono_select [[ anno::description("Modes for the creation of a gray-scale value from a color"), anno::hidden()]]{ mono_r = 0, mono_g = 1, mono_b = 2, mono_a = 3, mono_average = 4};
vm_coordinates vm_coord( float2 translation = float2(0.0f, 0.0) [[ ::anno::display_name("Translation"), ::anno::description("Translates the coordinates") ]], float rotation = 0.0f [[ ::anno::display_name("Rotation"), ::anno::description("Rotates the coordinates in degrees") ]], float2 scaling = float2(1.0f, 1.0f) [[ ::anno::display_name("Scaling"), ::anno::description("Scales the coordinates") ]], uniform int uv_space = 0 [[ ::anno::display_name("UV Space"), ::anno::description("Chose the UV space") ]])[[ ::anno::display_name("vm Transform"), ::anno::description("Generates coordinates to be used in vm_lookup functions")]]{ vm_coordinates uv; ::base::texture_coordinate_info info = ::base::coordinate_source( ::base::texture_coordinate_uvw, uv_space); uv.rotation = (rotation * 3.1415926535897932384626433832f) / 180.f; uv.uv = float2(info.position.x, info.position.y); float sine = ::math::sin(uv.rotation); float cosine = ::math::cos(uv.rotation); float2x2 rot = float2x2(cosine, -sine, sine, cosine); uv.uv = rot * uv.uv; uv.uv /= scaling; uv.uv += translation; return uv;}
vm_coordinates vm_coord_hex( vm_coordinates uv, float scale = 1.0f){ vm_coordinates uv_return; float2 uv_ = float2(uv.uv.x, uv.uv.y); // same as from function get_hex above float2 s = float2(1.0f, 1.7320508f); float2 n = uv_ - float2(0.5f, 1.0f); float4 c = ::math::floor(float4(uv_.x, uv_.y, n.x, n.y)/float4(s.x, s.y, s.x, s.y)) + 0.5f; float2 h_1 = uv_ - float2(c.x, c.y) * s; float2 h_2 = uv_ - (float2(c.z, c.w) + float2(0.5f)) * s; float4 uv_id = ::math::dot(h_1, h_1) < ::math::dot(h_2, h_2) ? float4(h_1.x, h_1.y, c.x, c.y) : float4(h_2.x, h_2.y, c.z, c.w); uv_return.uv = float2(uv_id.x*scale+0.5, uv_id.y*scale+0.5); // unless we introduce random cell rotations where we need to compensate for this in the rotation // we can just plain copy the rotation value uv_return.rotation = uv.rotation; return uv_return;}
// Offsets a set of uv coordinates in either row (u) or column (v) directionvm_coordinates vm_coord_rowcol_offset( vm_coordinates uv, float offset, bool horizontal_offset = true){ int index = horizontal_offset ? 0 : 1; uv.uv[index] += ::math::floor(uv.uv[index ^ 1]) * offset; return uv;}
vm_coordinates vm_coord_grid( vm_coordinates uv, float scale = 1.0f){ float2x2 scal = float2x2(scale, 0., 0., scale); uv.uv = ::math::frac(uv.uv); uv.uv -= 0.5f; uv.uv = scal * uv.uv; uv.uv = uv.uv + 0.5f; return uv;}
::base::texture_return vm_tex_lookup( uniform texture_2d tex, vm_coordinates uv = vm_coord(), uniform vm_mono_select mono_source = mono_a, float4 scale = float4(1.0f), uniform ::tex::wrap_mode wrap_u = ::tex::wrap_repeat, uniform ::tex::wrap_mode wrap_v = ::tex::wrap_repeat, uniform float2 crop_u = float2(0.0, 1.0), uniform float2 crop_v = float2(0.0, 1.0)){ float mono; float4 lookup = ::tex::lookup_float4(tex, uv.uv, wrap_u, wrap_v, crop_u, crop_v) * scale; switch( mono_source ) { case mono_r: mono = lookup.x; break; case mono_g: mono = lookup.y; break; case mono_b: mono = lookup.z; break; case mono_a: mono = lookup.w; break; case mono_average: mono = ::math::average(float3(lookup.x, lookup.y, lookup.z)); break; } return ::base::texture_return(color(lookup.x, lookup.y, lookup.z), mono);}
// *** SET CUTOUT ENUM NAMES ***export enum cutout_pattern[[ ::anno::description("Cutout Pattern"), ::anno::hidden()]]{ pattern_circle = 0 [[ ::anno::display_name("Circle")]], pattern_hexagon = 1 [[ ::anno::display_name("Hexagon")]], pattern_line = 2 [[ ::anno::display_name("Line") ]], pattern_square = 3 [[ ::anno::display_name("Square")]], pattern_rectangle = 4 [[ ::anno::display_name("Rectangle")]], pattern_cross = 5 [[ ::anno::display_name("Cross")]], pattern_rhombus = 6 [[ ::anno::display_name("Rhombus")]], pattern_triangle = 7 [[ ::anno::display_name("Triangle")]], pattern_star = 8 [[ ::anno::display_name("Star")]] };
::base::texture_coordinate_info vmat_transform_post_scale( ::base::texture_coordinate_info uvw, float2 scale = float2(1.0f)){ return ::base::texture_coordinate_info( position: float3(uvw.position.x / scale.x, uvw.position.y / scale.y, uvw.position.z), tangent_u: uvw.tangent_u, tangent_v: uvw.tangent_v );}
float3 normalmap_normal( uniform texture_2d texture, float factor = 1.0, ::base::texture_coordinate_info uvw = ::base::texture_coordinate_info()){ float3 lookup = (::tex::lookup_float3(texture, float2(uvw.position.x, uvw.position.y)) - float3(0.5)) * (factor * 2.0); return ::math::normalize(uvw.tangent_u * lookup.x + uvw.tangent_v * lookup.y + state::normal() * (lookup.z + (1.0 - factor)));}
float overlay(float base, float layer, float weight){ return base + (1.0f - base) * layer * weight;}
// Returns the normal n in tangent space, given n is in internal space.float3 transform_internal_to_tangent(float3 n)[[ anno::hidden() ]]{ return n.x* float3(state::texture_tangent_u(0).x,state::texture_tangent_v(0).x,state::normal().x)+ n.y* float3(state::texture_tangent_u(0).y,state::texture_tangent_v(0).y,state::normal().y)+ n.z* float3(state::texture_tangent_u(0).z,state::texture_tangent_v(0).z,state::normal().z);}
// Returns the normal n in internal space, given n is in tangent space.float3 transform_tangent_to_internal(float3 n)[[ anno::hidden() ]]{ return state::texture_tangent_u(0) * n.x + state::texture_tangent_v(0) * n.y + state::normal() * n.z ;}
// Returns a normal by adding a detail normal to a global normal.// If detail blending of two normal maps gives visual artifacts, check if texture_2d are loaded// correctly with tex::gamma_linearfloat3 add_detail_normal(float3 nd = state::normal(), float3 n = state::normal()){ // http://blog.selfshadow.com/publications/blending-in-detail/ float3 n_t = transform_internal_to_tangent(n); float3 nd_t = transform_internal_to_tangent(nd);
n_t=n_t + float3(0.,0.,1.); nd_t = nd_t * float3(-1.,-1.,1.); n = n_t*math::dot(n_t, nd_t)/n_t.z - nd_t; return ::math::normalize(transform_tangent_to_internal(n));}
float3 srgb2rgb(float3 val){ return ::math::pow(::math::max(val, float3(0.0f)), 2.2);}
float uint2float(int x){ return float(x & 0x7FFFFFFF) + (x < 0 ? 2147483648.0 : 0.0);}
int lowbias32(int x){ x ^= x >>> 16; x *= 0x7feb352d; x ^= x >>> 15; x *= 0x846ca68b; x ^= x >>> 16; return x;}
float2 rnd22(int2 p) { float2 ret_val = float2( uint2float(lowbias32(p[0] + lowbias32(p[1]))) / 4294967296.f, uint2float(lowbias32(p[0] + 32000 + lowbias32(p[1]))) / 4294967296.f ); return ret_val;}
::base::texture_coordinate_info vmat_transform( uniform float2 translation = float2(0.0, 0.0), uniform float rotation = 0.0, uniform float2 scaling = float2(1.0, 1.0), uniform ::base::texture_coordinate_system system = ::base::texture_coordinate_uvw, uniform int uv_space = 0){ float4x4 scale = float4x4(1.0 /scaling.x, 0. , 0. , 0., 0. , 1.0 /scaling.y , 0. , 0., 0. , 0. , 1.0, 0., translation.x , translation.y , 0.0, 1.);
float s = ::math::sin(rotation); float c = ::math::cos(rotation); float4x4 rotate = float4x4( c , -s , 0.0 , 0.0, s , c , 0.0 , 0.0, 0.0, 0.0 , 1.0 , 0.0, 0. , 0.0 , 0.0 , 1.); return ::base::transform_coordinate(scale*rotate, ::base::coordinate_source(system, uv_space));}
float2x2 invert_2x2(float2x2 M){ float det = M[0][0]*M[1][1] - M[0][1]*M[1][0]; //https://www.chilimath.com/lessons/advanced-algebra/inverse-of-a-2x2-matrix/ return (1.0 / det) * float2x2(M[1][1], -M[0][1], -M[1][0], M[0][0]);}
float3 nonrepeat_lookup( uniform texture_2d texture = texture_2d(), ::base::texture_coordinate_info uvw = ::base::coordinate_source(), float texture_scale = 1.0, float3 average_color = float3(0.5), float patch_size = 8.0){ float2 uv_in = float2(uvw.position[0], uvw.position[1]) * texture_scale; float Z = patch_size; // patch scale inside example texture float CON = 1.0f; float3 O = float3(0.f); float2x2 M0 = float2x2(1.f,0.f, 0.5f, ::math::sqrt(3.f)/2.f); float2x2 M = invert_2x2(M0); // transform matrix <-> tilted space float2 U = uv_in; float2 V = M * uv_in; //pre-tilted hexa coordinates int2 I = int2(::math::floor(V)); // hexa-tile id // The mean color needs to be determined in Photoshop then to make the // average color work out, take the float value and calculate the apropriate // mean value as (value^(1/2.2))
float3 m = average_color; float3 F = float3(::math::frac(V)[0], ::math::frac(V)[1], 0.f), W; F[2] = 1.0 - F[0] - F[1]; // local hexa coordinates if( F[2] > 0.f )
O = (W[0] = F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I))) - m*float(CON)) + (W[1] = F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0,1)))) - m*float(CON)) + (W[2] = F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1,0)))) - m*float(CON)); else O = (W[0] = -F[2]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1)))) - m*float(CON)) + (W[1] = 1.f - F[1]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(1, 0)))) - m*float(CON)) + (W[2] = 1.f - F[0]) * (( ::tex::lookup_float3(texture, U/Z-rnd22(I+int2(0, 1)))) - m*float(CON)); O = m + O/::math::length(W); O = ::math::clamp( (O), 0.0, 1.0); return float3(O);}
float histogram_range(float input, float range, float position){ float low = ::math::clamp(1.0 - ::math::min(((1.0 - position) + range * 0.5), (1.0 - position) * 2), 0.0, 1.0); float high = ::math::clamp(::math::min((position + range * 0.5 ), position * 2.0), 0.0, 1.0); return ::math::lerp(low, high, input);}
color endless_texture( uniform texture_2d texture = texture_2d(), ::base::texture_coordinate_info uvw = ::base::coordinate_source(), float texture_scale = 10.0, float3 average_color = float3(0.5, 0.5, 1.0), float patch_size = 8.0, bool gamma_correct_lookup = true){ return gamma_correct_lookup ? color(srgb2rgb( nonrepeat_lookup ( texture: texture, uvw: uvw, texture_scale: texture_scale, average_color: average_color, patch_size: patch_size )) ) : color(nonrepeat_lookup ( texture: texture, uvw: uvw, texture_scale: texture_scale, average_color: average_color, patch_size: patch_size ));}
float3 endless_normal( uniform texture_2d texture = texture_2d(), float factor = 1.0, bool flip_tangent_u = false, bool flip_tangent_v = false, ::base::texture_coordinate_info uvw = ::base::coordinate_source(), float texture_scale = 1.0, float3 average_color = float3(0.5, 0.5, 1.0), float patch_size = 8.0){ float3 transformed_tangent_u = flip_tangent_u ? uvw.tangent_u : - uvw.tangent_u; float3 transformed_tangent_v = flip_tangent_v ? uvw.tangent_v : - uvw.tangent_v; if (flip_tangent_u) transformed_tangent_u=-transformed_tangent_u; if (flip_tangent_v) transformed_tangent_v=-transformed_tangent_v;
// normalized Lookup float3 tangent_space_normal = (nonrepeat_lookup ( texture: texture, uvw: uvw, texture_scale: texture_scale, average_color: average_color, patch_size: patch_size ) - 0.5) * (2.0 * factor); return ::math::normalize(uvw.tangent_u * tangent_space_normal.x + uvw.tangent_v * tangent_space_normal.y + ::state::normal()*1.0); }
export material Stainless_Steel( uniform bool infinite_tiling = true [[ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."), ::anno::display_name("Infinite Tiling"), ::anno::in_group("Appearance"), ::anno::ui_order(0) ]], float roughness = 0.f [[ ::anno::description("Higher values lead to blurrier reflections."), ::anno::display_name("Roughness"), ::anno::in_group("Appearance"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(1) ]], float roughness_variation = 0.21f [[ ::anno::description("Adds variation to the roughness following the shape of the milling bump map."), ::anno::display_name("Roughness Variation"), ::anno::in_group("Appearance"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(2) ]], float cloudiness = 0.3f [[ ::anno::description("Adds a cloudy reflection to the metal material."), ::anno::display_name("Cloudiness"), ::anno::in_group("Appearance"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(3) ]], float brightness = 0.5f [[ ::anno::description("Low values make the metal darker and add slight variation to the brightness while a high value gives it a bright uniform look."), ::anno::display_name("Brightness"), ::anno::in_group("Appearance"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(4) ]], float milling_bump_strength = 0.0f [[ ::anno::description("Adds milled grooves on the metal."), ::anno::display_name("Milling Bump Strength"), ::anno::in_group("Appearance", "Bump"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(5) ]], float dents_bump_strength = 0.01f [[ ::anno::description("Adds dents and bumps."), ::anno::display_name("Dents Bump Strength"), ::anno::in_group("Appearance", "Bump"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(6) ]], float dents_scale = 1.f [[ ::anno::description("Scales the size of the dents pattern on the material."), ::anno::display_name("Dents Scale"), ::anno::in_group("Appearance", "Bump"), ::anno::ui_order(7) ]], float smudges_1_weight = 0.f [[ ::anno::description("Adds smudges on the material which impact the reflectivity."), ::anno::display_name("Smudges Weight"), ::anno::in_group("Appearance", "Imperfections"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(8) ]], float smudges_2_weight = 0.f [[ ::anno::description("Adds imperfections that resemble stains on the material which impact the reflectivity."), ::anno::display_name("Stains Weight"), ::anno::in_group("Appearance", "Imperfections"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(9) ]], float smudges_falloff = .45f [[ ::anno::description("Controls the falloff of the smudges and stains on the surface. Low values make the smudges wide and soft while high values make them small."), ::anno::display_name("Smudges Falloff"), ::anno::in_group("Appearance", "Imperfections"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(10) ]], float smudges_scale = 1.f [[ ::anno::description("Scales the smudges relative to the overal scale of the material."), ::anno::display_name("Smudges and Stains Scale"), ::anno::in_group("Appearance", "Imperfections"), ::anno::soft_range(0.f, 1.f), ::anno::ui_order(11) ]], uniform float2 texture_translate = float2(0.f) [[ ::anno::description("Controls the position of the texture."), ::anno::display_name("Texture Translate"), ::anno::in_group("Transform"), ::anno::ui_order(12) ]], uniform float texture_rotate = 0.f [[ ::anno::description("Rotates angle of the texture in degrees."), ::anno::display_name("Texture Rotate"), ::anno::in_group("Transform"), ::anno::soft_range(0.f, 360.f), ::anno::ui_order(13) ]], uniform float2 texture_scale = float2(1.f) [[ ::anno::description("Larger numbers increase the size."), ::anno::display_name("Texture Scale"), ::anno::in_group("Transform"), ::nvidia::core_definitions::dimension(float2(0.70f, 0.70f)), ::anno::ui_order(14) ]], uniform bool roundcorners_enable = false [[ ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are rquired to evaluate the round corner effect."), ::anno::display_name("Enable Round Corners"), ::anno::in_group("Round Corners"), ::anno::ui_order(15) ]], uniform float roundcorners_radius_mm = 0.5f [[ ::anno::description("Radius of the rounded corners in millimeters."), ::anno::display_name("Round Corner Radius (mm)"), ::anno::in_group("Round Corners"), ::anno::soft_range(0.f, 10.f), ::anno::ui_order(16) ]], uniform bool roundcorners_across_materials = false [[ ::anno::description("Applies the round corner effect across different materials when enabled."), ::anno::display_name("Across Materials"), ::anno::in_group("Round Corners"), ::anno::ui_order(17) ]], uniform int uv_space_index = 0 [[ ::anno::description("Uses selected UV space for material."), ::anno::display_name("UV Space Index"), ::anno::in_group("Advanced"), ::anno::hard_range(0, 10), ::anno::ui_order(18) ]])[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel"), ::anno::description(DESCRIPTION), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "new", "shiny", "smooth", "reflective", "plain", "gray"))]] = let { bool tmp0 = false; float2 texture_rescale = texture_scale * float2(0.55f); material_surface tmp1(::df::custom_curve_layer(0.799999952f, 1.f, 3.0999999f, 1.f, ::df::weighted_layer(cloudiness * 0.330000013f, ::df::microfacet_ggx_smith_bsdf(0.159999996f, 0.159999996f, color(brightness * 0.300000012f + 0.600000024f), color(brightness * 0.300000012f + 0.600000024f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.799999952f, ::df::microfacet_ggx_smith_bsdf(overlay((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint), smudges_falloff + 1.f).y, smudges_2_weight), 0.429999977f), overlay((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint), smudges_falloff + 1.f).y, smudges_2_weight), 0.429999977f), color(brightness * 0.300000012f + 0.600000024f), color(brightness * 0.300000012f + 0.600000024f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f))))), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f))))), ::df::tint(color(0.f, 0.f, 0.f), ::df::weighted_layer(cloudiness * 0.330000013f, ::df::microfacet_ggx_smith_bsdf(0.159999996f, 0.159999996f, color(brightness * 0.300000012f + 0.600000024f), color(brightness * 0.300000012f + 0.600000024f), ::state::texture_tangent_u(0), ::df::scatter_reflect), ::df::weighted_layer(0.799999952f, ::df::microfacet_ggx_smith_bsdf(overlay((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint), smudges_falloff + 1.f).y, smudges_2_weight), 0.429999977f), overlay((histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength) * (histogram_range(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).y, ::math::lerp(0.f, 0.430000007f, roughness_variation), ::math::lerp(0.0299999993f, 0.349999994f, roughness)) - float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), 9.13999939f, float3(0.430000007f, 0.552999973f, 0.0460000001f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_multi_R_diff_G_rough_B_dents.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint).z * ::math::lerp(0.0299999993f, 0.349999994f, roughness) * dents_bump_strength), overlay(smudges_1_weight * ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint), smudges_falloff + 1.f).x, ::math::pow(float3(infinite_tiling ? endless_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), 9.13999939f, float3(0.0599999987f, 0.0500000007f, 0.f), 8.38000011f, false) : ::base::file_texture(texture_2d("./textures/stainless_smudges.jpg", ::tex::gamma_linear), color(0.f, 0.f, 0.f), color(1.f, 1.f, 1.f), ::base::mono_alpha, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(smudges_scale)), float2(0.f, 1.f), float2(0.f, 1.f), ::tex::wrap_repeat, ::tex::wrap_repeat, false, 0.f, int2(0), ::tex::wrap_repeat, 30.f).tint), smudges_falloff + 1.f).y, smudges_2_weight), 0.429999977f), color(brightness * 0.300000012f + 0.600000024f), color(brightness * 0.300000012f + 0.600000024f), ::state::texture_tangent_u(0), ::df::scatter_reflect), bsdf(), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f))))), add_detail_normal(infinite_tiling ? endless_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_damages_norm.jpg", ::tex::gamma_linear), dents_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(dents_scale))), infinite_tiling ? endless_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, false, false, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)), 9.13999939f, float3(0.5f, 0.5f, 0.999000013f), 8.38000011f) : normalmap_normal(texture_2d("./textures/stainless_norm.jpg", ::tex::gamma_linear), milling_bump_strength, vmat_transform_post_scale(vmat_transform(texture_translate, texture_rotate, texture_rescale, ::base::texture_coordinate_uvw, uv_space_index), float2(0.5f)))))), ::state::normal()), material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); material_surface tmp2 = material_surface(scattering: bsdf(), emission: material_emission(emission: edf(), intensity: color(0.f, 0.f, 0.f), mode: intensity_radiant_exitance)); color tmp3 = color(1.f, 1.f, 1.f); material_volume tmp4 = material_volume(scattering: vdf(), absorption_coefficient: color(0.f, 0.f, 0.f), scattering_coefficient: color(0.f, 0.f, 0.f)); material_geometry tmp5(float3(0.f), 1.f, roundcorners_enable ? ::state::rounded_corner_normal(roundcorners_radius_mm * 0.00100000005f, roundcorners_across_materials, 1.f) : ::state::normal()); hair_bsdf tmp6 = hair_bsdf(); } in material( thin_walled: tmp0, surface: tmp1, backface: tmp2, ior: tmp3, volume: tmp4, geometry: tmp5, hair: tmp6);
export material Stainless_Steel_Punched( // Cutout parameters
uniform cutout_pattern shape_select = pattern_circle //select atlas tile here [[ ::anno::description("Select a cutout shape."), ::anno::display_name("Cutout Shape"), ::anno::in_group("Appearance", "Cutout"), ::anno::ui_order(1) ]], float2 punching_grid_size = float2(1.0f) [[ ::anno::description("Scales the size of the punching grid."), ::anno::display_name("Punching Grid Size"), ::anno::in_group("Appearance", "Cutout"), ::anno::ui_order(1) ]], float cutout_size = .92f [[ ::anno::description("Scales the size of the cutout pattern independently from the base material."), ::anno::display_name("Cutout Size"), ::anno::hard_range(0.f, 1.2f), ::anno::soft_range(0.f, 1.0f), ::anno::in_group("Appearance", "Cutout"), ::anno::ui_order(2) ]], float cutout_roundness = .4f [[ ::anno::description("At low values it makes the cutouts sharper. Higher values give the shapes a more rounded look."), ::anno::display_name("Cutout Roundness"), ::anno::hard_range(0.f, 1.f), ::anno::in_group("Appearance", "Cutout"), ::anno::ui_order(3) ]], float cutout_bevel_width = 0.8f [[ ::anno::description("Adjusts the width of the bevel transition."), ::anno::display_name("Cutout Bevel Width"), ::anno::hard_range(0.f, 1.f), ::anno::in_group("Appearance", "Cutout"), ::anno::ui_order(4) ]], float cutout_bump_strength = 2.0f [[ ::anno::description("Sets the strength of the bevelled normal around the cutout."), ::anno::display_name("Cutout Bevel Strength"), ::anno::soft_range(0.0f, 1.0f), ::anno::hard_range(0.0f, 2.0f), ::anno::in_group("Appearance", "Cutout"), ::anno::ui_order(5) ]],// Grid Layout parameters bool hexagonal_grid = true [[ ::anno::description("When enabled, the punching will occur on a hexagonal grid, otherwise a square grid"), ::anno::display_name("Enable Hexagonal Grid"), ::anno::in_group("Appearance", "Cutout Layout"), ::anno::ui_order(6) ]], float square_grid_offset = 0.0f [[ ::anno::description("Offsets each row of the grid by a certain amount."), ::anno::display_name("Square Grid Offset"), ::anno::in_group("Appearance", "Cutout Layout"), ::anno::enable_if("hexagonal_grid==false"), ::anno::ui_order(7) ]], bool horizontal_offset = true [[ ::anno::description("Choose whether to offset either in row or column direction."), ::anno::display_name("Horizontal Offset"), ::anno::in_group("Appearance", "Cutout Layout"), ::anno::enable_if("hexagonal_grid==false"), ::anno::ui_order(8) ]],
// Stainless Steel parameters uniform bool infinite_tiling = true [[ ::anno::description("Enables infinite tiling feature which removes repeating texture patterns. Note that depending on the material this feature changes the appearance of the material slightly."), ::anno::display_name("Infinite Tiling"), ::anno::in_group("Appearance"), ::anno::ui_order(9) ]], float roughness = 0.f [[ ::anno::description("Higher values lead to blurrier reflections."), ::anno::display_name("Roughness"), ::anno::in_group("Appearance"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(10) ]], float roughness_variation = 0.21f [[ ::anno::description("Adds variation to the roughness following the shape of the milling bump map."), ::anno::display_name("Roughness Variation"), ::anno::in_group("Appearance"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(11) ]], float cloudiness = 0.3f [[ ::anno::description("Adds a cloudy reflection to the metal material."), ::anno::display_name("Cloudiness"), ::anno::in_group("Appearance"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(12) ]], float brightness = 0.5f [[ ::anno::description("Low values make the metal darker and add slight variation to the brightness while a high value gives it a bright uniform look."), ::anno::display_name("Brightness"), ::anno::in_group("Appearance"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(13) ]], float milling_bump_strength = 0.0f [[ ::anno::description("Adds milled grooves on the metal."), ::anno::display_name("Milling Bump Strength"), ::anno::in_group("Appearance", "Bump"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(14) ]], float dents_bump_strength = 0.01f [[ ::anno::description("Adds dents and bumps."), ::anno::display_name("Dents Bump Strength"), ::anno::in_group("Appearance", "Bump"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(15) ]], float dents_scale = 1.f [[ ::anno::description("Scales the size of the dents pattern on the material."), ::anno::display_name("Dents Scale"), ::anno::in_group("Appearance", "Bump"), ::anno::ui_order(16) ]], float smudges_1_weight = 0.f [[ ::anno::description("Adds smudges on the material which impact the reflectivity."), ::anno::display_name("Smudges Weight"), ::anno::in_group("Appearance", "Imperfections"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(17) ]], float smudges_2_weight = 0.f [[ ::anno::description("Adds imperfections that resemble stains on the material which impact the reflectivity."), ::anno::display_name("Stains Weight"), ::anno::in_group("Appearance", "Imperfections"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(18) ]], float smudges_falloff = .45f [[ ::anno::description("Controls the falloff of the smudges and stains on the surface. Low values make the smudges wide and soft while high values make them small."), ::anno::display_name("Smudges Falloff"), ::anno::in_group("Appearance", "Imperfections"), ::anno::hard_range(0.f, 1.f), ::anno::ui_order(19) ]], float smudges_scale = 1.f [[ ::anno::description("Scales the smudges relative to the overal scale of the material."), ::anno::display_name("Smudges and Stains Scale"), ::anno::in_group("Appearance", "Imperfections"), ::anno::soft_range(0.f, 1.f), ::anno::ui_order(20) ]], uniform float2 texture_translate = float2(0.f) [[ ::anno::description("Controls the position of the texture."), ::anno::display_name("Texture Translate"), ::anno::in_group("Transform"), ::anno::ui_order(21) ]], uniform float texture_rotate = 0.f [[ ::anno::description("Rotates angle of the texture in degrees."), ::anno::display_name("Texture Rotate"), ::anno::in_group("Transform"), ::anno::soft_range(0.f, 360.f), ::anno::ui_order(22) ]], uniform float2 texture_scale = float2(1.f) [[ ::anno::description("Larger numbers increase the size."), ::anno::display_name("Texture Scale"), ::anno::in_group("Transform"), ::nvidia::core_definitions::dimension(float2(0.70f, 0.70f)), ::anno::ui_order(23) ]], uniform int uv_space_index = 0 [[ ::anno::description("Uses selected UV space for material."), ::anno::display_name("UV Space Index"), ::anno::in_group("Transform"), ::anno::hard_range(0, 10), ::anno::ui_order(24) ]], uniform bool roundcorners_enable = false [[ ::anno::description("Enables the round corner effect. Comes at a slight performance cost as additional raytracing calls are rquired to evaluate the round corner effect."), ::anno::display_name("Enable Round Corners"), ::anno::in_group("Round Corners"), ::anno::ui_order(25) ]], uniform float roundcorners_radius_mm = 0.5f [[ ::anno::description("Radius of the rounded corners in millimeters."), ::anno::display_name("Round Corner Radius (mm)"), ::anno::in_group("Round Corners"), ::anno::soft_range(0.f, 10.f), ::anno::ui_order(26) ]], uniform bool roundcorners_across_materials = false [[ ::anno::description("Applies the round corner effect across different materials when enabled."), ::anno::display_name("Across Materials"), ::anno::in_group("Round Corners"), ::anno::ui_order(27) ]])[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel - Circular Punch"), ::anno::description(DESCRIPTION), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Punched.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "new", "shiny", "smooth", "reflective", "plain", "gray"))]] = let{ material base_mat = Stainless_Steel( infinite_tiling: infinite_tiling, roughness: roughness, roughness_variation: roughness_variation, cloudiness: cloudiness, brightness: brightness, milling_bump_strength: milling_bump_strength, dents_bump_strength: dents_bump_strength, dents_scale: dents_scale, smudges_1_weight: smudges_1_weight, smudges_2_weight: smudges_2_weight, smudges_falloff: smudges_falloff, smudges_scale: smudges_scale, texture_translate: texture_translate, texture_rotate: texture_rotate, texture_scale: texture_scale, roundcorners_enable: roundcorners_enable, roundcorners_radius_mm: roundcorners_radius_mm, roundcorners_across_materials: roundcorners_across_materials, uv_space_index: uv_space_index );
// remap range of slider to avoid artifacts in the bevelling float2 punching_scale = texture_scale * 0.01f * punching_grid_size; float cutout_roundness_ = cutout_roundness*0.6f+0.4f; float cutout_size_lin = (1.0f/cutout_size); texture_2d punching_cutout = texture_2d("./textures/atlas_02_norm_dist.png", ::tex::gamma_linear);
vm_coordinates uv = vm_coord( translation: texture_translate, rotation: texture_rotate, scaling: punching_scale, uv_space: uv_space_index );
vm_coordinates punching_uv = hexagonal_grid ? vm_coord_hex( uv: uv, scale: cutout_roundness_ * cutout_size_lin ) : vm_coord_grid( uv: vm_coord_rowcol_offset( uv: uv, offset: square_grid_offset, horizontal_offset: horizontal_offset ), scale: cutout_roundness_ * cutout_size_lin ); // select the correct subtile from the atlas float4 crop = tile_select(shape_select);
::base::texture_return lookup = vm_tex_lookup( tex: punching_cutout, uv: punching_uv, mono_source: mono_a, scale: float4(1.0f), crop_u: float2(crop.x, crop.y), crop_v: float2(crop.z, crop.w), wrap_u: ::tex::wrap_clamp, wrap_v: ::tex::wrap_clamp );
float low = (1.0 - cutout_roundness_); float high = (cutout_size_lin * (cutout_bevel_width * 0.2f) * cutout_roundness_) + (1.0 - cutout_roundness_); // remap x...y to (clamped) 0...1 float x = ::math::clamp((lookup.mono - low)/(high - low), 0.0, 1.0); // spherical falloff float falloff=::math::sqrt(1.0-x*x); // masking falloff as the center of the cutout is flat float masked_falloff=falloff<=0.0?1.0:falloff;
// where base material is still there, use the value of the base material float cutout= ::math::min(falloff<=0.0?0.0:1.0, base_mat.geometry.cutout_opacity);
// bring in -.5 ... +.5 range and lerp between lookup and flat normal float3 remap_norm = ::math::lerp(float3(lookup.tint), float3(0.5, 0.5, 1.0), masked_falloff) - float3(0.5); float3 t_norm = ::math::normalize(remap_norm * float3(cutout_bump_strength, cutout_bump_strength, 1.0)); float3 rotfix_norm = float3(::math::cos(punching_uv.rotation) * t_norm.x - ::math::sin(punching_uv.rotation) * t_norm.y, ::math::sin(punching_uv.rotation) * t_norm.x + ::math::cos(punching_uv.rotation) * t_norm.y, t_norm.z); float3 normal = ::state::texture_tangent_u(punching_uv.uv_space_index) * rotfix_norm.x + ::state::texture_tangent_v(punching_uv.uv_space_index) * rotfix_norm.y + ::state::normal() * rotfix_norm.z;
float3 final_normal = ::base::blend_normals( base_normal: normal, base_normal_weight: 1.0f, detail_normal: base_mat.geometry.normal, detail_normal_weight: 1.0f );
} in material( surface: material_surface( scattering: base_mat.surface.scattering ), volume: base_mat.volume, ior: base_mat.ior, thin_walled: true, geometry: material_geometry( displacement: base_mat.geometry.displacement, normal: final_normal, cutout_opacity: cutout ));
// ----------------------- Stainless Steel Presets -----------------------// 2 Shiny Wornexport material Stainless_Steel_Shiny_Worn(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel - Shiny Worn"), ::anno::description("Shiny stainless steel with signs of mechanical wear"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Shiny_Worn.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "dented", "worn", "shiny", "reflective", "plain", "gray"))]] = Stainless_Steel( infinite_tiling: true, roughness: 0.0f, roughness_variation: 0.21f, cloudiness: 0.3f, brightness: 0.5f, milling_bump_strength: 0.0f, dents_bump_strength: 0.9f, dents_scale: 1.00f, smudges_1_weight: 0.0f, smudges_2_weight: 0.0f, smudges_falloff: 0.45f, smudges_scale: 1.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), roundcorners_enable: false, roundcorners_radius_mm: 0.5f, roundcorners_across_materials: false, uv_space_index: 0);
// 3 Shiny Smudgedexport material Stainless_Steel_Shiny_Smudged(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel - Shiny Smudged"), ::anno::description("Shiny stainless steel with signs of mechanical wear. Material offers optional controls \n" "to add secondary effects such as stains, smudges and mechanical damage"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Shiny_Smudged.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "smudged", "dirty", "shiny", "smooth", "reflective", "plain", "gray"))]] = Stainless_Steel( infinite_tiling: true, roughness: 0.0f, roughness_variation: 0.25f, cloudiness: 0.3f, brightness: 0.5f, milling_bump_strength: 0.0f, dents_bump_strength: 0.0f, dents_scale: 1.0f, smudges_1_weight: 0.7f, smudges_2_weight: 0.58f, smudges_falloff: 0.45f, smudges_scale: 1.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), roundcorners_enable: false, roundcorners_radius_mm: 0.5f, roundcorners_across_materials: false, uv_space_index: 0);
// 4 Glossyexport material Stainless_Steel_Glossy(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel - Glossy"), ::anno::description("Glossy stainless steel with optional controls for secondary effects \n""such as stains, smudges and mechanical damage"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Glossy.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "smudged", "dirty", "glossy", "smooth", "reflective", "plain", "gray"))]] = Stainless_Steel( infinite_tiling: true, roughness: 0.44f, roughness_variation: 0.05f, cloudiness: 0.44f, brightness: 0.5f, milling_bump_strength: 0.24f, dents_bump_strength: 0.0f, dents_scale: 1.0f, smudges_1_weight: 0.0f, smudges_2_weight: 0.0f, smudges_falloff: 0.45f, smudges_scale: 1.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), roundcorners_enable: false, roundcorners_radius_mm: 0.5f, roundcorners_across_materials: false, uv_space_index: 0);
// 5 Matteexport material Stainless_Steel_Matte(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel - Matte"), ::anno::description("Matte stainless steel with optional controls for secondary effects \n""such as stains, smudges and mechanical damage"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Matte.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "smudged", "dirty", "matte", "smooth", "reflective", "plain", "gray"))]] = Stainless_Steel( infinite_tiling: true, roughness: 1.00f, roughness_variation: 0.0f, cloudiness: 1.0f, brightness: 0.5f, milling_bump_strength: 0.4f, dents_bump_strength: 0.0f, dents_scale: 1.0f, smudges_1_weight: 0.0f, smudges_2_weight: 0.0f, smudges_falloff: 0.45f, smudges_scale: 1.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), roundcorners_enable: false, roundcorners_radius_mm: 0.5f, roundcorners_across_materials: false, uv_space_index: 0);
// ------------------ Stainless Steel Punched Presets ------------------
export material Stainless_Steel_Punched_Small_Circular(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel - Small Circular Punch"), ::anno::description("Punched stainless steel"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Punched_Small_Circular.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "circular", "gray"))]] = Stainless_Steel_Punched( // Punching parameters shape_select: pattern_circle, punching_grid_size: float2(1.0f), cutout_size: 0.5f, cutout_roundness: 0.4f, cutout_bevel_width: 0.5f, cutout_bump_strength: 0.8f, hexagonal_grid: true, square_grid_offset: 0.0f, horizontal_offset: true, // Material Parameters infinite_tiling: true, roughness: 0.3f, roughness_variation: 0.2f, cloudiness: 0.44f, brightness: 0.5f, milling_bump_strength: 0.05f, dents_bump_strength: 0.02f, dents_scale: 1.0f, smudges_1_weight: 0.04f, smudges_2_weight: 0.05f, smudges_falloff: 0.0f, smudges_scale: 1.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0, roundcorners_enable: false, roundcorners_radius_mm: 0.5f, roundcorners_across_materials: false);
export material Stainless_Steel_Punched_Hexagonal(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel - Hexagonal Punch"), ::anno::description("Punched stainless steel"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Punched_Hexagonal.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "hexagon", "hexagonal", "gray"))]] = Stainless_Steel_Punched( // Punching parameters shape_select: pattern_hexagon, punching_grid_size: float2(1.5f), cutout_size: .95f, cutout_roundness: 0.4f, cutout_bevel_width: 0.5f, cutout_bump_strength: 1.5f, hexagonal_grid: true, square_grid_offset: 0.0f, horizontal_offset: true, // Material Parameters infinite_tiling: true, roughness: 0.3f, roughness_variation: 0.2f, cloudiness: 0.44f, brightness: 0.5f, milling_bump_strength: 0.05f, dents_bump_strength: 0.02f, dents_scale: 1.0f, smudges_1_weight: 0.04f, smudges_2_weight: 0.05f, smudges_falloff: 0.0f, smudges_scale: 1.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0, roundcorners_enable: false, roundcorners_radius_mm: 0.5f, roundcorners_across_materials: false);
export material Stainless_Steel_Punched_Hexagonal_Small(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel - Small Hexagonal Punch"), ::anno::description("Punched stainless steel"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Punched_Hexagonal_Small.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "hexagon", "hexagonal", "gray"))]] = Stainless_Steel_Punched( // Punching parameters shape_select: pattern_hexagon, punching_grid_size: float2(.75f), cutout_size: .58f, cutout_roundness: 0.4f, cutout_bevel_width: 0.3f, cutout_bump_strength: 1.5f, hexagonal_grid: true, square_grid_offset: 0.0f, horizontal_offset: true, // Material Parameters infinite_tiling: true, roughness: 0.3f, roughness_variation: 0.2f, cloudiness: 0.44f, brightness: 0.5f, milling_bump_strength: 0.05f, dents_bump_strength: 0.02f, dents_scale: 1.0f, smudges_1_weight: 0.04f, smudges_2_weight: 0.05f, smudges_falloff: 0.0f, smudges_scale: 1.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0, roundcorners_enable: false, roundcorners_radius_mm: 0.5f, roundcorners_across_materials: false);
export material Stainless_Steel_Punched_Square(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel - Square Punch"), ::anno::description("Punched stainless steel"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Punched_Square.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "square", "gray"))]] = Stainless_Steel_Punched( // Punching parameters shape_select: pattern_square, punching_grid_size: float2(1.2f), cutout_size: 0.56f, cutout_roundness: 0.1f, cutout_bevel_width: 0.5f, cutout_bump_strength: 1.5f, hexagonal_grid: false, square_grid_offset: 0.5f, horizontal_offset: true, // Material Parameters infinite_tiling: true, roughness: 0.3f, roughness_variation: 0.2f, cloudiness: 0.44f, brightness: 0.5f, milling_bump_strength: 0.05f, dents_bump_strength: 0.02f, dents_scale: 1.0f, smudges_1_weight: 0.04f, smudges_2_weight: 0.05f, smudges_falloff: 0.0f, smudges_scale: 1.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0, roundcorners_enable: false, roundcorners_radius_mm: 0.5f, roundcorners_across_materials: false);
export material Stainless_Steel_Punched_Line(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel - Line Punch"), ::anno::description("Punched stainless steel"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Punched_Line.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "line", "gray"))]] = Stainless_Steel_Punched( // Punching parameters shape_select: pattern_line, punching_grid_size: float2(1.3f), cutout_size: 0.59f, cutout_roundness: 0.4f, cutout_bevel_width: 0.3f, cutout_bump_strength: 1.5f, hexagonal_grid: false, square_grid_offset: 0.3333f, horizontal_offset: true, // Material Parameters infinite_tiling: true, roughness: 0.3f, roughness_variation: 0.2f, cloudiness: 0.44f, brightness: 0.5f, milling_bump_strength: 0.05f, dents_bump_strength: 0.02f, dents_scale: 1.0f, smudges_1_weight: 0.04f, smudges_2_weight: 0.05f, smudges_falloff: 0.0f, smudges_scale: 1.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0, roundcorners_enable: false, roundcorners_radius_mm: 0.5f, roundcorners_across_materials: false);
export material Stainless_Steel_Punched_Cross(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel - Cross Punch"), ::anno::description("Punched stainless steel"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Punched_Cross.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "cross", "gray"))]] = Stainless_Steel_Punched( // Punching parameters shape_select: pattern_cross, punching_grid_size: float2(2.0f), cutout_size: 0.59f, cutout_roundness: 0.1f, cutout_bevel_width: 0.44f, cutout_bump_strength: 1.5f, hexagonal_grid: true, square_grid_offset: 0.0f, horizontal_offset: true, // Material Parameters infinite_tiling: true, roughness: 0.3f, roughness_variation: 0.2f, cloudiness: 0.44f, brightness: 0.5f, milling_bump_strength: 0.05f, dents_bump_strength: 0.02f, dents_scale: 1.0f, smudges_1_weight: 0.04f, smudges_2_weight: 0.05f, smudges_falloff: 0.0f, smudges_scale: 1.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0, roundcorners_enable: false, roundcorners_radius_mm: 0.5f, roundcorners_across_materials: false);
export material Stainless_Steel_Punched_Rhombus(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel - Rhombus Punch"), ::anno::description("Punched stainless steel"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Punched_Rhombus.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "rhombus", "gray"))]] = Stainless_Steel_Punched( // Punching parameters shape_select: pattern_rhombus, punching_grid_size: float2(1.4f), cutout_size: 1.0f, cutout_roundness: 0.8f, cutout_bevel_width: 0.5f, cutout_bump_strength: 1.5f, hexagonal_grid: true, square_grid_offset: 0.0f, horizontal_offset: true, // Material Parameters infinite_tiling: true, roughness: 0.3f, roughness_variation: 0.2f, cloudiness: 0.44f, brightness: 0.5f, milling_bump_strength: 0.05f, dents_bump_strength: 0.02f, dents_scale: 1.0f, smudges_1_weight: 0.04f, smudges_2_weight: 0.05f, smudges_falloff: 0.0f, smudges_scale: 1.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0, roundcorners_enable: false, roundcorners_radius_mm: 0.5f, roundcorners_across_materials: false);
export material Stainless_Steel_Punched_Triangle(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel - Triangle Punch"), ::anno::description("Punched stainless steel"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Punched_Triangle.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "triangle", "gray"))]] = Stainless_Steel_Punched( shape_select: pattern_triangle, punching_grid_size: float2(1.3f), cutout_size: 1.08f, cutout_roundness: 1.0f, cutout_bevel_width: 1.0f, cutout_bump_strength: 1.5f, hexagonal_grid: true, square_grid_offset: 0.0f, horizontal_offset: true, // Material Parameters infinite_tiling: true, roughness: 0.3f, roughness_variation: 0.2f, cloudiness: 0.44f, brightness: 0.5f, milling_bump_strength: 0.05f, dents_bump_strength: 0.02f, dents_scale: 1.0f, smudges_1_weight: 0.04f, smudges_2_weight: 0.05f, smudges_falloff: 0.0f, smudges_scale: 1.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0, roundcorners_enable: false, roundcorners_radius_mm: 0.5f, roundcorners_across_materials: false);
export material Stainless_Steel_Punched_Star(*)[[ ::anno::author("NVIDIA vMaterials"), ::anno::contributor("Rüdiger Raab"), ::anno::contributor("Maik Rohland"), ::anno::display_name("Stainless Steel - Star Punch"), ::anno::description("Punched stainless steel"), ::anno::copyright_notice(COPYRIGHT), ::anno::thumbnail("./.thumbs/Stainless_Steel.Stainless_Steel_Punched_Star.png"), ::anno::key_words(string[]("metal", "steel", "stainless", "design", "kitchen", "sanitary", "construction", "automotive", "architecture", "interior", "exterior", "decorative", "shiny", "reflective", "plain", "punched", "punching", "star", "gray"))]] = Stainless_Steel_Punched( shape_select: pattern_star, punching_grid_size: float2(1.5f), cutout_size: 0.68f, cutout_roundness: 0.5f, cutout_bevel_width: 0.44f, cutout_bump_strength: 1.5f, hexagonal_grid: true, square_grid_offset: 0.0f, horizontal_offset: true, // Material Parameters infinite_tiling: true, roughness: 0.3f, roughness_variation: 0.2f, cloudiness: 0.44f, brightness: 0.5f, milling_bump_strength: 0.05f, dents_bump_strength: 0.02f, dents_scale: 1.0f, smudges_1_weight: 0.04f, smudges_2_weight: 0.05f, smudges_falloff: 0.0f, smudges_scale: 1.0f, texture_translate: float2(0.0f), texture_rotate: 0.0f, texture_scale: float2(1.0f), uv_space_index: 0, roundcorners_enable: false, roundcorners_radius_mm: 0.5f, roundcorners_across_materials: false);
12345678910111213141516171819202122232425262728293031// Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
// adjusted to be alittle darker, not harsh white, changed name to Whitemode
mdl 1.5;
import ::anno::*;
import ::df::diffuse_reflection_bsdf;
import ::state::normal;
export material WhiteMode(
color diffuse_color_constant = color(.99f)
[[
anno::display_name("Base Color"),
anno::description("This is the base color")
]]
)
=
let {
material_surface surface(
::df::diffuse_reflection_bsdf(diffuse_color_constant));
} in material(
thin_walled: false,
surface: surface);123version https://git-lfs.github.com/spec/v1oid sha256:5c66fac6d2aacdd279f2434cb288d686f632a8b4c9ba047e4cb6843c6bc0479csize 62167662123version https://git-lfs.github.com/spec/v1oid sha256:a8a04e9bdd921c18afc8e1a9cdf1a2d17df5e6158d45d45ca765557aad4d9a9esize 44772932.gitattributes+3
EXLS1/.metadata/com.nvidia.simready.root_usds.jsonAdded+6
EXLS1/com.nvidia.simready.packaging.jsonAdded+6
EXLS1/simready_usd/.thumbs/256x256/EXLS1_main.usd.pngAdded
Large File Pointer Details
- SHA256: 650a6829f02580cd63f3a7e592d04c6c443123cb71daa4219570c0fb80d6e7b0
- Pointer size: 129 Bytes
- Size of remote file: 1.98 kB
EXLS1/simready_usd/EXLS1_main.usdAdded+3
EXLS1/simready_usd/layers/.thumbs/256x256/EXLS1_ConnectionPoints.usd.pngAdded
Large File Pointer Details
- SHA256: 650a6829f02580cd63f3a7e592d04c6c443123cb71daa4219570c0fb80d6e7b0
- Pointer size: 129 Bytes
- Size of remote file: 1.98 kB
EXLS1/simready_usd/layers/.thumbs/256x256/EXLS1_Properties.usda.pngAdded
Large File Pointer Details
- SHA256: 650a6829f02580cd63f3a7e592d04c6c443123cb71daa4219570c0fb80d6e7b0
- Pointer size: 129 Bytes
- Size of remote file: 1.98 kB
EXLS1/simready_usd/layers/EXLS1_ConnectionPoints.usdAdded
EXLS1/simready_usd/layers/EXLS1_Properties.jsonAdded+278
EXLS1/simready_usd/layers/EXLS1_Properties.usdaAdded+539
EXLS1/simready_usd/layers/apply_metadata.pyAdded+356
EXLS1/simready_usd/layers/excel_to_json.pyAdded+229
EXLS1/simready_usd/layers/properties.xlsxAdded
EXLS1/simready_usd/materials/OmniPBR/OmniPBR.mdlAdded+419
EXLS1/simready_usd/materials/OmniPBR/OmniPBRBase.mdlAdded+493
EXLS1/simready_usd/materials/OmniPBR/OmniPBR_ClearCoat.mdlAdded+734
EXLS1/simready_usd/materials/Polycarbonate_Opaque.mdlAdded+1031
EXLS1/simready_usd/materials/Polypropylene_Opaque.mdlAdded+1049
EXLS1/simready_usd/materials/Semi_Aniline_Leather.mdlAdded+718
EXLS1/simready_usd/materials/Stainless_Steel.mdlAdded+1543
EXLS1/simready_usd/materials/Stainless_Steel_Brushed.mdlAdded
EXLS1/simready_usd/materials/WhiteMode.mdlAdded+31
EXLS1/simready_usd/payloads/.thumbs/256x256/external.usd.pngAdded
Large File Pointer Details
- SHA256: 650a6829f02580cd63f3a7e592d04c6c443123cb71daa4219570c0fb80d6e7b0
- Pointer size: 129 Bytes
- Size of remote file: 1.98 kB
EXLS1/simready_usd/payloads/.thumbs/256x256/internal.usd.pngAdded
Large File Pointer Details
- SHA256: 650a6829f02580cd63f3a7e592d04c6c443123cb71daa4219570c0fb80d6e7b0
- Pointer size: 129 Bytes
- Size of remote file: 1.98 kB
EXLS1/simready_usd/payloads/external.usdAdded+3
EXLS1/simready_usd/payloads/internal.usdAdded+3
EXLS1/simready_usd/textures/image screen.pngAdded

Large File Pointer Details
- SHA256: 225f5998ef1a0da43fbcbec55801fd8a42a2e88e0d558afea6ecee236cfef251
- Pointer size: 131 Bytes
- Size of remote file: 157 kB