Datasets:

Modalities:
Image
Text
Formats:
text
Size:
< 1K
Libraries:
Datasets
License:
ZijunCui commited on
Commit
e81590c
·
verified ·
1 Parent(s): 42a9155

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/256x256/.default_environment.usd.last_generated +1 -0
  2. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/256x256/.gridroom_black.usd.last_generated +1 -0
  3. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/256x256/.gridroom_curved.usd.last_generated +1 -0
  4. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/default_environment.thumb.usd +0 -0
  5. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/gridroom_black.thumb.usd +0 -0
  6. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/gridroom_curved.thumb.usd +0 -0
  7. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/default_environment.usd +0 -0
  8. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/gridroom_black.usd +0 -0
  9. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/mirror_manifest.json +94 -0
  10. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/.thumbs/256x256/.simple_room.usd.last_generated +1 -0
  11. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/.thumbs/simple_room.thumb.usd +0 -0
  12. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/DefaultMaterial.mdl +72 -0
  13. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/MI_Parquet_Floor.mdl +63 -0
  14. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/MI_Table.mdl +63 -0
  15. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/MI_WhitePlastic.mdl +65 -0
  16. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/MI_WhitePlastic2.mdl +65 -0
  17. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/MI_WoodWall.mdl +61 -0
  18. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/M_Emissive_Light.mdl +48 -0
  19. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/M_Glass.mdl +55 -0
  20. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/M_Sky_Panning_Clouds2.mdl +117 -0
  21. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/Textures/OmniUe4Base.mdl +199 -0
  22. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/Textures/OmniUe4Function.mdl +1166 -0
  23. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/Textures/OmniUe4Translucent.mdl +213 -0
  24. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/WorldGridMaterial.mdl +72 -0
  25. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/SM_Template_Map_Floor.usd +0 -0
  26. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_bottom.usd +0 -0
  27. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_back.usd +0 -0
  28. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_back001.usd +0 -0
  29. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner.usd +0 -0
  30. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner001.usd +0 -0
  31. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner002.usd +0 -0
  32. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner003.usd +0 -0
  33. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner004.usd +0 -0
  34. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner005.usd +0 -0
  35. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner006.usd +0 -0
  36. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner007.usd +0 -0
  37. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_front_center.usd +0 -0
  38. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_front_center001.usd +0 -0
  39. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_front_center_side.usd +0 -0
  40. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_front_center_side001.usd +0 -0
  41. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_front_center_side002.usd +0 -0
  42. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_front_center_side003.usd +0 -0
  43. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_side.usd +0 -0
  44. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_side001.usd +0 -0
  45. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_side002.usd +0 -0
  46. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_side003.usd +0 -0
  47. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_top.usd +0 -0
  48. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_florr_edge.usd +0 -0
  49. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_florr_edge001.usd +0 -0
  50. code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_lamp.usd +0 -0
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/256x256/.default_environment.usd.last_generated ADDED
@@ -0,0 +1 @@
 
 
1
+ 2024-12-19 15:15:27
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/256x256/.gridroom_black.usd.last_generated ADDED
@@ -0,0 +1 @@
 
 
1
+ 2024-04-30 20:21:28
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/256x256/.gridroom_curved.usd.last_generated ADDED
@@ -0,0 +1 @@
 
 
1
+ 2024-04-30 20:48:22
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/default_environment.thumb.usd ADDED
Binary file (3.43 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/gridroom_black.thumb.usd ADDED
Binary file (3.49 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/gridroom_curved.thumb.usd ADDED
Binary file (3.65 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/default_environment.usd ADDED
Binary file (13.6 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/gridroom_black.usd ADDED
Binary file (15.6 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Grid/mirror_manifest.json ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "source_bucket": "https://omniverse-content-production.s3.us-west-2.amazonaws.com",
3
+ "source_prefix": "Assets/Isaac/5.1/Isaac/Environments/Grid/",
4
+ "mirrored_utc": "2026-07-07T21:12:36Z",
5
+ "file_count": 21,
6
+ "total_bytes": 3719352,
7
+ "failed_keys": [],
8
+ "files": [
9
+ {
10
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/256x256/.default_environment.usd.last_generated",
11
+ "size": 19
12
+ },
13
+ {
14
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/256x256/.gridroom_black.usd.last_generated",
15
+ "size": 19
16
+ },
17
+ {
18
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/256x256/.gridroom_curved.usd.last_generated",
19
+ "size": 19
20
+ },
21
+ {
22
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/256x256/default_environment.usd.png",
23
+ "size": 105195
24
+ },
25
+ {
26
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/256x256/gridfloor_black.usd.png",
27
+ "size": 76971
28
+ },
29
+ {
30
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/256x256/gridroom_black.usd.png",
31
+ "size": 103322
32
+ },
33
+ {
34
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/256x256/gridroom_curved.usd.png",
35
+ "size": 79231
36
+ },
37
+ {
38
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/256x256/gridroom_curved_test.usd.png",
39
+ "size": 21254
40
+ },
41
+ {
42
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/default_environment.thumb.usd",
43
+ "size": 3433
44
+ },
45
+ {
46
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/gridroom_black.thumb.usd",
47
+ "size": 3486
48
+ },
49
+ {
50
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/.thumbs/gridroom_curved.thumb.usd",
51
+ "size": 3651
52
+ },
53
+ {
54
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/WireframeBlur_basecolor.png",
55
+ "size": 436257
56
+ },
57
+ {
58
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/WireframeBlur_basecolor_invert.png",
59
+ "size": 437286
60
+ },
61
+ {
62
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/WireframeBlur_blue.png",
63
+ "size": 1474958
64
+ },
65
+ {
66
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/Wireframe_basecolor.png",
67
+ "size": 42590
68
+ },
69
+ {
70
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/Wireframe_blue.png",
71
+ "size": 111895
72
+ },
73
+ {
74
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/radialFalloffGrid_v02.png",
75
+ "size": 146562
76
+ },
77
+ {
78
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/Materials/Textures/radialGrid_clrmap_50.png",
79
+ "size": 426785
80
+ },
81
+ {
82
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/default_environment.usd",
83
+ "size": 13622
84
+ },
85
+ {
86
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/gridroom_black.usd",
87
+ "size": 15582
88
+ },
89
+ {
90
+ "key": "Assets/Isaac/5.1/Isaac/Environments/Grid/gridroom_curved.usd",
91
+ "size": 217215
92
+ }
93
+ ]
94
+ }
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/.thumbs/256x256/.simple_room.usd.last_generated ADDED
@@ -0,0 +1 @@
 
 
1
+ 2023-10-23 19:50:06
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/.thumbs/simple_room.thumb.usd ADDED
Binary file (8.65 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/DefaultMaterial.mdl ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.3;
2
+
3
+ import math::*;
4
+ import state::*;
5
+ import tex::*;
6
+ import anno::*;
7
+ using OmniUe4Function import *;
8
+ using OmniUe4Base import *;
9
+
10
+ export annotation sampler_color();
11
+ export annotation sampler_normal();
12
+ export annotation sampler_grayscale();
13
+ export annotation sampler_alpha();
14
+ export annotation sampler_masks();
15
+ export annotation sampler_distancefield();
16
+ export annotation dither_masked_off();
17
+ export annotation world_space_normal();
18
+
19
+ export material DefaultMaterial(
20
+ )
21
+ =
22
+ let {
23
+ float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0);
24
+ float2 CustomizedUV0_mdl = float2(state::texture_coordinate(0).x,1.0-state::texture_coordinate(0).y);
25
+
26
+ float2 Local0 = (CustomizedUV0_mdl / 2.0);
27
+ float2 Local1 = (Local0 / 0.05);
28
+ float4 Local2 = ::unpack_normal_map(tex::lookup_float4(texture_2d("./Textures/T_Default_Material_Grid_N.png",::tex::gamma_linear),float2(Local1.x,1.0-Local1.y),tex::wrap_repeat,tex::wrap_repeat));
29
+ float3 Local3 = (float3(Local2.x,Local2.y,Local2.z) * float3(0.3,0.3,1.0));
30
+
31
+ float3 Normal_mdl = Local3;
32
+
33
+ float2 Local4 = (CustomizedUV0_mdl * 20.0);
34
+ float4 Local5 = tex::lookup_float4(texture_2d("./Textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat);
35
+ float Local6 = math::lerp(0.4,1.0,Local5.x);
36
+ float Local7 = (1.0 - Local6);
37
+ float2 Local8 = (Local0 / 0.1);
38
+ float4 Local9 = tex::lookup_float4(texture_2d("./Textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local8.x,1.0-Local8.y),tex::wrap_repeat,tex::wrap_repeat);
39
+ float Local10 = math::lerp(Local9.y,1.0,0.0);
40
+ float Local11 = math::lerp(Local6,Local7,Local10);
41
+ float4 Local12 = tex::lookup_float4(texture_2d("./Textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat);
42
+ float Local13 = math::lerp(Local9.y,0.0,0.0);
43
+ float Local14 = (Local12.y + Local13);
44
+ float Local15 = math::lerp(Local14,0.5,0.5);
45
+ float Local16 = math::lerp(0.295,0.66,Local15);
46
+ float Local17 = (Local16 * 0.5);
47
+ float Local18 = (Local11 * Local17);
48
+ float Local19 = math::lerp(0.0,0.5,Local12.y);
49
+ float Local20 = math::lerp(0.7,1.0,Local9.y);
50
+ float Local21 = math::lerp(Local20,1.0,0.0);
51
+ float Local22 = (Local21 * 1.0);
52
+ float Local23 = (Local19 + Local22);
53
+ float Local24 = math::min(math::max(Local23,0.0),1.0);
54
+
55
+ float3 EmissiveColor_mdl = float3(0.0,0.0,0.0);
56
+ float OpacityMask_mdl = 1.0;
57
+ float3 BaseColor_mdl = float3(Local18,Local18,Local18);
58
+ float Metallic_mdl = 0.0;
59
+ float Specular_mdl = 0.5;
60
+ float Roughness_mdl = Local24;
61
+
62
+ } in
63
+ ::OmniUe4Base(
64
+ base_color: BaseColor_mdl,
65
+ metallic: Metallic_mdl,
66
+ roughness: Roughness_mdl,
67
+ specular: Specular_mdl,
68
+ normal: Normal_mdl,
69
+ opacity: OpacityMask_mdl,
70
+ emissive_color: EmissiveColor_mdl,
71
+ displacement: WorldPositionOffset_mdl,
72
+ two_sided: false);
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/MI_Parquet_Floor.mdl ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.3;
2
+
3
+ import math::*;
4
+ import state::*;
5
+ import tex::*;
6
+ import anno::*;
7
+ using OmniUe4Function import *;
8
+ using OmniUe4Base import *;
9
+
10
+ export annotation sampler_color();
11
+ export annotation sampler_normal();
12
+ export annotation sampler_grayscale();
13
+ export annotation sampler_alpha();
14
+ export annotation sampler_masks();
15
+ export annotation sampler_distancefield();
16
+ export annotation dither_masked_off();
17
+ export annotation world_space_normal();
18
+
19
+ export material MI_Parquet_Floor(
20
+ float Texture_Tiling = 2.25,
21
+ uniform texture_2d Normal = texture_2d("./Textures/Parquet_Normal.png",::tex::gamma_linear)
22
+ [[sampler_normal()]],
23
+ float Albedo_Brightness = 0.7,
24
+ uniform texture_2d Albedo = texture_2d("./Textures/Parquet_Color.png",::tex::gamma_srgb)
25
+ [[sampler_color()]],
26
+ float Roughness = 1.1,
27
+ uniform texture_2d Roughness_tp = texture_2d("./Textures/Parquet_Rough.png",::tex::gamma_linear)
28
+ [[sampler_color()]],
29
+ uniform texture_2d AO = texture_2d("./Textures/Parquet_AO.png",::tex::gamma_linear)
30
+ [[sampler_color()]])
31
+ =
32
+ let {
33
+ float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0);
34
+ float2 CustomizedUV0_mdl = float2(state::texture_coordinate(0).x,1.0-state::texture_coordinate(0).y);
35
+
36
+ float2 Local0 = (CustomizedUV0_mdl * Texture_Tiling);
37
+ float4 Local1 = ::unpack_normal_map(tex::lookup_float4(Normal,float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat));
38
+
39
+ float3 Normal_mdl = float3(Local1.x,Local1.y,Local1.z);
40
+
41
+ float4 Local2 = tex::lookup_float4(Albedo,float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat);
42
+ float3 Local3 = (Albedo_Brightness * float3(Local2.x,Local2.y,Local2.z));
43
+ float4 Local4 = tex::lookup_float4(Roughness_tp,float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat);
44
+ float3 Local5 = (Roughness * float3(Local4.x,Local4.y,Local4.z));
45
+
46
+ float3 EmissiveColor_mdl = float3(0.0,0.0,0.0);
47
+ float OpacityMask_mdl = 1.0;
48
+ float3 BaseColor_mdl = Local3;
49
+ float Metallic_mdl = 0.0;
50
+ float Specular_mdl = 0.5;
51
+ float Roughness_mdl = Local5.x;
52
+
53
+ } in
54
+ ::OmniUe4Base(
55
+ base_color: BaseColor_mdl,
56
+ metallic: Metallic_mdl,
57
+ roughness: Roughness_mdl,
58
+ specular: Specular_mdl,
59
+ normal: Normal_mdl,
60
+ opacity: OpacityMask_mdl,
61
+ emissive_color: EmissiveColor_mdl,
62
+ displacement: WorldPositionOffset_mdl,
63
+ two_sided: false);
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/MI_Table.mdl ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.3;
2
+
3
+ import math::*;
4
+ import state::*;
5
+ import tex::*;
6
+ import anno::*;
7
+ using OmniUe4Function import *;
8
+ using OmniUe4Base import *;
9
+
10
+ export annotation sampler_color();
11
+ export annotation sampler_normal();
12
+ export annotation sampler_grayscale();
13
+ export annotation sampler_alpha();
14
+ export annotation sampler_masks();
15
+ export annotation sampler_distancefield();
16
+ export annotation dither_masked_off();
17
+ export annotation world_space_normal();
18
+
19
+ export material MI_Table(
20
+ float Texture_Tiling = 1.0,
21
+ uniform texture_2d Normal = texture_2d("./Textures/DefaultMaterial_Normal_DirectX.png",::tex::gamma_linear)
22
+ [[sampler_normal()]],
23
+ float Albedo_Brightness = 1.0,
24
+ uniform texture_2d Albedo = texture_2d("./Textures/DefaultMaterial_Base_Color.png",::tex::gamma_srgb)
25
+ [[sampler_color()]],
26
+ float Roughness = 1.1,
27
+ uniform texture_2d Roughness_tp = texture_2d("./Textures/DefaultMaterial_Roughness.png",::tex::gamma_linear)
28
+ [[sampler_color()]],
29
+ uniform texture_2d AO = texture_2d("./Textures/DefaultMaterial_Mixed_AO.png",::tex::gamma_linear)
30
+ [[sampler_color()]])
31
+ =
32
+ let {
33
+ float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0);
34
+ float2 CustomizedUV0_mdl = float2(state::texture_coordinate(0).x,1.0-state::texture_coordinate(0).y);
35
+
36
+ float2 Local0 = (CustomizedUV0_mdl * Texture_Tiling);
37
+ float4 Local1 = ::unpack_normal_map(tex::lookup_float4(Normal,float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat));
38
+
39
+ float3 Normal_mdl = float3(Local1.x,Local1.y,Local1.z);
40
+
41
+ float4 Local2 = tex::lookup_float4(Albedo,float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat);
42
+ float3 Local3 = (Albedo_Brightness * float3(Local2.x,Local2.y,Local2.z));
43
+ float4 Local4 = tex::lookup_float4(Roughness_tp,float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat);
44
+ float3 Local5 = (Roughness * float3(Local4.x,Local4.y,Local4.z));
45
+
46
+ float3 EmissiveColor_mdl = float3(0.0,0.0,0.0);
47
+ float OpacityMask_mdl = 1.0;
48
+ float3 BaseColor_mdl = Local3;
49
+ float Metallic_mdl = 0.0;
50
+ float Specular_mdl = 0.5;
51
+ float Roughness_mdl = Local5.x;
52
+
53
+ } in
54
+ ::OmniUe4Base(
55
+ base_color: BaseColor_mdl,
56
+ metallic: Metallic_mdl,
57
+ roughness: Roughness_mdl,
58
+ specular: Specular_mdl,
59
+ normal: Normal_mdl,
60
+ opacity: OpacityMask_mdl,
61
+ emissive_color: EmissiveColor_mdl,
62
+ displacement: WorldPositionOffset_mdl,
63
+ two_sided: false);
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/MI_WhitePlastic.mdl ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.3;
2
+
3
+ import math::*;
4
+ import state::*;
5
+ import tex::*;
6
+ import anno::*;
7
+ using OmniUe4Function import *;
8
+ using OmniUe4Base import *;
9
+
10
+ export annotation sampler_color();
11
+ export annotation sampler_normal();
12
+ export annotation sampler_grayscale();
13
+ export annotation sampler_alpha();
14
+ export annotation sampler_masks();
15
+ export annotation sampler_distancefield();
16
+ export annotation dither_masked_off();
17
+ export annotation world_space_normal();
18
+
19
+ export material MI_WhitePlastic(
20
+ float Texture_Tiling = 1.0,
21
+ uniform texture_2d Normal = texture_2d("./Textures/WhitePlastic_Normal.png",::tex::gamma_linear)
22
+ [[sampler_normal()]],
23
+ float Albedo_Brightness = 0.85,
24
+ uniform texture_2d Albedo = texture_2d("./Textures/WhitePlastic_Color.png",::tex::gamma_srgb)
25
+ [[sampler_color()]],
26
+ float Roughness = 1.1,
27
+ uniform texture_2d Roughness_tp = texture_2d("./Textures/WhitePlastic_Rough.png",::tex::gamma_linear)
28
+ [[sampler_color()]])
29
+ =
30
+ let {
31
+ float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0);
32
+ float2 CustomizedUV0_mdl = float2(state::texture_coordinate(0).x,1.0-state::texture_coordinate(0).y);
33
+
34
+ float Local0 = (-1.0 + 0.5);
35
+ float Local1 = (1.0 + 0.5);
36
+ float Local2 = math::lerp(float4(float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).x,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).y,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).z,Local1).x,float4(float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).x,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).y,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).z,Local1).y,CustomizedUV0_mdl.x);
37
+ float Local3 = math::lerp(float4(float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).x,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).y,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).z,Local1).z,float4(float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).x,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).y,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).z,Local1).w,CustomizedUV0_mdl.y);
38
+ float2 Local4 = (float2(Local2,Local3) * Texture_Tiling);
39
+ float4 Local5 = ::unpack_normal_map(tex::lookup_float4(Normal,float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat));
40
+
41
+ float3 Normal_mdl = float3(Local5.x,Local5.y,Local5.z);
42
+
43
+ float4 Local6 = tex::lookup_float4(Albedo,float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat);
44
+ float3 Local7 = (Albedo_Brightness * float3(Local6.x,Local6.y,Local6.z));
45
+ float4 Local8 = tex::lookup_float4(Roughness_tp,float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat);
46
+ float3 Local9 = (Roughness * float3(Local8.x,Local8.y,Local8.z));
47
+
48
+ float3 EmissiveColor_mdl = float3(0.0,0.0,0.0);
49
+ float OpacityMask_mdl = 1.0;
50
+ float3 BaseColor_mdl = Local7;
51
+ float Metallic_mdl = 0.0;
52
+ float Specular_mdl = 0.5;
53
+ float Roughness_mdl = Local9.x;
54
+
55
+ } in
56
+ ::OmniUe4Base(
57
+ base_color: BaseColor_mdl,
58
+ metallic: Metallic_mdl,
59
+ roughness: Roughness_mdl,
60
+ specular: Specular_mdl,
61
+ normal: Normal_mdl,
62
+ opacity: OpacityMask_mdl,
63
+ emissive_color: EmissiveColor_mdl,
64
+ displacement: WorldPositionOffset_mdl,
65
+ two_sided: false);
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/MI_WhitePlastic2.mdl ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.3;
2
+
3
+ import math::*;
4
+ import state::*;
5
+ import tex::*;
6
+ import anno::*;
7
+ using OmniUe4Function import *;
8
+ using OmniUe4Base import *;
9
+
10
+ export annotation sampler_color();
11
+ export annotation sampler_normal();
12
+ export annotation sampler_grayscale();
13
+ export annotation sampler_alpha();
14
+ export annotation sampler_masks();
15
+ export annotation sampler_distancefield();
16
+ export annotation dither_masked_off();
17
+ export annotation world_space_normal();
18
+
19
+ export material MI_WhitePlastic2(
20
+ float Texture_Tiling = 1.0,
21
+ uniform texture_2d Normal = texture_2d("./Textures/WhitePlastic_Normal.png",::tex::gamma_linear)
22
+ [[sampler_normal()]],
23
+ float Albedo_Brightness = 0.6,
24
+ uniform texture_2d Albedo = texture_2d("./Textures/WhitePlastic_Color.png",::tex::gamma_srgb)
25
+ [[sampler_color()]],
26
+ float Roughness = 1.1,
27
+ uniform texture_2d Roughness_tp = texture_2d("./Textures/WhitePlastic_Rough.png",::tex::gamma_linear)
28
+ [[sampler_color()]])
29
+ =
30
+ let {
31
+ float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0);
32
+ float2 CustomizedUV0_mdl = float2(state::texture_coordinate(0).x,1.0-state::texture_coordinate(0).y);
33
+
34
+ float Local0 = (-1.0 + 0.5);
35
+ float Local1 = (1.0 + 0.5);
36
+ float Local2 = math::lerp(float4(float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).x,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).y,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).z,Local1).x,float4(float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).x,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).y,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).z,Local1).y,CustomizedUV0_mdl.x);
37
+ float Local3 = math::lerp(float4(float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).x,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).y,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).z,Local1).z,float4(float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).x,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).y,float3(float2(Local0,Local1).x,float2(Local0,Local1).y,Local0).z,Local1).w,CustomizedUV0_mdl.y);
38
+ float2 Local4 = (float2(Local2,Local3) * Texture_Tiling);
39
+ float4 Local5 = ::unpack_normal_map(tex::lookup_float4(Normal,float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat));
40
+
41
+ float3 Normal_mdl = float3(Local5.x,Local5.y,Local5.z);
42
+
43
+ float4 Local6 = tex::lookup_float4(Albedo,float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat);
44
+ float3 Local7 = (Albedo_Brightness * float3(Local6.x,Local6.y,Local6.z));
45
+ float4 Local8 = tex::lookup_float4(Roughness_tp,float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat);
46
+ float3 Local9 = (Roughness * float3(Local8.x,Local8.y,Local8.z));
47
+
48
+ float3 EmissiveColor_mdl = float3(0.0,0.0,0.0);
49
+ float OpacityMask_mdl = 1.0;
50
+ float3 BaseColor_mdl = Local7;
51
+ float Metallic_mdl = 0.0;
52
+ float Specular_mdl = 0.5;
53
+ float Roughness_mdl = Local9.x;
54
+
55
+ } in
56
+ ::OmniUe4Base(
57
+ base_color: BaseColor_mdl,
58
+ metallic: Metallic_mdl,
59
+ roughness: Roughness_mdl,
60
+ specular: Specular_mdl,
61
+ normal: Normal_mdl,
62
+ opacity: OpacityMask_mdl,
63
+ emissive_color: EmissiveColor_mdl,
64
+ displacement: WorldPositionOffset_mdl,
65
+ two_sided: false);
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/MI_WoodWall.mdl ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.3;
2
+
3
+ import math::*;
4
+ import state::*;
5
+ import tex::*;
6
+ import anno::*;
7
+ using OmniUe4Function import *;
8
+ using OmniUe4Base import *;
9
+
10
+ export annotation sampler_color();
11
+ export annotation sampler_normal();
12
+ export annotation sampler_grayscale();
13
+ export annotation sampler_alpha();
14
+ export annotation sampler_masks();
15
+ export annotation sampler_distancefield();
16
+ export annotation dither_masked_off();
17
+ export annotation world_space_normal();
18
+
19
+ export material MI_WoodWall(
20
+ float Texture_Tiling = 1.0,
21
+ uniform texture_2d Normal = texture_2d("./Textures/WallWood_Normal.png",::tex::gamma_linear)
22
+ [[sampler_normal()]],
23
+ float Albedo_Brightness = 0.87,
24
+ uniform texture_2d Albedo = texture_2d("./Textures/WallWood_Color.png",::tex::gamma_srgb)
25
+ [[sampler_color()]],
26
+ float Roughness = 1.1,
27
+ uniform texture_2d Roughness_tp = texture_2d("./Textures/WallWood_Rough.png",::tex::gamma_linear)
28
+ [[sampler_color()]])
29
+ =
30
+ let {
31
+ float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0);
32
+ float2 CustomizedUV0_mdl = float2(state::texture_coordinate(0).x,1.0-state::texture_coordinate(0).y);
33
+
34
+ float2 Local0 = (CustomizedUV0_mdl * Texture_Tiling);
35
+ float4 Local1 = ::unpack_normal_map(tex::lookup_float4(Normal,float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat));
36
+
37
+ float3 Normal_mdl = float3(Local1.x,Local1.y,Local1.z);
38
+
39
+ float4 Local2 = tex::lookup_float4(Albedo,float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat);
40
+ float3 Local3 = (Albedo_Brightness * float3(Local2.x,Local2.y,Local2.z));
41
+ float4 Local4 = tex::lookup_float4(Roughness_tp,float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat);
42
+ float3 Local5 = (Roughness * float3(Local4.x,Local4.y,Local4.z));
43
+
44
+ float3 EmissiveColor_mdl = float3(0.0,0.0,0.0);
45
+ float OpacityMask_mdl = 1.0;
46
+ float3 BaseColor_mdl = Local3;
47
+ float Metallic_mdl = 0.0;
48
+ float Specular_mdl = 0.5;
49
+ float Roughness_mdl = Local5.x;
50
+
51
+ } in
52
+ ::OmniUe4Base(
53
+ base_color: BaseColor_mdl,
54
+ metallic: Metallic_mdl,
55
+ roughness: Roughness_mdl,
56
+ specular: Specular_mdl,
57
+ normal: Normal_mdl,
58
+ opacity: OpacityMask_mdl,
59
+ emissive_color: EmissiveColor_mdl,
60
+ displacement: WorldPositionOffset_mdl,
61
+ two_sided: false);
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/M_Emissive_Light.mdl ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.3;
2
+
3
+ import math::*;
4
+ import state::*;
5
+ import tex::*;
6
+ import anno::*;
7
+ using OmniUe4Function import *;
8
+ using OmniUe4Base import *;
9
+
10
+ export annotation sampler_color();
11
+ export annotation sampler_normal();
12
+ export annotation sampler_grayscale();
13
+ export annotation sampler_alpha();
14
+ export annotation sampler_masks();
15
+ export annotation sampler_distancefield();
16
+ export annotation dither_masked_off();
17
+ export annotation world_space_normal();
18
+
19
+ export material M_Emissive_Light(
20
+ float4 Light_Color = float4(1.0,0.989514,0.94,0.0),
21
+ float Intensity = 1.0)
22
+ =
23
+ let {
24
+ float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0);
25
+
26
+
27
+ float3 Normal_mdl = float3(0.0,0.0,1.0);
28
+
29
+ float3 Local0 = (float3(Light_Color.x,Light_Color.y,Light_Color.z) * Intensity);
30
+
31
+ float3 EmissiveColor_mdl = Local0;
32
+ float OpacityMask_mdl = 1.0;
33
+ float3 BaseColor_mdl = float3(0.0,0.0,0.0);
34
+ float Metallic_mdl = 0.0;
35
+ float Specular_mdl = 0.5;
36
+ float Roughness_mdl = 0.5;
37
+
38
+ } in
39
+ ::OmniUe4Base(
40
+ base_color: BaseColor_mdl,
41
+ metallic: Metallic_mdl,
42
+ roughness: Roughness_mdl,
43
+ specular: Specular_mdl,
44
+ normal: Normal_mdl,
45
+ opacity: OpacityMask_mdl,
46
+ emissive_color: EmissiveColor_mdl,
47
+ displacement: WorldPositionOffset_mdl,
48
+ two_sided: false);
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/M_Glass.mdl ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.3;
2
+
3
+ import math::*;
4
+ import state::*;
5
+ import tex::*;
6
+ import anno::*;
7
+ using OmniUe4Function import *;
8
+ using OmniUe4Translucent import *;
9
+
10
+ export annotation sampler_color();
11
+ export annotation sampler_normal();
12
+ export annotation sampler_grayscale();
13
+ export annotation sampler_alpha();
14
+ export annotation sampler_masks();
15
+ export annotation sampler_distancefield();
16
+ export annotation dither_masked_off();
17
+ export annotation world_space_normal();
18
+
19
+ export material M_Glass(
20
+ float4 ColorGlass = float4(0.0,0.001202,0.003303,1.0),
21
+ float Specular = 10.0,
22
+ float Roughness = 0.0,
23
+ float Opacity = 0.35,
24
+ uniform float Refraction = 1.4)
25
+ =
26
+ let {
27
+ float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0);
28
+
29
+
30
+ float3 Normal_mdl = float3(0.0,0.0,1.0);
31
+
32
+ float Local0 = math::lerp(1.0,Refraction,1.0);
33
+
34
+ float3 EmissiveColor_mdl = float3(0.0,0.0,0.0);
35
+ float Opacity_mdl = Opacity;
36
+ float OpacityMask_mdl = (math::saturate(Opacity) - 1.0f / 255.0f) < 0.0f ? 0.0f : 1.0f;
37
+ float3 BaseColor_mdl = float3(ColorGlass.x,ColorGlass.y,ColorGlass.z);
38
+ float Metallic_mdl = 0.0;
39
+ float Specular_mdl = Specular;
40
+ float Roughness_mdl = Roughness;
41
+ float2 Refraction_mdl = float2(Local0,Local0);
42
+
43
+ } in
44
+ ::OmniUe4Translucent(
45
+ base_color: BaseColor_mdl,
46
+ metallic: Metallic_mdl,
47
+ roughness: Roughness_mdl,
48
+ specular: Specular_mdl,
49
+ normal: Normal_mdl,
50
+ opacity: Opacity_mdl,
51
+ opacity_mask: OpacityMask_mdl,
52
+ emissive_color: EmissiveColor_mdl,
53
+ displacement: WorldPositionOffset_mdl,
54
+ refraction: Refraction_mdl.x,
55
+ two_sided: false);
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/M_Sky_Panning_Clouds2.mdl ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.3;
2
+
3
+ import math::*;
4
+ import state::*;
5
+ import tex::*;
6
+ import anno::*;
7
+ using OmniUe4Function import *;
8
+ using OmniUe4Base import *;
9
+
10
+ export annotation sampler_color();
11
+ export annotation sampler_normal();
12
+ export annotation sampler_grayscale();
13
+ export annotation sampler_alpha();
14
+ export annotation sampler_masks();
15
+ export annotation sampler_distancefield();
16
+ export annotation dither_masked_off();
17
+ export annotation world_space_normal();
18
+
19
+ export material M_Sky_Panning_Clouds2(
20
+ float4 ZenithColor = float4(0.085177,0.153746,0.35,1.0),
21
+ float Starsbrightness = 0.1,
22
+ float Sunheight = 1.0,
23
+ float4 Horizoncolor = float4(0.940601,1.0,1.0,1.0),
24
+ float HorizonFalloff = 3.0,
25
+ float4 Lightdirection = float4(-2.0,0.0,-1.0,1.0),
26
+ float SunRadius = 0.0003,
27
+ float4 Suncolor = float4(1.0,0.8,0.4,1.0),
28
+ float Sunbrightness = 50.0,
29
+ float4 Cloudcolor = float4(0.71685,0.782221,0.885,0.0),
30
+ float Cloudspeed = 0.1,
31
+ float Cloudopacity = 1.0,
32
+ float NoisePower1 = 1.0,
33
+ float NoisePower2 = 4.0,
34
+ float4 OverallColor = float4(1.0,1.0,1.0,1.0))
35
+ =
36
+ let {
37
+ float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0);
38
+ float2 CustomizedUV0_mdl = float2(state::texture_coordinate(0).x,1.0-state::texture_coordinate(0).y);
39
+ float2 CustomizedUV1_mdl = float2(state::texture_coordinate(1).x,1.0-state::texture_coordinate(1).y);
40
+
41
+
42
+
43
+ float2 Local0 = (CustomizedUV1_mdl * 12.0);
44
+ float4 Local1 = tex::lookup_float4(texture_2d("./Textures/T_Sky_Stars.png",::tex::gamma_srgb),float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat);
45
+ float3 Local2 = (float3(Local1.x,Local1.y,Local1.z) * Starsbrightness);
46
+ float3 Local3 = (Local2 * Sunheight);
47
+ float3 Local4 = (float3(ZenithColor.x,ZenithColor.y,ZenithColor.z) + Local3);
48
+ float Local5 = math::dot(::camera_vector(), float3(0.0,0.0,-1.0));
49
+ float Local6 = math::min(math::max(Local5,0.0),1.0);
50
+ float Local7 = (1.0 - Local6);
51
+ float Local8 = math::pow(Local7,HorizonFalloff);
52
+ float Local9 = math::min(math::max(Local8,0.0),1.0);
53
+ float3 Local10 = math::lerp(Local4,float3(Horizoncolor.x,Horizoncolor.y,Horizoncolor.z),Local9);
54
+ float Local11 = math::dot(float3(Lightdirection.x,Lightdirection.y,Lightdirection.z), float3(Lightdirection.x,Lightdirection.y,Lightdirection.z));
55
+ float Local12 = math::sqrt(Local11);
56
+ float3 Local13 = (float3(Lightdirection.x,Lightdirection.y,Lightdirection.z) / Local12);
57
+ float Local14 = math::dot(::camera_vector(), Local13);
58
+ float Local15 = (Local14 - 1.0);
59
+ float Local16 = math::abs(Local15);
60
+ float Local17 = math::max(0.00001,SunRadius);
61
+ float Local18 = (1.0 / Local17);
62
+ float Local19 = (Local16 * Local18);
63
+ float Local20 = (1.0 - Local19);
64
+ float Local21 = (Local20 * 1.0);
65
+ float Local22 = math::min(math::max(Local21,0.0),1.0);
66
+ float3 Local23 = (float3(Suncolor.x,Suncolor.y,Suncolor.z) * Sunbrightness);
67
+ float3 Local24 = (Local22 * Local23);
68
+ float3 Local25 = (Local10 + Local24);
69
+ float Local26 = (state::animation_time() * Cloudspeed);
70
+ float Local27 = (Local26 * 0.0002);
71
+ float Local28 = (Local26 * 0.0);
72
+ float2 Local29 = (float2(Local27,Local28) + CustomizedUV0_mdl);
73
+ float4 Local30 = tex::lookup_float4(texture_2d("./Textures/T_Sky_Blue.png",::tex::gamma_srgb),float2(Local29.x,1.0-Local29.y),tex::wrap_repeat,tex::wrap_repeat);
74
+ float Local31 = (Local26 * 0.001);
75
+ float2 Local32 = (float2(Local31,Local28) + CustomizedUV0_mdl);
76
+ float4 Local33 = ::greyscale_texture_lookup(tex::lookup_float4(texture_2d("./Textures/T_Sky_Clouds_M.png",::tex::gamma_srgb),float2(Local32.x,1.0-Local32.y),tex::wrap_repeat,tex::wrap_repeat));
77
+ float Local34 = math::lerp(Local30.x,Local33.x,Local6);
78
+ float3 Local35 = ((state::transform_point(state::coordinate_internal,state::coordinate_world,state::position())*state::meters_per_scene_unit()*100.0) - float3(0));
79
+ float Local36 = (100.0 * -0.1);
80
+ float3 Local37 = (Local35 / Local36);
81
+ float Local38 = math::min(math::max(Local37.z,0.0),1.0);
82
+ float Local39 = (1.0 - Local38);
83
+ float Local40 = (Local39 * Cloudopacity);
84
+ float Local41 = math::lerp(0.0,Local34,Local40);
85
+ float2 Local42 = (CustomizedUV0_mdl * 0.5);
86
+ float4 Local43 = ::greyscale_texture_lookup(tex::lookup_float4(texture_2d("./Textures/T_Sky_Clouds_M.png",::tex::gamma_srgb),float2(Local42.x,1.0-Local42.y),tex::wrap_repeat,tex::wrap_repeat));
87
+ float Local44 = math::lerp(NoisePower1,NoisePower2,Local43.x);
88
+ float Local45 = math::pow(Local41,Local44);
89
+ float3 Local46 = (float3(Cloudcolor.x,Cloudcolor.y,Cloudcolor.z) * Local45);
90
+ float Local47 = math::max(0.00001,1.3);
91
+ float Local48 = (1.0 / Local47);
92
+ float Local49 = (Local16 * Local48);
93
+ float Local50 = (1.0 - Local49);
94
+ float Local51 = (Local50 * 1.0);
95
+ float Local52 = math::min(math::max(Local51,0.0),1.0);
96
+ float Local53 = math::pow(Local52,10.0);
97
+ float Local54 = math::min(math::max(Local53,0.0),1.0);
98
+ float3 Local55 = (Local54 * float3(Suncolor.x,Suncolor.y,Suncolor.z));
99
+ float Local56 = (Local45 * Local45);
100
+ float Local57 = (Local56 * 0.4);
101
+ float3 Local58 = (Local55 * Local57);
102
+ float3 Local59 = (Local46 + Local58);
103
+ float Local60 = math::min(math::max(Local56,0.0),1.0);
104
+ float3 Local61 = math::lerp(Local25,Local59,Local60);
105
+ float3 Local62 = (Local61 * float3(OverallColor.x,OverallColor.y,OverallColor.z));
106
+ float3 Local63 = (Local62 * 1.5);
107
+
108
+ float3 EmissiveColor_mdl = Local63;
109
+ float OpacityMask_mdl = 1.0;
110
+
111
+ } in
112
+ ::OmniUe4Base(
113
+ opacity: OpacityMask_mdl,
114
+ emissive_color: EmissiveColor_mdl,
115
+ displacement: WorldPositionOffset_mdl,
116
+ two_sided: false,
117
+ is_unlit: true);
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/Textures/OmniUe4Base.mdl ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 1986, 2019 NVIDIA ARC GmbH. All rights reserved. *
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA’s Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ //* 1.0.0 - first version
37
+ //* 1.0.1 - merge unlit template
38
+ //* 1.0.2 - Fix EDF in the back side: the EDF contained in surface is only used for the front side and not for the back side
39
+ //* 1.0.3 - UE4 normal mapping: Geometry normal shouldn't be changed
40
+
41
+ mdl 1.3;
42
+
43
+ import df::*;
44
+ import state::*;
45
+ import math::*;
46
+ import tex::*;
47
+ import anno::*;
48
+
49
+ float emissive_multiplier()
50
+ [[
51
+ anno::description("the multiplier to convert UE4 emissive to raw data"),
52
+ anno::noinline()
53
+ ]]
54
+ {
55
+ return 20.0f * 128.0f;
56
+ }
57
+
58
+ float3 tangent_space_normal(
59
+ float3 normal = float3(0.0,0.0,1.0),
60
+ float3 tangent_u = state::texture_tangent_u(0),
61
+ float3 tangent_v = state::texture_tangent_v(0)
62
+ )
63
+ [[
64
+ anno::description("Interprets the vector in tangent space"),
65
+ anno::noinline()
66
+ ]]
67
+ {
68
+ return math::normalize(
69
+ tangent_u * normal.x +
70
+ tangent_v * normal.y +
71
+ state::normal() * (normal.z));
72
+ }
73
+
74
+ export material OmniUe4Base(
75
+ float3 base_color = float3(0.0, 0.0, 0.0),
76
+ float metallic = 0.0,
77
+ float roughness = 0.5,
78
+ float specular = 0.5,
79
+ float3 normal = float3(0.0,0.0,1.0),
80
+ float clearcoat_weight = 0.0,
81
+ float clearcoat_roughness = 0.0,
82
+ float3 clearcoat_normal = float3(0.0,0.0,1.0),
83
+ float opacity = 1.0,
84
+ float3 emissive_color = float3(0.0, 0.0, 0.0),
85
+ float3 displacement = float3(0.0),
86
+ uniform bool is_tangent_space_normal = true,
87
+ uniform bool two_sided = false,
88
+ uniform bool is_unlit = false
89
+ )
90
+ [[
91
+ anno::display_name("Omni UE4 Base"),
92
+ anno::description("Omni UE4 Base, supports UE4 default lit and clearcoat shading model"),
93
+ anno::version( 1, 0, 0),
94
+ anno::author("NVIDIA CORPORATION"),
95
+ anno::key_words(string[]("omni", "UE4", "omniverse", "lit", "clearcoat", "generic"))
96
+ ]]
97
+ = let {
98
+ color final_base_color = math::saturate(base_color);
99
+ float final_metallic = math::saturate(metallic);
100
+ float final_roughness = math::saturate(roughness);
101
+ float final_specular = math::saturate(specular);
102
+ color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/
103
+ float final_clearcoat_weight = math::saturate(clearcoat_weight);
104
+ float final_clearcoat_roughness = math::saturate(clearcoat_roughness);
105
+ float3 final_normal = math::normalize(normal);
106
+ float3 final_clearcoat_normal = math::normalize(clearcoat_normal);
107
+
108
+ // - compute final roughness by squaring the "roughness" parameter
109
+ float alpha = final_roughness * final_roughness;
110
+ // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering
111
+ float grazing_refl = math::max((1.0 - final_roughness), 0.0);
112
+
113
+ float3 the_normal = is_unlit ? state::normal() :
114
+ (is_tangent_space_normal ? tangent_space_normal(
115
+ normal: final_normal,
116
+ tangent_u: state::texture_tangent_u(0),
117
+ tangent_v: state::texture_tangent_v(0)
118
+ ) : final_normal);
119
+
120
+ // for the dielectric component we layer the glossy component on top of the diffuse one,
121
+ // the glossy layer has no color tint
122
+
123
+ bsdf dielectric_component = df::custom_curve_layer(
124
+ weight: final_specular,
125
+ normal_reflectivity: 0.08,
126
+ grazing_reflectivity: grazing_refl,
127
+ layer: df::microfacet_ggx_vcavities_bsdf(roughness_u: alpha),
128
+ base: df::diffuse_reflection_bsdf(tint: final_base_color),
129
+ normal: the_normal);
130
+
131
+ // the metallic component doesn't have a diffuse component, it's only glossy
132
+ // base_color is applied to tint it
133
+ bsdf metallic_component = df::microfacet_ggx_vcavities_bsdf(tint: final_base_color, roughness_u: alpha);
134
+
135
+ // final BSDF is a linear blend between dielectric and metallic component
136
+ bsdf dielectric_metal_mix =
137
+ df::normalized_mix(
138
+ components:
139
+ df::bsdf_component[](
140
+ df::bsdf_component(
141
+ component: metallic_component,
142
+ weight: final_metallic),
143
+ df::bsdf_component(
144
+ component: dielectric_component,
145
+ weight: 1.0-final_metallic)
146
+ )
147
+ );
148
+
149
+ // clearcoat layer
150
+ float clearcoat_grazing_refl = math::max((1.0 - final_clearcoat_roughness), 0.0);
151
+ float clearcoat_alpha = final_clearcoat_roughness * final_clearcoat_roughness;
152
+
153
+ float3 the_clearcoat_normal = is_tangent_space_normal ? tangent_space_normal(
154
+ normal: final_clearcoat_normal,
155
+ tangent_u: state::texture_tangent_u(0),
156
+ tangent_v: state::texture_tangent_v(0)
157
+ ) : final_clearcoat_normal;
158
+
159
+
160
+ bsdf clearcoat =
161
+ df::custom_curve_layer(
162
+ base: df::weighted_layer(
163
+ layer: dielectric_metal_mix,
164
+ weight: 1.0,
165
+ normal: the_normal
166
+ ),
167
+ layer: df::microfacet_ggx_vcavities_bsdf(
168
+ roughness_u: clearcoat_alpha,
169
+ tint: color(1.0)
170
+ ),
171
+ normal_reflectivity: 0.04,
172
+ grazing_reflectivity: clearcoat_grazing_refl,
173
+ normal: the_clearcoat_normal,
174
+ weight: final_clearcoat_weight
175
+ );
176
+ bsdf surface = is_unlit ? bsdf() : clearcoat;
177
+ }
178
+ in material(
179
+ thin_walled: two_sided, // Graphene?
180
+ surface: material_surface(
181
+ scattering: surface,
182
+ emission:
183
+ material_emission (
184
+ emission: df::diffuse_edf (),
185
+ intensity: final_emissive_color
186
+ )
187
+ ),
188
+ backface: material_surface(
189
+ emission:
190
+ material_emission (
191
+ emission: df::diffuse_edf (),
192
+ intensity: final_emissive_color
193
+ )
194
+ ),
195
+ geometry: material_geometry(
196
+ displacement: displacement,
197
+ cutout_opacity: opacity
198
+ )
199
+ );
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/Textures/OmniUe4Function.mdl ADDED
@@ -0,0 +1,1166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 1986, 2019 NVIDIA ARC GmbH. All rights reserved. *
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA’s Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ mdl 1.3;
37
+
38
+ import df::*;
39
+ import state::*;
40
+ import math::*;
41
+ import tex::*;
42
+ import anno::*;
43
+
44
+
45
+ export float3x3 matrix_inverse(float3x3 matrix)
46
+ [[
47
+ anno::description("Inverse the 3x3 matrix"),
48
+ anno::noinline()
49
+ ]]
50
+ {
51
+ float determinant = (matrix[0][0] * matrix[1][1] * matrix[2][2] + matrix[1][0] * matrix[2][1] * matrix[0][2] + matrix[2][0] * matrix[0][1] * matrix[1][2]) - (matrix[0][2] * matrix[1][1] * matrix[2][0] + matrix[1][2] * matrix[2][1] * matrix[0][0] + matrix[2][2] * matrix[0][1] * matrix[1][0]);
52
+ float rdet = 1.0f / determinant;
53
+
54
+ float3x3 result;
55
+
56
+ result[0][0] = rdet * (matrix[1][1] * matrix[2][2] - matrix[1][2] * matrix[2][1]);
57
+ result[0][1] = -rdet * (matrix[0][1] * matrix[2][2] - matrix[0][2] * matrix[2][1]);
58
+ result[0][2] = rdet * (matrix[0][1] * matrix[1][2] - matrix[0][2] * matrix[1][1]);
59
+
60
+ result[1][0] = -rdet * (matrix[1][0] * matrix[2][2] - matrix[1][2] * matrix[2][0]);
61
+ result[1][1] = rdet * (matrix[0][0] * matrix[2][2] - matrix[0][2] * matrix[2][0]);
62
+ result[1][2] = -rdet * (matrix[0][0] * matrix[1][2] - matrix[0][2] * matrix[1][0]);
63
+
64
+ result[2][0] = rdet * (matrix[1][0] * matrix[2][1] - matrix[1][1] * matrix[2][0]);
65
+ result[2][1] = -rdet * (matrix[0][0] * matrix[2][1] - matrix[0][1] * matrix[2][0]);
66
+ result[2][2] = rdet * (matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0]);
67
+
68
+ return result;
69
+ }
70
+
71
+ export float3 transform_vector_from_tangent_to_world(float3 vector)
72
+ [[
73
+ anno::description("Transform vector from tangent space to world space"),
74
+ anno::noinline()
75
+ ]]
76
+ {
77
+ float3x3 tangent_to_world = float3x3(state::texture_tangent_u(0), state::texture_tangent_v(0), state::normal());
78
+ return tangent_to_world * vector;
79
+ }
80
+
81
+ export float3 transform_vector_from_world_to_tangent(float3 vector)
82
+ [[
83
+ anno::description("Transform vector from world space to tangent space"),
84
+ anno::noinline()
85
+ ]]
86
+ {
87
+ float3x3 tangent_to_world = float3x3(state::texture_tangent_u(0), state::texture_tangent_v(0), state::normal());
88
+
89
+ // inverse tangent to world matrix
90
+ float3x3 world_to_tangent = matrix_inverse(tangent_to_world);
91
+
92
+ return world_to_tangent * vector;
93
+ }
94
+
95
+ export float4 unpack_normal_map(
96
+ float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0)
97
+ )
98
+ [[
99
+ anno::description("Unpack a normal stored in a normal map"),
100
+ anno::noinline()
101
+ ]]
102
+ {
103
+ float2 normal_xy = float2(texture_sample.x, texture_sample.y);
104
+
105
+ normal_xy = normal_xy * float2(2.0,2.0) - float2(1.0,1.0);
106
+ float normal_z = math::sqrt( math::saturate( 1.0 - math::dot( normal_xy, normal_xy ) ) );
107
+ return float4( normal_xy.x, normal_xy.y, normal_z, 1.0 );
108
+ }
109
+
110
+ // for get color value from normal.
111
+ export float4 pack_normal_map(
112
+ float4 texture_sample = float4(0.0, 0.0, 1.0, 1.0)
113
+ )
114
+ [[
115
+ anno::description("Pack to color from a normal")
116
+ ]]
117
+ {
118
+ float2 return_xy = float2(texture_sample.x, texture_sample.y);
119
+
120
+ return_xy = (return_xy + float2(1.0,1.0)) / float2(2.0,2.0);
121
+
122
+ return float4( return_xy.x, return_xy.y, 0.0, 1.0 );
123
+ }
124
+
125
+ export float4 greyscale_texture_lookup(
126
+ float4 texture_sample = float4(0.0, 0.0, 0.0, 1.0)
127
+ )
128
+ [[
129
+ anno::description("Sampling a greyscale texture"),
130
+ anno::noinline()
131
+ ]]
132
+ {
133
+ return float4(texture_sample.x, texture_sample.x, texture_sample.x, texture_sample.x);
134
+ }
135
+
136
+ export float3 pixel_normal_world_space()
137
+ [[
138
+ anno::description("Pixel normal in world space"),
139
+ anno::noinline()
140
+ ]]
141
+ {
142
+ return state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal());
143
+ }
144
+
145
+ export float3 vertex_normal_world_space()
146
+ [[
147
+ anno::description("Vertex normal in world space"),
148
+ anno::noinline()
149
+ ]]
150
+ {
151
+ return state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal());
152
+ }
153
+
154
+ export float3 landscape_normal_world_space()
155
+ [[
156
+ anno::description("Landscape normal in world space")
157
+ ]]
158
+ {
159
+ float3 normalFromNormalmap = math::floor((::vertex_normal_world_space() * 0.5 + 0.5) * 255.0) / 255.0 * 2.0 - 1.0;
160
+
161
+ float2 normalXY = float2(normalFromNormalmap.x, normalFromNormalmap.y);
162
+ return float3(normalXY.x, normalXY.y, math::sqrt(math::saturate(1.0 - math::dot(normalXY, normalXY))));
163
+ }
164
+
165
+ // Different implementation specific between mdl and hlsl for smoothstep
166
+ export float smoothstep(float a, float b, float l)
167
+ {
168
+ if (a < b)
169
+ {
170
+ return math::smoothstep(a, b, l);
171
+ }
172
+ else if (a > b)
173
+ {
174
+ return 1.0 - math::smoothstep(b, a, l);
175
+ }
176
+ else
177
+ {
178
+ return l <= a ? 0.0 : 1.0;
179
+ }
180
+ }
181
+
182
+ export float2 smoothstep(float2 a, float2 b, float2 l)
183
+ {
184
+ return float2(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y));
185
+ }
186
+
187
+ export float3 smoothstep(float3 a, float3 b, float3 l)
188
+ {
189
+ return float3(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z));
190
+ }
191
+
192
+ export float4 smoothstep(float4 a, float4 b, float4 l)
193
+ {
194
+ return float4(smoothstep(a.x, b.x, l.x), smoothstep(a.y, b.y, l.y), smoothstep(a.z, b.z, l.z), smoothstep(a.w, b.w, l.w));
195
+ }
196
+
197
+ export float2 smoothstep(float2 a, float2 b, float l)
198
+ {
199
+ return float2(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l));
200
+ }
201
+
202
+ export float3 smoothstep(float3 a, float3 b, float l)
203
+ {
204
+ return float3(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l));
205
+ }
206
+
207
+ export float4 smoothstep(float4 a, float4 b, float l)
208
+ {
209
+ return float4(smoothstep(a.x, b.x, l), smoothstep(a.y, b.y, l), smoothstep(a.z, b.z, l), smoothstep(a.w, b.w, l));
210
+ }
211
+
212
+ //------------------ Random from UE4 -----------------------
213
+ float length2(float3 v)
214
+ {
215
+ return math::dot(v, v);
216
+ }
217
+
218
+ float3 GetPerlinNoiseGradientTextureAt(uniform texture_2d PerlinNoiseGradientTexture, float3 v)
219
+ {
220
+ const float2 ZShear = float2(17.0f, 89.0f);
221
+
222
+ float2 OffsetA = v.z * ZShear;
223
+ float2 TexA = (float2(v.x, v.y) + OffsetA + 0.5f) / 128.0f;
224
+ float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA.x,1.0-TexA.y),tex::wrap_repeat,tex::wrap_repeat);
225
+ return float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z) * 2.0 - 1.0;
226
+ }
227
+
228
+ float3 SkewSimplex(float3 In)
229
+ {
230
+ return In + math::dot(In, float3(1.0 / 3.0f) );
231
+ }
232
+ float3 UnSkewSimplex(float3 In)
233
+ {
234
+ return In - math::dot(In, float3(1.0 / 6.0f) );
235
+ }
236
+
237
+ // 3D random number generator inspired by PCGs (permuted congruential generator)
238
+ // Using a **simple** Feistel cipher in place of the usual xor shift permutation step
239
+ // @param v = 3D integer coordinate
240
+ // @return three elements w/ 16 random bits each (0-0xffff).
241
+ // ~8 ALU operations for result.x (7 mad, 1 >>)
242
+ // ~10 ALU operations for result.xy (8 mad, 2 >>)
243
+ // ~12 ALU operations for result.xyz (9 mad, 3 >>)
244
+
245
+ //TODO: uint3
246
+ int3 Rand3DPCG16(int3 p)
247
+ {
248
+ // taking a signed int then reinterpreting as unsigned gives good behavior for negatives
249
+ //TODO: uint3
250
+ int3 v = int3(p);
251
+
252
+ // Linear congruential step. These LCG constants are from Numerical Recipies
253
+ // For additional #'s, PCG would do multiple LCG steps and scramble each on output
254
+ // So v here is the RNG state
255
+ v = v * 1664525 + 1013904223;
256
+
257
+ // PCG uses xorshift for the final shuffle, but it is expensive (and cheap
258
+ // versions of xorshift have visible artifacts). Instead, use simple MAD Feistel steps
259
+ //
260
+ // Feistel ciphers divide the state into separate parts (usually by bits)
261
+ // then apply a series of permutation steps one part at a time. The permutations
262
+ // use a reversible operation (usually ^) to part being updated with the result of
263
+ // a permutation function on the other parts and the key.
264
+ //
265
+ // In this case, I'm using v.x, v.y and v.z as the parts, using + instead of ^ for
266
+ // the combination function, and just multiplying the other two parts (no key) for
267
+ // the permutation function.
268
+ //
269
+ // That gives a simple mad per round.
270
+ v.x += v.y*v.z;
271
+ v.y += v.z*v.x;
272
+ v.z += v.x*v.y;
273
+ v.x += v.y*v.z;
274
+ v.y += v.z*v.x;
275
+ v.z += v.x*v.y;
276
+
277
+ // only top 16 bits are well shuffled
278
+ return v >> 16;
279
+ }
280
+
281
+ // Wraps noise for tiling texture creation
282
+ // @param v = unwrapped texture parameter
283
+ // @param bTiling = true to tile, false to not tile
284
+ // @param RepeatSize = number of units before repeating
285
+ // @return either original or wrapped coord
286
+ float3 NoiseTileWrap(float3 v, bool bTiling, float RepeatSize)
287
+ {
288
+ return bTiling ? (math::frac(v / RepeatSize) * RepeatSize) : v;
289
+ }
290
+
291
+ // Evaluate polynomial to get smooth transitions for Perlin noise
292
+ // only needed by Perlin functions in this file
293
+ // scalar(per component): 2 add, 5 mul
294
+ float4 PerlinRamp(float4 t)
295
+ {
296
+ return t * t * t * (t * (t * 6 - 15) + 10);
297
+ }
298
+
299
+ // Blum-Blum-Shub-inspired pseudo random number generator
300
+ // http://www.umbc.edu/~olano/papers/mNoise.pdf
301
+ // real BBS uses ((s*s) mod M) with bignums and M as the product of two huge Blum primes
302
+ // instead, we use a single prime M just small enough not to overflow
303
+ // note that the above paper used 61, which fits in a half, but is unusably bad
304
+ // @param Integer valued floating point seed
305
+ // @return random number in range [0,1)
306
+ // ~8 ALU operations (5 *, 3 frac)
307
+ float RandBBSfloat(float seed)
308
+ {
309
+ float BBS_PRIME24 = 4093.0;
310
+ float s = math::frac(seed / BBS_PRIME24);
311
+ s = math::frac(s * s * BBS_PRIME24);
312
+ s = math::frac(s * s * BBS_PRIME24);
313
+ return s;
314
+ }
315
+
316
+ // Modified noise gradient term
317
+ // @param seed - random seed for integer lattice position
318
+ // @param offset - [-1,1] offset of evaluation point from lattice point
319
+ // @return gradient direction (xyz) and contribution (w) from this lattice point
320
+ float4 MGradient(int seed, float3 offset)
321
+ {
322
+ //TODO uint
323
+ int rand = Rand3DPCG16(int3(seed,0,0)).x;
324
+ int3 MGradientMask = int3(0x8000, 0x4000, 0x2000);
325
+ float3 MGradientScale = float3(1.0 / 0x4000, 1.0 / 0x2000, 1.0 / 0x1000);
326
+ float3 direction = float3(int3(rand, rand, rand) & MGradientMask) * MGradientScale - 1;
327
+ return float4(direction.x, direction.y, direction.z, math::dot(direction, offset));
328
+ }
329
+
330
+ // compute Perlin and related noise corner seed values
331
+ // @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D
332
+ // @param bTiling = true to return seed values for a repeating noise pattern
333
+ // @param RepeatSize = integer units before tiling in each dimension
334
+ // @param seed000-seed111 = hash function seeds for the eight corners
335
+ // @return fractional part of v
336
+ struct SeedValue
337
+ {
338
+ float3 fv = float3(0);
339
+ float seed000 = 0;
340
+ float seed001 = 0;
341
+ float seed010 = 0;
342
+ float seed011 = 0;
343
+ float seed100 = 0;
344
+ float seed101 = 0;
345
+ float seed110 = 0;
346
+ float seed111 = 0;
347
+ };
348
+
349
+ SeedValue NoiseSeeds(float3 v, bool bTiling, float RepeatSize)
350
+ {
351
+ SeedValue seeds;
352
+ seeds.fv = math::frac(v);
353
+ float3 iv = math::floor(v);
354
+
355
+ const float3 primes = float3(19, 47, 101);
356
+
357
+ if (bTiling)
358
+ { // can't algebraically combine with primes
359
+ seeds.seed000 = math::dot(primes, NoiseTileWrap(iv, true, RepeatSize));
360
+ seeds.seed100 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 0), true, RepeatSize));
361
+ seeds.seed010 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 0), true, RepeatSize));
362
+ seeds.seed110 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 0), true, RepeatSize));
363
+ seeds.seed001 = math::dot(primes, NoiseTileWrap(iv + float3(0, 0, 1), true, RepeatSize));
364
+ seeds.seed101 = math::dot(primes, NoiseTileWrap(iv + float3(1, 0, 1), true, RepeatSize));
365
+ seeds.seed011 = math::dot(primes, NoiseTileWrap(iv + float3(0, 1, 1), true, RepeatSize));
366
+ seeds.seed111 = math::dot(primes, NoiseTileWrap(iv + float3(1, 1, 1), true, RepeatSize));
367
+ }
368
+ else
369
+ { // get to combine offsets with multiplication by primes in this case
370
+ seeds.seed000 = math::dot(iv, primes);
371
+ seeds.seed100 = seeds.seed000 + primes.x;
372
+ seeds.seed010 = seeds.seed000 + primes.y;
373
+ seeds.seed110 = seeds.seed100 + primes.y;
374
+ seeds.seed001 = seeds.seed000 + primes.z;
375
+ seeds.seed101 = seeds.seed100 + primes.z;
376
+ seeds.seed011 = seeds.seed010 + primes.z;
377
+ seeds.seed111 = seeds.seed110 + primes.z;
378
+ }
379
+
380
+ return seeds;
381
+ }
382
+
383
+ struct SimplexWeights
384
+ {
385
+ float4 Result = float4(0);
386
+ float3 PosA = float3(0);
387
+ float3 PosB = float3(0);
388
+ float3 PosC = float3(0);
389
+ float3 PosD = float3(0);
390
+ };
391
+
392
+ // Computed weights and sample positions for simplex interpolation
393
+ // @return float4(a,b,c, d) Barycentric coordinate defined as Filtered = Tex(PosA) * a + Tex(PosB) * b + Tex(PosC) * c + Tex(PosD) * d
394
+ SimplexWeights ComputeSimplexWeights3D(float3 OrthogonalPos)
395
+ {
396
+ SimplexWeights weights;
397
+ float3 OrthogonalPosFloor = math::floor(OrthogonalPos);
398
+
399
+ weights.PosA = OrthogonalPosFloor;
400
+ weights.PosB = weights.PosA + float3(1, 1, 1);
401
+
402
+ OrthogonalPos -= OrthogonalPosFloor;
403
+
404
+ float Largest = math::max(OrthogonalPos.x, math::max(OrthogonalPos.y, OrthogonalPos.z));
405
+ float Smallest = math::min(OrthogonalPos.x, math::min(OrthogonalPos.y, OrthogonalPos.z));
406
+
407
+ weights.PosC = weights.PosA + float3(Largest == OrthogonalPos.x, Largest == OrthogonalPos.y, Largest == OrthogonalPos.z);
408
+ weights.PosD = weights.PosA + float3(Smallest != OrthogonalPos.x, Smallest != OrthogonalPos.y, Smallest != OrthogonalPos.z);
409
+
410
+ float RG = OrthogonalPos.x - OrthogonalPos.y;
411
+ float RB = OrthogonalPos.x - OrthogonalPos.z;
412
+ float GB = OrthogonalPos.y - OrthogonalPos.z;
413
+
414
+ weights.Result.z =
415
+ math::min(math::max(0, RG), math::max(0, RB)) // X
416
+ + math::min(math::max(0, -RG), math::max(0, GB)) // Y
417
+ + math::min(math::max(0, -RB), math::max(0, -GB)); // Z
418
+
419
+ weights.Result.w =
420
+ math::min(math::max(0, -RG), math::max(0, -RB)) // X
421
+ + math::min(math::max(0, RG), math::max(0, -GB)) // Y
422
+ + math::min(math::max(0, RB), math::max(0, GB)); // Z
423
+
424
+ weights.Result.y = Smallest;
425
+ weights.Result.x = 1.0f - weights.Result.y - weights.Result.z - weights.Result.w;
426
+
427
+ return weights;
428
+ }
429
+
430
+ // filtered 3D gradient simple noise (few texture lookups, high quality)
431
+ // @param v >0
432
+ // @return random number in the range -1 .. 1
433
+ float SimplexNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 EvalPos)
434
+ {
435
+ float3 OrthogonalPos = SkewSimplex(EvalPos);
436
+
437
+ SimplexWeights Weights = ComputeSimplexWeights3D(OrthogonalPos);
438
+
439
+ // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 32 bit)
440
+ float3 A = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosA);
441
+ float3 B = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosB);
442
+ float3 C = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosC);
443
+ float3 D = GetPerlinNoiseGradientTextureAt(PerlinNoiseGradientTexture, Weights.PosD);
444
+
445
+ Weights.PosA = UnSkewSimplex(Weights.PosA);
446
+ Weights.PosB = UnSkewSimplex(Weights.PosB);
447
+ Weights.PosC = UnSkewSimplex(Weights.PosC);
448
+ Weights.PosD = UnSkewSimplex(Weights.PosD);
449
+
450
+ float DistanceWeight;
451
+
452
+ DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosA)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight;
453
+ float a = math::dot(A, EvalPos - Weights.PosA) * DistanceWeight;
454
+ DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosB)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight;
455
+ float b = math::dot(B, EvalPos - Weights.PosB) * DistanceWeight;
456
+ DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosC)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight;
457
+ float c = math::dot(C, EvalPos - Weights.PosC) * DistanceWeight;
458
+ DistanceWeight = math::saturate(0.6f - length2(EvalPos - Weights.PosD)); DistanceWeight *= DistanceWeight; DistanceWeight *= DistanceWeight;
459
+ float d = math::dot(D, EvalPos - Weights.PosD) * DistanceWeight;
460
+
461
+ return 32 * (a + b + c + d);
462
+ }
463
+
464
+ // filtered 3D noise, can be optimized
465
+ // @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D
466
+ // @param bTiling = repeat noise pattern
467
+ // @param RepeatSize = integer units before tiling in each dimension
468
+ // @return random number in the range -1 .. 1
469
+ float GradientNoise3D_TEX(uniform texture_2d PerlinNoiseGradientTexture, float3 v, bool bTiling, float RepeatSize)
470
+ {
471
+ bTiling = true;
472
+ float3 fv = math::frac(v);
473
+ float3 iv0 = NoiseTileWrap(math::floor(v), bTiling, RepeatSize);
474
+ float3 iv1 = NoiseTileWrap(iv0 + 1, bTiling, RepeatSize);
475
+
476
+ const int2 ZShear = int2(17, 89);
477
+
478
+ float2 OffsetA = iv0.z * ZShear;
479
+ float2 OffsetB = OffsetA + ZShear; // non-tiling, use relative offset
480
+ if (bTiling) // tiling, have to compute from wrapped coordinates
481
+ {
482
+ OffsetB = iv1.z * ZShear;
483
+ }
484
+
485
+ // Texture size scale factor
486
+ float ts = 1 / 128.0f;
487
+
488
+ // texture coordinates for iv0.xy, as offset for both z slices
489
+ float2 TexA0 = (float2(iv0.x, iv0.y) + OffsetA + 0.5f) * ts;
490
+ float2 TexB0 = (float2(iv0.x, iv0.y) + OffsetB + 0.5f) * ts;
491
+
492
+ // texture coordinates for iv1.xy, as offset for both z slices
493
+ float2 TexA1 = TexA0 + ts; // for non-tiling, can compute relative to existing coordinates
494
+ float2 TexB1 = TexB0 + ts;
495
+ if (bTiling) // for tiling, need to compute from wrapped coordinates
496
+ {
497
+ TexA1 = (float2(iv1.x, iv1.y) + OffsetA + 0.5f) * ts;
498
+ TexB1 = (float2(iv1.x, iv1.y) + OffsetB + 0.5f) * ts;
499
+ }
500
+
501
+
502
+ // can be optimized to 1 or 2 texture lookups (4 or 8 channel encoded in 8, 16 or 32 bit)
503
+ float4 PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat);
504
+ float3 PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z);
505
+ float3 A = PerlinNoiseColor * 2 - 1;
506
+ PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA0.y),tex::wrap_repeat,tex::wrap_repeat);
507
+ PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z);
508
+ float3 B = PerlinNoiseColor * 2 - 1;
509
+ PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA0.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat);
510
+ PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z);
511
+ float3 C = PerlinNoiseColor * 2 - 1;
512
+ PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexA1.x,1.0-TexA1.y),tex::wrap_repeat,tex::wrap_repeat);
513
+ PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z);
514
+ float3 D = PerlinNoiseColor * 2 - 1;
515
+ PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat);
516
+ PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z);
517
+ float3 E = PerlinNoiseColor * 2 - 1;
518
+ PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB0.y),tex::wrap_repeat,tex::wrap_repeat);
519
+ PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z);
520
+ float3 F = PerlinNoiseColor * 2 - 1;
521
+ PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB0.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat);
522
+ PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z);
523
+ float3 G = PerlinNoiseColor * 2 - 1;
524
+ PerlinNoise = tex::lookup_float4(PerlinNoiseGradientTexture,float2(TexB1.x,1.0-TexB1.y),tex::wrap_repeat,tex::wrap_repeat);
525
+ PerlinNoiseColor = float3(PerlinNoise.x, PerlinNoise.y, PerlinNoise.z);
526
+ float3 H = PerlinNoiseColor * 2 - 1;
527
+
528
+ float a = math::dot(A, fv - float3(0, 0, 0));
529
+ float b = math::dot(B, fv - float3(1, 0, 0));
530
+ float c = math::dot(C, fv - float3(0, 1, 0));
531
+ float d = math::dot(D, fv - float3(1, 1, 0));
532
+ float e = math::dot(E, fv - float3(0, 0, 1));
533
+ float f = math::dot(F, fv - float3(1, 0, 1));
534
+ float g = math::dot(G, fv - float3(0, 1, 1));
535
+ float h = math::dot(H, fv - float3(1, 1, 1));
536
+
537
+ float4 Weights = PerlinRamp(math::frac(float4(fv.x, fv.y, fv.z, 0)));
538
+
539
+ float i = math::lerp(math::lerp(a, b, Weights.x), math::lerp(c, d, Weights.x), Weights.y);
540
+ float j = math::lerp(math::lerp(e, f, Weights.x), math::lerp(g, h, Weights.x), Weights.y);
541
+
542
+ return math::lerp(i, j, Weights.z);
543
+ }
544
+
545
+ // @return random number in the range -1 .. 1
546
+ // scalar: 6 frac, 31 mul/mad, 15 add,
547
+ float FastGradientPerlinNoise3D_TEX(uniform texture_3d PerlinNoise3DTexture, float3 xyz)
548
+ {
549
+ // needs to be the same value when creating the PerlinNoise3D texture
550
+ float Extent = 16;
551
+
552
+ // last texel replicated and needed for filtering
553
+ // scalar: 3 frac, 6 mul
554
+ xyz = math::frac(xyz / (Extent - 1)) * (Extent - 1);
555
+
556
+ // scalar: 3 frac
557
+ float3 uvw = math::frac(xyz);
558
+ // = floor(xyz);
559
+ // scalar: 3 add
560
+ float3 p0 = xyz - uvw;
561
+ // float3 f = math::pow(uvw, 2) * 3.0f - math::pow(uvw, 3) * 2.0f; // original perlin hermite (ok when used without bump mapping)
562
+ // scalar: 2*3 add 5*3 mul
563
+ float4 pr = PerlinRamp(float4(uvw.x, uvw.y, uvw.z, 0));
564
+ float3 f = float3(pr.x, pr.y, pr.z); // new, better with continues second derivative for bump mapping
565
+ // scalar: 3 add
566
+ float3 p = p0 + f;
567
+ // scalar: 3 mad
568
+ // TODO: need reverse???
569
+ float4 NoiseSample = tex::lookup_float4(PerlinNoise3DTexture, p / Extent + 0.5f / Extent); // +0.5f to get rid of bilinear offset
570
+
571
+ // reconstruct from 8bit (using mad with 2 constants and dot4 was same instruction count)
572
+ // scalar: 4 mad, 3 mul, 3 add
573
+ float3 n = float3(NoiseSample.x, NoiseSample.y, NoiseSample.z) * 255.0f / 127.0f - 1.0f;
574
+ float d = NoiseSample.w * 255.f - 127;
575
+ return math::dot(xyz, n) - d;
576
+ }
577
+
578
+ // Perlin-style "Modified Noise"
579
+ // http://www.umbc.edu/~olano/papers/index.html#mNoise
580
+ // @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D
581
+ // @param bTiling = repeat noise pattern
582
+ // @param RepeatSize = integer units before tiling in each dimension
583
+ // @return random number in the range -1 .. 1
584
+ float GradientNoise3D_ALU(float3 v, bool bTiling, float RepeatSize)
585
+ {
586
+ SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize);
587
+
588
+ float rand000 = MGradient(int(seeds.seed000), seeds.fv - float3(0, 0, 0)).w;
589
+ float rand100 = MGradient(int(seeds.seed100), seeds.fv - float3(1, 0, 0)).w;
590
+ float rand010 = MGradient(int(seeds.seed010), seeds.fv - float3(0, 1, 0)).w;
591
+ float rand110 = MGradient(int(seeds.seed110), seeds.fv - float3(1, 1, 0)).w;
592
+ float rand001 = MGradient(int(seeds.seed001), seeds.fv - float3(0, 0, 1)).w;
593
+ float rand101 = MGradient(int(seeds.seed101), seeds.fv - float3(1, 0, 1)).w;
594
+ float rand011 = MGradient(int(seeds.seed011), seeds.fv - float3(0, 1, 1)).w;
595
+ float rand111 = MGradient(int(seeds.seed111), seeds.fv - float3(1, 1, 1)).w;
596
+
597
+ float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0));
598
+
599
+ float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y);
600
+ float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y);
601
+ return math::lerp(i, j, Weights.z);
602
+ }
603
+
604
+ // 3D value noise - used to be incorrectly called Perlin noise
605
+ // @param v = 3D noise argument, use float3(x,y,0) for 2D or float3(x,0,0) for 1D
606
+ // @param bTiling = repeat noise pattern
607
+ // @param RepeatSize = integer units before tiling in each dimension
608
+ // @return random number in the range -1 .. 1
609
+ float ValueNoise3D_ALU(float3 v, bool bTiling, float RepeatSize)
610
+ {
611
+ SeedValue seeds = NoiseSeeds(v, bTiling, RepeatSize);
612
+
613
+ float rand000 = RandBBSfloat(seeds.seed000) * 2 - 1;
614
+ float rand100 = RandBBSfloat(seeds.seed100) * 2 - 1;
615
+ float rand010 = RandBBSfloat(seeds.seed010) * 2 - 1;
616
+ float rand110 = RandBBSfloat(seeds.seed110) * 2 - 1;
617
+ float rand001 = RandBBSfloat(seeds.seed001) * 2 - 1;
618
+ float rand101 = RandBBSfloat(seeds.seed101) * 2 - 1;
619
+ float rand011 = RandBBSfloat(seeds.seed011) * 2 - 1;
620
+ float rand111 = RandBBSfloat(seeds.seed111) * 2 - 1;
621
+
622
+ float4 Weights = PerlinRamp(float4(seeds.fv.x, seeds.fv.y, seeds.fv.z, 0));
623
+
624
+ float i = math::lerp(math::lerp(rand000, rand100, Weights.x), math::lerp(rand010, rand110, Weights.x), Weights.y);
625
+ float j = math::lerp(math::lerp(rand001, rand101, Weights.x), math::lerp(rand011, rand111, Weights.x), Weights.y);
626
+ return math::lerp(i, j, Weights.z);
627
+ }
628
+
629
+ // 3D jitter offset within a voronoi noise cell
630
+ // @param pos - integer lattice corner
631
+ // @return random offsets vector
632
+ float3 VoronoiCornerSample(float3 pos, int Quality)
633
+ {
634
+ // random values in [-0.5, 0.5]
635
+ float3 noise = float3(Rand3DPCG16(int3(pos))) / 0xffff - 0.5;
636
+
637
+ // quality level 1 or 2: searches a 2x2x2 neighborhood with points distributed on a sphere
638
+ // scale factor to guarantee jittered points will be found within a 2x2x2 search
639
+ if (Quality <= 2)
640
+ {
641
+ return math::normalize(noise) * 0.2588;
642
+ }
643
+
644
+ // quality level 3: searches a 3x3x3 neighborhood with points distributed on a sphere
645
+ // scale factor to guarantee jittered points will be found within a 3x3x3 search
646
+ if (Quality == 3)
647
+ {
648
+ return math::normalize(noise) * 0.3090;
649
+ }
650
+
651
+ // quality level 4: jitter to anywhere in the cell, needs 4x4x4 search
652
+ return noise;
653
+ }
654
+
655
+ // compare previous best with a new candidate
656
+ // not producing point locations makes it easier for compiler to eliminate calculations when they're not needed
657
+ // @param minval = location and distance of best candidate seed point before the new one
658
+ // @param candidate = candidate seed point
659
+ // @param offset = 3D offset to new candidate seed point
660
+ // @param bDistanceOnly = if true, only set maxval.w with distance, otherwise maxval.w is distance and maxval.xyz is position
661
+ // @return position (if bDistanceOnly is false) and distance to closest seed point so far
662
+ float4 VoronoiCompare(float4 minval, float3 candidate, float3 offset, bool bDistanceOnly)
663
+ {
664
+ if (bDistanceOnly)
665
+ {
666
+ return float4(0, 0, 0, math::min(minval.w, math::dot(offset, offset)));
667
+ }
668
+ else
669
+ {
670
+ float newdist = math::dot(offset, offset);
671
+ return newdist > minval.w ? minval : float4(candidate.x, candidate.y, candidate.z, newdist);
672
+ }
673
+ }
674
+
675
+ // 220 instruction Worley noise
676
+ float4 VoronoiNoise3D_ALU(float3 v, int Quality, bool bTiling, float RepeatSize, bool bDistanceOnly)
677
+ {
678
+ float3 fv = math::frac(v), fv2 = math::frac(v + 0.5);
679
+ float3 iv = math::floor(v), iv2 = math::floor(v + 0.5);
680
+
681
+ // with initial minimum distance = infinity (or at least bigger than 4), first min is optimized away
682
+ float4 mindist = float4(0,0,0,100);
683
+ float3 p, offset;
684
+
685
+ // quality level 3: do a 3x3x3 search
686
+ if (Quality == 3)
687
+ {
688
+ int offset_x;
689
+ int offset_y;
690
+ int offset_z;
691
+ for (offset_x = -1; offset_x <= 1; ++offset_x)
692
+ {
693
+ for (offset_y = -1; offset_y <= 1; ++offset_y)
694
+ {
695
+ for (offset_z = -1; offset_z <= 1; ++offset_z)
696
+ {
697
+ offset = float3(offset_x, offset_y, offset_z);
698
+ p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize), Quality);
699
+ mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly);
700
+ }
701
+ }
702
+ }
703
+ }
704
+
705
+ // everybody else searches a base 2x2x2 neighborhood
706
+ else
707
+ {
708
+ int offset_x;
709
+ int offset_y;
710
+ int offset_z;
711
+ for (offset_x = 0; offset_x <= 1; ++offset_x)
712
+ {
713
+ for (offset_y = 0; offset_y <= 1; ++offset_y)
714
+ {
715
+ for (offset_z = 0; offset_z <= 1; ++offset_z)
716
+ {
717
+ offset = float3(offset_x, offset_y, offset_z);
718
+ p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality);
719
+ mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly);
720
+
721
+ // quality level 2, do extra set of points, offset by half a cell
722
+ if (Quality == 2)
723
+ {
724
+ // 467 is just an offset to a different area in the random number field to avoid similar neighbor artifacts
725
+ p = offset + VoronoiCornerSample(NoiseTileWrap(iv2 + offset, bTiling, RepeatSize) + 467, Quality);
726
+ mindist = VoronoiCompare(mindist, iv2 + p, fv2 - p, bDistanceOnly);
727
+ }
728
+ }
729
+ }
730
+ }
731
+ }
732
+
733
+ // quality level 4: add extra sets of four cells in each direction
734
+ if (Quality >= 4)
735
+ {
736
+ int offset_x;
737
+ int offset_y;
738
+ int offset_z;
739
+ for (offset_x = -1; offset_x <= 2; offset_x += 3)
740
+ {
741
+ for (offset_y = 0; offset_y <= 1; ++offset_y)
742
+ {
743
+ for (offset_z = 0; offset_z <= 1; ++offset_z)
744
+ {
745
+ offset = float3(offset_x, offset_y, offset_z);
746
+ // along x axis
747
+ p = offset + VoronoiCornerSample(NoiseTileWrap(iv + offset, bTiling, RepeatSize), Quality);
748
+ mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly);
749
+
750
+ // along y axis
751
+ p = float3(offset.y, offset.z, offset.x) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.y, offset.z, offset.x), bTiling, RepeatSize), Quality);
752
+ mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly);
753
+
754
+ // along z axis
755
+ p = float3(offset.z, offset.x, offset.y) + VoronoiCornerSample(NoiseTileWrap(iv + float3(offset.z, offset.x, offset.y), bTiling, RepeatSize), Quality);
756
+ mindist = VoronoiCompare(mindist, iv + p, fv - p, bDistanceOnly);
757
+ }
758
+ }
759
+ }
760
+ }
761
+
762
+ // transform squared distance to real distance
763
+ return float4(mindist.x, mindist.y, mindist.z, math::sqrt(mindist.w));
764
+ }
765
+
766
+ // Coordinates for corners of a Simplex tetrahedron
767
+ // Based on McEwan et al., Efficient computation of noise in GLSL, JGT 2011
768
+ // @param v = 3D noise argument
769
+ // @return 4 corner locations
770
+ float4x3 SimplexCorners(float3 v)
771
+ {
772
+ // find base corner by skewing to tetrahedral space and back
773
+ float3 tet = math::floor(v + v.x/3 + v.y/3 + v.z/3);
774
+ float3 base = tet - tet.x/6 - tet.y/6 - tet.z/6;
775
+ float3 f = v - base;
776
+
777
+ // Find offsets to other corners (McEwan did this in tetrahedral space,
778
+ // but since skew is along x=y=z axis, this works in Euclidean space too.)
779
+ float3 g = math::step(float3(f.y,f.z,f.x), float3(f.x,f.y,f.z)), h = 1 - float3(g.z, g.x, g.y);
780
+ float3 a1 = math::min(g, h) - 1.0 / 6.0, a2 = math::max(g, h) - 1.0 / 3.0;
781
+
782
+ // four corners
783
+ return float4x3(base, base + a1, base + a2, base + 0.5);
784
+ }
785
+
786
+ // Improved smoothing function for simplex noise
787
+ // @param f = fractional distance to four tetrahedral corners
788
+ // @return weight for each corner
789
+ float4 SimplexSmooth(float4x3 f)
790
+ {
791
+ const float scale = 1024. / 375.; // scale factor to make noise -1..1
792
+ float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3]));
793
+ float4 s = math::saturate(2 * d);
794
+ return (1 * scale + s*(-3 * scale + s*(3 * scale - s*scale)));
795
+ }
796
+
797
+ // Derivative of simplex noise smoothing function
798
+ // @param f = fractional distanc eto four tetrahedral corners
799
+ // @return derivative of smoothing function for each corner by x, y and z
800
+ float3x4 SimplexDSmooth(float4x3 f)
801
+ {
802
+ const float scale = 1024. / 375.; // scale factor to make noise -1..1
803
+ float4 d = float4(math::dot(f[0], f[0]), math::dot(f[1], f[1]), math::dot(f[2], f[2]), math::dot(f[3], f[3]));
804
+ float4 s = math::saturate(2 * d);
805
+ s = -12 * scale + s*(24 * scale - s * 12 * scale);
806
+
807
+ return float3x4(
808
+ s * float4(f[0][0], f[1][0], f[2][0], f[3][0]),
809
+ s * float4(f[0][1], f[1][1], f[2][1], f[3][1]),
810
+ s * float4(f[0][2], f[1][2], f[2][2], f[3][2]));
811
+ }
812
+
813
+ // Simplex noise and its Jacobian derivative
814
+ // @param v = 3D noise argument
815
+ // @param bTiling = whether to repeat noise pattern
816
+ // @param RepeatSize = integer units before tiling in each dimension, must be a multiple of 3
817
+ // @return float3x3 Jacobian in J[*].xyz, vector noise in J[*].w
818
+ // J[0].w, J[1].w, J[2].w is a Perlin-style simplex noise with vector output, e.g. (Nx, Ny, Nz)
819
+ // J[i].x is X derivative of the i'th component of the noise so J[2].x is dNz/dx
820
+ // You can use this to compute the noise, gradient, curl, or divergence:
821
+ // float3x4 J = JacobianSimplex_ALU(...);
822
+ // float3 VNoise = float3(J[0].w, J[1].w, J[2].w); // 3D noise
823
+ // float3 Grad = J[0].xyz; // gradient of J[0].w
824
+ // float3 Curl = float3(J[1][2]-J[2][1], J[2][0]-J[0][2], J[0][1]-J[1][2]);
825
+ // float Div = J[0][0]+J[1][1]+J[2][2];
826
+ // All of these are confirmed to compile out all unneeded terms.
827
+ // So Grad of X doesn't compute Y or Z components, and VNoise doesn't do any of the derivative computation.
828
+ float3x4 JacobianSimplex_ALU(float3 v, bool bTiling, float RepeatSize)
829
+ {
830
+ int3 MGradientMask = int3(0x8000, 0x4000, 0x2000);
831
+ float3 MGradientScale = float3(1. / 0x4000, 1. / 0x2000, 1. / 0x1000);
832
+
833
+ // corners of tetrahedron
834
+ float4x3 T = SimplexCorners(v);
835
+ // TODO: uint3
836
+ int3 rand = int3(0);
837
+ float4x3 gvec0 = float4x3(1.0);
838
+ float4x3 gvec1 = float4x3(1.0);
839
+ float4x3 gvec2 = float4x3(1.0);
840
+ float4x3 fv = float4x3(1.0);
841
+ float3x4 grad = float3x4(1.0);
842
+
843
+ // processing of tetrahedral vertices, unrolled
844
+ // to compute gradient at each corner
845
+ fv[0] = v - T[0];
846
+ rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[0] + 0.5, bTiling, RepeatSize))));
847
+ gvec0[0] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1;
848
+ gvec1[0] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1;
849
+ gvec2[0] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1;
850
+ grad[0][0] = math::dot(gvec0[0], fv[0]);
851
+ grad[1][0] = math::dot(gvec1[0], fv[0]);
852
+ grad[2][0] = math::dot(gvec2[0], fv[0]);
853
+
854
+ fv[1] = v - T[1];
855
+ rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[1] + 0.5, bTiling, RepeatSize))));
856
+ gvec0[1] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1;
857
+ gvec1[1] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1;
858
+ gvec1[1] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1;
859
+ grad[0][1] = math::dot(gvec0[1], fv[1]);
860
+ grad[1][1] = math::dot(gvec1[1], fv[1]);
861
+ grad[2][1] = math::dot(gvec2[1], fv[1]);
862
+
863
+ fv[2] = v - T[2];
864
+ rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[2] + 0.5, bTiling, RepeatSize))));
865
+ gvec0[2] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1;
866
+ gvec1[2] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1;
867
+ gvec2[2] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1;
868
+ grad[0][2] = math::dot(gvec0[2], fv[2]);
869
+ grad[1][2] = math::dot(gvec1[2], fv[2]);
870
+ grad[2][2] = math::dot(gvec2[2], fv[2]);
871
+
872
+ fv[3] = v - T[3];
873
+ rand = Rand3DPCG16(int3(math::floor(NoiseTileWrap(6 * T[3] + 0.5, bTiling, RepeatSize))));
874
+ gvec0[3] = float3(int3(rand.x,rand.x,rand.x) & MGradientMask) * MGradientScale - 1;
875
+ gvec1[3] = float3(int3(rand.y,rand.y,rand.y) & MGradientMask) * MGradientScale - 1;
876
+ gvec2[3] = float3(int3(rand.z,rand.z,rand.z) & MGradientMask) * MGradientScale - 1;
877
+ grad[0][3] = math::dot(gvec0[3], fv[3]);
878
+ grad[1][3] = math::dot(gvec1[3], fv[3]);
879
+ grad[2][3] = math::dot(gvec2[3], fv[3]);
880
+
881
+ // blend gradients
882
+ float4 sv = SimplexSmooth(fv);
883
+ float3x4 ds = SimplexDSmooth(fv);
884
+
885
+ float3x4 jacobian = float3x4(1.0);
886
+ float3 vec0 = gvec0*sv + grad[0]*ds; // NOTE: mdl is column major, convert from UE4 (row major)
887
+ jacobian[0] = float4(vec0.x, vec0.y, vec0.z, math::dot(sv, grad[0]));
888
+ float3 vec1 = gvec1*sv + grad[1]*ds;
889
+ jacobian[1] = float4(vec1.x, vec1.y, vec1.z, math::dot(sv, grad[1]));
890
+ float3 vec2 = gvec2*sv + grad[2]*ds;
891
+ jacobian[2] = float4(vec2.x, vec2.y, vec2.z, math::dot(sv, grad[2]));
892
+
893
+ return jacobian;
894
+ }
895
+
896
+ // While RepeatSize is a float here, the expectation is that it would be largely integer values coming in from the UI. The downstream logic assumes
897
+ // floats for all called functions (NoiseTileWrap) and this prevents any float-to-int conversion errors from automatic type conversion.
898
+ float Noise3D_Multiplexer(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, int Function, float3 Position, int Quality, bool bTiling, float RepeatSize)
899
+ {
900
+ // verified, HLSL compiled out the switch if Function is a constant
901
+ switch(Function)
902
+ {
903
+ case 0:
904
+ return SimplexNoise3D_TEX(PerlinNoiseGradientTexture, Position);
905
+ case 1:
906
+ return GradientNoise3D_TEX(PerlinNoiseGradientTexture, Position, bTiling, RepeatSize);
907
+ case 2:
908
+ return FastGradientPerlinNoise3D_TEX(PerlinNoise3DTexture, Position);
909
+ case 3:
910
+ return GradientNoise3D_ALU(Position, bTiling, RepeatSize);
911
+ case 4:
912
+ return ValueNoise3D_ALU(Position, bTiling, RepeatSize);
913
+ case 5:
914
+ return VoronoiNoise3D_ALU(Position, Quality, bTiling, RepeatSize, true).w * 2.0 - 1.0;
915
+ }
916
+ return 0;
917
+ }
918
+ //----------------------------------------------------------
919
+
920
+ export float noise(uniform texture_2d PerlinNoiseGradientTexture, uniform texture_3d PerlinNoise3DTexture, float3 Position, float Scale, float Quality, float Function, float Turbulence, float Levels, float OutputMin, float OutputMax, float LevelScale, float FilterWidth, float Tiling, float RepeatSize)
921
+ [[
922
+ anno::description("Noise"),
923
+ anno::noinline()
924
+ ]]
925
+ {
926
+ Position *= Scale;
927
+ FilterWidth *= Scale;
928
+
929
+ float Out = 0.0f;
930
+ float OutScale = 1.0f;
931
+ float InvLevelScale = 1.0f / LevelScale;
932
+
933
+ int iFunction(Function);
934
+ int iQuality(Quality);
935
+ int iLevels(Levels);
936
+ bool bTurbulence(Turbulence);
937
+ bool bTiling(Tiling);
938
+
939
+ for(int i = 0; i < iLevels; ++i)
940
+ {
941
+ // fade out noise level that are too high frequent (not done through dynamic branching as it usually requires gradient instructions)
942
+ OutScale *= math::saturate(1.0 - FilterWidth);
943
+
944
+ if(bTurbulence)
945
+ {
946
+ Out += math::abs(Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize)) * OutScale;
947
+ }
948
+ else
949
+ {
950
+ Out += Noise3D_Multiplexer(PerlinNoiseGradientTexture, PerlinNoise3DTexture, iFunction, Position, iQuality, bTiling, RepeatSize) * OutScale;
951
+ }
952
+
953
+ Position *= LevelScale;
954
+ RepeatSize *= LevelScale;
955
+ OutScale *= InvLevelScale;
956
+ FilterWidth *= LevelScale;
957
+ }
958
+
959
+ if(!bTurbulence)
960
+ {
961
+ // bring -1..1 to 0..1 range
962
+ Out = Out * 0.5f + 0.5f;
963
+ }
964
+
965
+ // Out is in 0..1 range
966
+ return math::lerp(OutputMin, OutputMax, Out);
967
+ }
968
+
969
+ // Material node for noise functions returning a vector value
970
+ // @param LevelScale usually 2 but higher values allow efficient use of few levels
971
+ // @return in user defined range (OutputMin..OutputMax)
972
+ export float4 vector4_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize)
973
+ [[
974
+ anno::description("Vector Noise"),
975
+ anno::noinline()
976
+ ]]
977
+ {
978
+ float4 result = float4(0,0,0,1);
979
+ float3 ret = float3(0);
980
+ int iQuality = int(Quality);
981
+ int iFunction = int(Function);
982
+ bool bTiling = Tiling > 0.0;
983
+
984
+ float3x4 Jacobian = JacobianSimplex_ALU(Position, bTiling, TileSize); // compiled out if not used
985
+
986
+ // verified, HLSL compiled out the switch if Function is a constant
987
+ switch (iFunction)
988
+ {
989
+ case 0: // Cellnoise
990
+ ret = float3(Rand3DPCG16(int3(math::floor(NoiseTileWrap(Position, bTiling, TileSize))))) / 0xffff;
991
+ result = float4(ret.x, ret.y, ret.z, 1);
992
+ break;
993
+ case 1: // Color noise
994
+ ret = float3(Jacobian[0].w, Jacobian[1].w, Jacobian[2].w);
995
+ result = float4(ret.x, ret.y, ret.z, 1);
996
+ break;
997
+ case 2: // Gradient
998
+ result = Jacobian[0];
999
+ break;
1000
+ case 3: // Curl
1001
+ ret = float3(Jacobian[2][1] - Jacobian[1][2], Jacobian[0][2] - Jacobian[2][0], Jacobian[1][0] - Jacobian[0][1]);
1002
+ result = float4(ret.x, ret.y, ret.z, 1);
1003
+ break;
1004
+ case 4: // Voronoi
1005
+ result = VoronoiNoise3D_ALU(Position, iQuality, bTiling, TileSize, false);
1006
+ break;
1007
+ }
1008
+ return result;
1009
+ }
1010
+
1011
+ export float3 vector3_noise(float3 Position, float Quality, float Function, float Tiling, float TileSize)
1012
+ [[
1013
+ anno::description("Vector Noise float3 version"),
1014
+ anno::noinline()
1015
+ ]]
1016
+ {
1017
+ float4 noise = vector4_noise(Position, Quality, Function, Tiling, TileSize);
1018
+ return float3(noise.x, noise.y, noise.z);
1019
+ }
1020
+
1021
+
1022
+ // workaround for ue4 fresnel (without supporting for camera vector) : replacing it with 0.0, means facing to the view
1023
+ export float fresnel(float exponent [[anno::unused()]], float base_reflect_fraction [[anno::unused()]], float3 normal [[anno::unused()]])
1024
+ [[
1025
+ anno::description("Fresnel"),
1026
+ anno::noinline()
1027
+ ]]
1028
+ {
1029
+ return 0.0;
1030
+ }
1031
+
1032
+ export float fresnel_function(float3 normal_vector [[anno::unused()]], float3 camera_vector [[anno::unused()]],
1033
+ bool invert_fresnel [[anno::unused()]], float power [[anno::unused()]],
1034
+ bool use_cheap_contrast [[anno::unused()]], float cheap_contrast_dark [[anno::unused()]], float cheap_contrast_bright [[anno::unused()]],
1035
+ bool clamp_fresnel_dot_product [[anno::unused()]])
1036
+ [[
1037
+ anno::description("Fresnel Function"),
1038
+ anno::noinline()
1039
+ ]]
1040
+ {
1041
+ return 0.0;
1042
+ }
1043
+
1044
+ export float3 camera_vector()
1045
+ [[
1046
+ anno::description("Camera Vector"),
1047
+ anno::noinline()
1048
+ ]]
1049
+ {
1050
+ // assume camera postion is 0,0,0
1051
+ return math::normalize(float3(0) - state::transform_point(state::coordinate_internal,state::coordinate_world,state::position()));
1052
+ }
1053
+
1054
+ export float pixel_depth()
1055
+ [[
1056
+ anno::description("Pixel Depth"),
1057
+ anno::noinline()
1058
+ ]]
1059
+ {
1060
+ return 256.0f;
1061
+ }
1062
+
1063
+ export float scene_depth()
1064
+ [[
1065
+ anno::description("Scene Depth")
1066
+ ]]
1067
+ {
1068
+ return 65500.0f;
1069
+ }
1070
+
1071
+ export float3 scene_color()
1072
+ [[
1073
+ anno::description("Scene Color")
1074
+ ]]
1075
+ {
1076
+ return float3(1.0f);
1077
+ }
1078
+
1079
+ export float4 vertex_color()
1080
+ [[
1081
+ anno::description("Vertex Color"),
1082
+ anno::noinline()
1083
+ ]]
1084
+ {
1085
+ return float4(1.0f);
1086
+ }
1087
+
1088
+ export float4 vertex_color_from_coordinate(int VertexColorCoordinateIndex)
1089
+ [[
1090
+ anno::description("Vertex Color for float2 PrimVar"),
1091
+ anno::noinline()
1092
+ ]]
1093
+ {
1094
+ // Kit only supports 4 uv sets, 2 uvs are available to vertex color. if vertex color index is invalid, output the constant WHITE color intead
1095
+ return (VertexColorCoordinateIndex > 2) ? float4(1.0f) : float4(state::texture_coordinate(VertexColorCoordinateIndex).x, state::texture_coordinate(VertexColorCoordinateIndex).y, state::texture_coordinate(VertexColorCoordinateIndex+1).x, state::texture_coordinate(VertexColorCoordinateIndex+1).y);
1096
+ }
1097
+
1098
+ export float3 camera_position()
1099
+ [[
1100
+ anno::description("Camera Position"),
1101
+ anno::noinline()
1102
+ ]]
1103
+ {
1104
+ return float3(1000.0f, 0, 0);
1105
+ }
1106
+
1107
+ export float3 rotate_about_axis(float4 NormalizedRotationAxisAndAngle, float3 PositionOnAxis, float3 Position)
1108
+ [[
1109
+ anno::description("Rotates Position about the given axis by the given angle")
1110
+ ]]
1111
+ {
1112
+ // Project Position onto the rotation axis and find the closest point on the axis to Position
1113
+ float3 NormalizedRotationAxis = float3(NormalizedRotationAxisAndAngle.x,NormalizedRotationAxisAndAngle.y,NormalizedRotationAxisAndAngle.z);
1114
+ float3 ClosestPointOnAxis = PositionOnAxis + NormalizedRotationAxis * math::dot(NormalizedRotationAxis, Position - PositionOnAxis);
1115
+ // Construct orthogonal axes in the plane of the rotation
1116
+ float3 UAxis = Position - ClosestPointOnAxis;
1117
+ float3 VAxis = math::cross(NormalizedRotationAxis, UAxis);
1118
+ float[2] SinCosAngle = math::sincos(NormalizedRotationAxisAndAngle.w);
1119
+ // Rotate using the orthogonal axes
1120
+ float3 R = UAxis * SinCosAngle[1] + VAxis * SinCosAngle[0];
1121
+ // Reconstruct the rotated world space position
1122
+ float3 RotatedPosition = ClosestPointOnAxis + R;
1123
+ // Convert from position to a position offset
1124
+ return RotatedPosition - Position;
1125
+ }
1126
+
1127
+ export float2 rotate_scale_offset_texcoords(float2 InTexCoords, float4 InRotationScale, float2 InOffset)
1128
+ [[
1129
+ anno::description("Returns a float2 texture coordinate after 2x2 transform and offset applied")
1130
+ ]]
1131
+ {
1132
+ return float2(math::dot(InTexCoords, float2(InRotationScale.x, InRotationScale.y)), math::dot(InTexCoords, float2(InRotationScale.z, InRotationScale.w))) + InOffset;
1133
+ }
1134
+
1135
+ export float3 reflection_custom_world_normal(float3 WorldNormal, bool bNormalizeInputNormal)
1136
+ [[
1137
+ anno::description("Reflection vector about the specified world space normal")
1138
+ ]]
1139
+ {
1140
+ if (bNormalizeInputNormal)
1141
+ {
1142
+ WorldNormal = math::normalize(WorldNormal);
1143
+ }
1144
+
1145
+ return -camera_vector() + WorldNormal * math::dot(WorldNormal, camera_vector()) * 2.0;
1146
+ }
1147
+
1148
+ export float3 reflection_vector()
1149
+ [[
1150
+ anno::description("Reflection Vector"),
1151
+ anno::noinline()
1152
+ ]]
1153
+ {
1154
+ float3 normal = state::transform_normal(state::coordinate_internal,state::coordinate_world,state::normal());
1155
+ return reflection_custom_world_normal(normal, false);
1156
+ }
1157
+
1158
+ export float dither_temporalAA(float AlphaThreshold = 0.5f, float Random = 1.0f [[anno::unused()]])
1159
+ [[
1160
+ anno::description("Dither TemporalAA"),
1161
+ anno::noinline()
1162
+ ]]
1163
+ {
1164
+ return AlphaThreshold;
1165
+ }
1166
+
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/Textures/OmniUe4Translucent.mdl ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /******************************************************************************
2
+ * Copyright 1986, 2019 NVIDIA ARC GmbH. All rights reserved. *
3
+ ******************************************************************************
4
+
5
+ Permission is hereby granted by NVIDIA Corporation ("NVIDIA"), free of charge,
6
+ to any person obtaining a copy of the sample definition code that uses our
7
+ Material Definition Language (the "MDL Materials"), to reproduce and distribute
8
+ the MDL Materials, including without limitation the rights to use, copy, merge,
9
+ publish, distribute, and sell modified and unmodified copies of the MDL
10
+ Materials, and to permit persons to whom the MDL Materials is furnished to do
11
+ so, in all cases solely for use with NVIDIA’s Material Definition Language,
12
+ subject to the following further conditions:
13
+
14
+ 1. The above copyright notices, this list of conditions, and the disclaimer
15
+ that follows shall be retained in all copies of one or more of the MDL
16
+ Materials, including in any software with which the MDL Materials are bundled,
17
+ redistributed, and/or sold, and included either as stand-alone text files,
18
+ human-readable headers or in the appropriate machine-readable metadata fields
19
+ within text or binary files as long as those fields can be easily viewed by the
20
+ user, as applicable.
21
+ 2. The name of NVIDIA shall not be used to promote, endorse or advertise any
22
+ Modified Version without specific prior written permission, except a) to comply
23
+ with the notice requirements otherwise contained herein; or b) to acknowledge
24
+ the contribution(s) of NVIDIA.
25
+
26
+ THE MDL MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
27
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
28
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
29
+ TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR
30
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL,
31
+ INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF
32
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE
33
+ THE MDL MATERIALS OR FROM OTHER DEALINGS IN THE MDL MATERIALS.
34
+ */
35
+
36
+ //* 1.0.0 - first version
37
+ //* 1.0.1 - Emissive color affected by opacity
38
+ // - Support opacity mask
39
+ //* 1.0.2 - Unlit translucent
40
+ //* 1.0.3 - specular bsdf instead of microfacet ggx smith bsdf
41
+
42
+ mdl 1.3;
43
+
44
+ import df::*;
45
+ import state::*;
46
+ import math::*;
47
+ import tex::*;
48
+ import anno::*;
49
+
50
+ float emissive_multiplier()
51
+ [[
52
+ anno::description("the multiplier to convert UE4 emissive to raw data"),
53
+ anno::noinline()
54
+ ]]
55
+ {
56
+ return 20.0f * 128.0f;
57
+ }
58
+
59
+ color get_translucent_tint(color base_color, float opacity)
60
+ [[
61
+ anno::description("base color of UE4 translucent"),
62
+ anno::noinline()
63
+ ]]
64
+ {
65
+ return math::lerp(color(1.0), base_color, opacity);
66
+ }
67
+
68
+ // Just for UE4 distilling
69
+ float get_translucent_opacity(float opacity)
70
+ [[
71
+ anno::noinline()
72
+ ]]
73
+ {
74
+ return opacity;
75
+ }
76
+
77
+ color get_emissive_intensity(color emissive, float opacity)
78
+ [[
79
+ anno::description("emissive color of UE4 translucent"),
80
+ anno::noinline()
81
+ ]]
82
+ {
83
+ return emissive * opacity;
84
+ }
85
+
86
+ float3 tangent_space_normal(
87
+ float3 normal = float3(0.0,0.0,1.0),
88
+ float3 tangent_u = state::texture_tangent_u(0),
89
+ float3 tangent_v = state::texture_tangent_v(0)
90
+ )
91
+ [[
92
+ anno::description("Interprets the vector in tangent space"),
93
+ anno::noinline()
94
+ ]]
95
+ {
96
+ return math::normalize(
97
+ tangent_u * normal.x +
98
+ tangent_v * normal.y +
99
+ state::normal() * (normal.z));
100
+ }
101
+
102
+ export material OmniUe4Translucent(
103
+ float3 base_color = float3(0.0, 0.0, 0.0),
104
+ float metallic = 0.0,
105
+ float roughness = 0.5,
106
+ float specular = 0.5,
107
+ float3 normal = float3(0.0,0.0,1.0),
108
+ float opacity = 1.0,
109
+ float opacity_mask = 1.0,
110
+ float3 emissive_color = float3(0.0, 0.0, 0.0),
111
+ float3 displacement = float3(0.0),
112
+ uniform float refraction = 1.0,
113
+ uniform bool two_sided = false,
114
+ uniform bool is_tangent_space_normal = true,
115
+ uniform bool is_unlit = false
116
+ )
117
+ [[
118
+ anno::display_name("Omni UE4 Translucent"),
119
+ anno::description("Omni UE4 Translucent, supports UE4 Translucent shading model"),
120
+ anno::version( 1, 0, 0),
121
+ anno::author("NVIDIA CORPORATION"),
122
+ anno::key_words(string[]("omni", "UE4", "omniverse", "translucent"))
123
+ ]]
124
+ = let {
125
+ color final_base_color = math::saturate(base_color);
126
+ float final_metallic = math::saturate(metallic);
127
+ float final_roughness = math::saturate(roughness);
128
+ float final_specular = math::saturate(specular);
129
+ color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/
130
+ float final_opacity = math::saturate(opacity);
131
+ float3 final_normal = math::normalize(normal);
132
+
133
+
134
+ // - compute final roughness by squaring the "roughness" parameter
135
+ float alpha = final_roughness * final_roughness;
136
+ // reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering
137
+ float grazing_refl = math::max((1.0 - final_roughness), 0.0);
138
+
139
+ float3 the_normal = is_unlit ? state::normal() :
140
+ (is_tangent_space_normal ? tangent_space_normal(
141
+ normal: final_normal,
142
+ tangent_u: state::texture_tangent_u(0),
143
+ tangent_v: state::texture_tangent_v(0)
144
+ ) : final_normal);
145
+
146
+ // for the dielectric component we layer the glossy component on top of the diffuse one,
147
+ // the glossy layer has no color tint
148
+
149
+ bsdf dielectric_component = df::custom_curve_layer(
150
+ weight: final_specular,
151
+ normal_reflectivity: 0.08,
152
+ grazing_reflectivity: grazing_refl,
153
+ layer: df::microfacet_ggx_vcavities_bsdf(roughness_u: alpha),
154
+ base: df::diffuse_reflection_bsdf(tint: final_base_color));
155
+
156
+ // the metallic component doesn't have a diffuse component, it's only glossy
157
+ // base_color is applied to tint it
158
+ bsdf metallic_component = df::microfacet_ggx_vcavities_bsdf(tint: final_base_color, roughness_u: alpha);
159
+
160
+ // final BSDF is a linear blend between dielectric and metallic component
161
+ bsdf dielectric_metal_mix =
162
+ df::normalized_mix(
163
+ components:
164
+ df::bsdf_component[](
165
+ df::bsdf_component(
166
+ component: metallic_component,
167
+ weight: final_metallic),
168
+ df::bsdf_component(
169
+ component: dielectric_component,
170
+ weight: 1.0-final_metallic)
171
+ )
172
+ );
173
+
174
+ bsdf frosted_bsdf = df::specular_bsdf(
175
+ tint: color(1),
176
+ mode: df::scatter_reflect_transmit
177
+ );
178
+
179
+ bsdf final_mix_bsdf =
180
+ is_unlit ? df::specular_bsdf(
181
+ tint: get_translucent_tint(base_color: final_base_color, opacity: final_opacity),
182
+ mode: df::scatter_reflect_transmit
183
+ )
184
+ : df::normalized_mix(
185
+ components:
186
+ df::bsdf_component[](
187
+ df::bsdf_component(
188
+ component: dielectric_metal_mix,
189
+ weight: get_translucent_opacity(final_opacity)),
190
+ df::bsdf_component(
191
+ component: frosted_bsdf,
192
+ weight: 1.0-get_translucent_opacity(final_opacity))
193
+ )
194
+ );
195
+ }
196
+ in material(
197
+ thin_walled: two_sided, // Graphene?
198
+ ior: color(refraction), //refraction
199
+ surface: material_surface(
200
+ scattering: final_mix_bsdf,
201
+ emission:
202
+ material_emission (
203
+ emission: df::diffuse_edf (),
204
+ intensity: get_emissive_intensity(emissive: final_emissive_color, opacity: final_opacity)
205
+ )
206
+ ),
207
+
208
+ geometry: material_geometry(
209
+ displacement: displacement,
210
+ normal: the_normal,
211
+ cutout_opacity: opacity_mask
212
+ )
213
+ );
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Materials/WorldGridMaterial.mdl ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ mdl 1.3;
2
+
3
+ import math::*;
4
+ import state::*;
5
+ import tex::*;
6
+ import anno::*;
7
+ using OmniUe4Function import *;
8
+ using OmniUe4Base import *;
9
+
10
+ export annotation sampler_color();
11
+ export annotation sampler_normal();
12
+ export annotation sampler_grayscale();
13
+ export annotation sampler_alpha();
14
+ export annotation sampler_masks();
15
+ export annotation sampler_distancefield();
16
+ export annotation dither_masked_off();
17
+ export annotation world_space_normal();
18
+
19
+ export material WorldGridMaterial(
20
+ )
21
+ =
22
+ let {
23
+ float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0);
24
+ float2 CustomizedUV0_mdl = float2(state::texture_coordinate(0).x,1.0-state::texture_coordinate(0).y);
25
+
26
+ float2 Local0 = (CustomizedUV0_mdl / 2.0);
27
+ float2 Local1 = (Local0 / 0.05);
28
+ float4 Local2 = ::unpack_normal_map(tex::lookup_float4(texture_2d("./Textures/T_Default_Material_Grid_N.png",::tex::gamma_linear),float2(Local1.x,1.0-Local1.y),tex::wrap_repeat,tex::wrap_repeat));
29
+ float3 Local3 = (float3(Local2.x,Local2.y,Local2.z) * float3(0.3,0.3,1.0));
30
+
31
+ float3 Normal_mdl = Local3;
32
+
33
+ float2 Local4 = (CustomizedUV0_mdl * 20.0);
34
+ float4 Local5 = tex::lookup_float4(texture_2d("./Textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local4.x,1.0-Local4.y),tex::wrap_repeat,tex::wrap_repeat);
35
+ float Local6 = math::lerp(0.4,1.0,Local5.x);
36
+ float Local7 = (1.0 - Local6);
37
+ float2 Local8 = (Local0 / 0.1);
38
+ float4 Local9 = tex::lookup_float4(texture_2d("./Textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local8.x,1.0-Local8.y),tex::wrap_repeat,tex::wrap_repeat);
39
+ float Local10 = math::lerp(Local9.y,1.0,0.0);
40
+ float Local11 = math::lerp(Local6,Local7,Local10);
41
+ float4 Local12 = tex::lookup_float4(texture_2d("./Textures/T_Default_Material_Grid_M.png",::tex::gamma_linear),float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat);
42
+ float Local13 = math::lerp(Local9.y,0.0,0.0);
43
+ float Local14 = (Local12.y + Local13);
44
+ float Local15 = math::lerp(Local14,0.5,0.5);
45
+ float Local16 = math::lerp(0.295,0.66,Local15);
46
+ float Local17 = (Local16 * 0.5);
47
+ float Local18 = (Local11 * Local17);
48
+ float Local19 = math::lerp(0.0,0.5,Local12.y);
49
+ float Local20 = math::lerp(0.7,1.0,Local9.y);
50
+ float Local21 = math::lerp(Local20,1.0,0.0);
51
+ float Local22 = (Local21 * 1.0);
52
+ float Local23 = (Local19 + Local22);
53
+ float Local24 = math::min(math::max(Local23,0.0),1.0);
54
+
55
+ float3 EmissiveColor_mdl = float3(0.0,0.0,0.0);
56
+ float OpacityMask_mdl = 1.0;
57
+ float3 BaseColor_mdl = float3(Local18,Local18,Local18);
58
+ float Metallic_mdl = 0.0;
59
+ float Specular_mdl = 0.5;
60
+ float Roughness_mdl = Local24;
61
+
62
+ } in
63
+ ::OmniUe4Base(
64
+ base_color: BaseColor_mdl,
65
+ metallic: Metallic_mdl,
66
+ roughness: Roughness_mdl,
67
+ specular: Specular_mdl,
68
+ normal: Normal_mdl,
69
+ opacity: OpacityMask_mdl,
70
+ emissive_color: EmissiveColor_mdl,
71
+ displacement: WorldPositionOffset_mdl,
72
+ two_sided: false);
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/SM_Template_Map_Floor.usd ADDED
Binary file (6.74 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_bottom.usd ADDED
Binary file (26.2 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_back.usd ADDED
Binary file (8.95 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_back001.usd ADDED
Binary file (8.97 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner.usd ADDED
Binary file (16.7 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner001.usd ADDED
Binary file (16.7 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner002.usd ADDED
Binary file (16.7 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner003.usd ADDED
Binary file (16.7 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner004.usd ADDED
Binary file (16.7 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner005.usd ADDED
Binary file (16.7 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner006.usd ADDED
Binary file (16.7 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_corner007.usd ADDED
Binary file (16.7 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_front_center.usd ADDED
Binary file (8.8 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_front_center001.usd ADDED
Binary file (8.78 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_front_center_side.usd ADDED
Binary file (8.88 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_front_center_side001.usd ADDED
Binary file (8.97 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_front_center_side002.usd ADDED
Binary file (8.88 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_front_center_side003.usd ADDED
Binary file (8.87 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_side.usd ADDED
Binary file (8.96 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_side001.usd ADDED
Binary file (8.97 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_side002.usd ADDED
Binary file (8.98 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_rim_side003.usd ADDED
Binary file (8.96 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_floor_top.usd ADDED
Binary file (26.2 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_florr_edge.usd ADDED
Binary file (56 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_florr_edge001.usd ADDED
Binary file (55.9 kB). View file
 
code/third_party/omniverse_assets/Assets/Isaac/5.1/Isaac/Environments/Simple_Room/Props/Towel_Room01_lamp.usd ADDED
Binary file (22.2 kB). View file