Skip to content

Support VRay materials in Omniverse with custom MDL + optional OmniPBR, other asset export changes #1173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 23 commits into
base: og-develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dfbd2c1
Small changes to asset conversion
cgokmen Apr 9, 2025
7eaf29e
Merge branch 'og-develop' into asset-export-fixes
cgokmen Apr 9, 2025
695ecb4
Merge branch 'og-develop' into asset-export-fixes
cgokmen Apr 9, 2025
ba7c06f
Update teleop_utils.py
cgokmen Apr 9, 2025
fad6f8c
Add support for vray materials
cgokmen Apr 22, 2025
5fdeee3
fix recursively_convert_to_torch for visual particle
ChengshuLi Apr 16, 2025
fa95de4
fix saturated state - only store whitelist limit
ChengshuLi Apr 17, 2025
d25d97f
improve state dumping / loading efficiency by explicitly caching scen…
cremebrule Apr 25, 2025
cefe8c4
Prepare for new vray material format
cgokmen Apr 27, 2025
f19b3a9
Implement the texture map setter
cgokmen Apr 27, 2025
44c424f
Fix all the MDL formats - we should be good to go now!
cgokmen Apr 27, 2025
17e2822
Some windows fixes
cgokmen Apr 27, 2025
ee27ed0
Merge remote-tracking branch 'origin/asset-export-41' into asset-expo…
cgokmen Apr 27, 2025
634e39e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 27, 2025
02ee4c2
Merge branch 'og-develop' into asset-export-fixes
cgokmen Apr 27, 2025
e92edfc
Merge branch 'asset-export-fixes' of https://github.com/StanfordVL/Om…
cgokmen Apr 27, 2025
d1821d2
Fix relative MDL import
cgokmen Apr 27, 2025
5cee6ae
Merge remote-tracking branch 'origin/asset-export-41' into asset-expo…
cgokmen Apr 27, 2025
3384fbf
Add support for forcing PBR material
cgokmen Apr 28, 2025
76154fb
Major changes to the MDL - cleanup required but great performance!
cgokmen Apr 28, 2025
bd9beaf
Back to PBR for now
cgokmen Apr 28, 2025
45c77b5
Set the default back to vray
cgokmen Apr 28, 2025
3584e70
Don't forget to rename vray material
cgokmen Apr 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 16 additions & 19 deletions omnigibson/examples/scenes/scene_selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,6 @@ def main(random_selection=False, headless=False, short_exec=False):
"type": scene_type,
"scene_model": scene_model,
},
"robots": [
{
"type": "Turtlebot",
"obs_modalities": ["scan", "rgb", "depth"],
"action_type": "continuous",
"action_normalize": True,
},
],
}

# If the scene type is interactive, also check if we want to quick load or full load the scene
Expand All @@ -52,7 +44,15 @@ def main(random_selection=False, headless=False, short_exec=False):
}
load_mode = choose_from_options(options=load_options, name="load mode", random_selection=random_selection)
if load_mode == "Quick":
cfg["scene"]["load_object_categories"] = ["floors", "walls", "ceilings"]
cfg["scene"]["load_object_categories"] = [
"floors",
"walls",
"ceilings",
"lawn",
"driveway",
"roof",
"rail_fence",
]

# Load the environment
env = og.Environment(configs=cfg)
Expand All @@ -62,16 +62,13 @@ def main(random_selection=False, headless=False, short_exec=False):
og.sim.enable_viewer_camera_teleoperation()

# Run a simple loop and reset periodically
max_iterations = 10 if not short_exec else 1
for j in range(max_iterations):
og.log.info("Resetting environment")
env.reset()
for i in range(100):
action = env.action_space.sample()
state, reward, terminated, truncated, info = env.step(action)
if terminated or truncated:
og.log.info("Episode finished after {} timesteps".format(i + 1))
break
steps = 0
while not short_exec or steps < 1000:
state, reward, terminated, truncated, info = env.step(None)
if terminated or truncated:
og.log.info("Episode finished after {} timesteps".format(steps + 1))
break
steps += 1

# Always close the environment at the end
og.clear()
Expand Down
3 changes: 3 additions & 0 deletions omnigibson/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ def determine_gm_path(default_path, env_var_name):
# Forced light intensity for all DatasetObjects. None if the USD-provided intensities should be respected.
gm.FORCE_LIGHT_INTENSITY = 10000

# Whether to default the dataset objects to use the shipped V-Ray or OmniPBR materials
gm.USE_PBR_MATERIALS = False

# Forced roughness for all DatasetObjects. None if the USD-provided roughness maps should be respected.
gm.FORCE_ROUGHNESS = 0.7

Expand Down
71 changes: 71 additions & 0 deletions omnigibson/materials/omnigibson_vray_mtl.mdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
///\authors: Stanford Vision and Learning Lab, Cem Gokmen
///\description: OmniGibson VRay material baked from 3ds Max, with texture map inputs.

mdl 1.6;

// Import
import ::anno::*;
import ::base::texture_return;
import vray_maps::VRayBitmap;
import vray_maps::VRayBitmap_bump;
import vray_maps::vray_mono_output;
import vray_materials::VRayMtl;

export material OmniGibsonVRayMtl(
uniform texture_2d diffuse_texture = texture_2d() [[
anno::display_name("Diffuse Map"),
anno::in_group("Maps")
]],
uniform texture_2d normal_texture = texture_2d() [[
anno::display_name("Normal Map"),
anno::in_group("Maps")
]],
uniform texture_2d glossiness_texture = texture_2d() [[
anno::display_name("Reflection Glossiness Map"),
anno::in_group("Maps")
]],
uniform texture_2d metalness_texture = texture_2d() [[
anno::display_name("Metalness Map"),
anno::in_group("Maps")
]],
uniform texture_2d refraction_texture = texture_2d() [[
anno::display_name("Refraction Map"),
anno::in_group("Maps")
]],
uniform texture_2d reflection_texture = texture_2d() [[
anno::display_name("Reflection Map"),
anno::in_group("Maps")
]],
uniform texture_2d reflection_ior_texture = texture_2d() [[
anno::display_name("Fresnel Reflection IOR Map"),
anno::in_group("Maps")
]]
)
[[
anno::display_name("OmniGibsonVRayMtl")
]]
= vray_materials::VRayMtl(
Diffuse : vray_maps::VRayBitmap(
filename : diffuse_texture
).tint,
Reflection : vray_maps::VRayBitmap(
filename : reflection_texture
).tint,
reflection_glossiness : vray_maps::VRayBitmap(
filename : glossiness_texture
).mono,
reflection_fresnel : true,
reflection_ior : vray_maps::VRayBitmap(
filename : reflection_ior_texture
).mono,
reflection_lockIOR : false,
reflection_metalness : vray_maps::VRayBitmap(
filename : metalness_texture
).mono,
Refraction : vray_maps::VRayBitmap(
filename : refraction_texture
).tint,
texmap_bump : vray_maps::VRayBitmap_bump(
filename : normal_texture
)
);
Loading
Loading