Skip to content
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

Added HQ world #10

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

17 changes: 17 additions & 0 deletions andino_isaac/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cmake_minimum_required(VERSION 3.8)
project(andino_isaac)

find_package(ament_cmake REQUIRED)

install(
DIRECTORY
config
launch
tools
isaac_worlds
andino_isaac_description
DESTINATION
share/${PROJECT_NAME}/
)

ament_package()
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,865 changes: 1,865 additions & 0 deletions andino_isaac/andino_isaac_description/just_andino.usda

Large diffs are not rendered by default.

File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
mdl 1.3;

import ::math::*;
import ::state::*;
import ::tex::*;
import ::anno::*;
using OmniUe4Function import *;
using OmniUe4Base import *;

export annotation sampler_color();
export annotation sampler_normal();
export annotation sampler_grayscale();
export annotation sampler_alpha();
export annotation sampler_masks();
export annotation sampler_distancefield();
export annotation dither_masked_off();
export annotation world_space_normal();

export material M_Checkered(
float HueShiftPercentage_S_ = 1.0,
float B = 0.5,
float Fraction = 2.0,
float B_1 = 0.8)
=
let {
float3 WorldPositionOffset_mdl = float3(0.0,0.0,0.0);
float2 CustomizedUV0_mdl = float2(state::texture_coordinate(0).x,1.0-state::texture_coordinate(0).y);

float2 Local0 = (CustomizedUV0_mdl * 4.0);
float4 Local1 = ::unpack_normal_map(tex::lookup_float4(texture_2d("./Textures/Tex_Checkered_normal.png",::tex::gamma_linear),float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat));

float3 Normal_mdl = float3(Local1.x,Local1.y,Local1.z);

float Local2 = (HueShiftPercentage_S_ * 6.283185);
float Local3 = math::dot(float3(1.0,1.0,1.0), float3(1.0,1.0,1.0));
float Local4 = math::sqrt(Local3);
float3 Local5 = (float3(1.0,1.0,1.0) / Local4);
float4 Local6 = tex::lookup_float4(texture_2d("./Textures/Tex_Checkered_basecolor.png",::tex::gamma_linear),float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat);
float3 Local7 = (float3(Local6.x,Local6.y,Local6.z) * B);
float Local8 = math::dot(Local7, float3(0.3,0.59,0.11));
float3 Local9 = math::lerp(Local7,float3(Local8,Local8,Local8),Fraction);
float3 Local10 = ::rotate_about_axis(float4(Local5.x,Local5.y,Local5.z,Local2),float3(0.0,0.0,0.0),Local9);
float3 Local11 = (Local10 + Local9);
float4 Local12 = tex::lookup_float4(texture_2d("./Textures/Tex_Checkered_RAM.png",::tex::gamma_linear),float2(Local0.x,1.0-Local0.y),tex::wrap_repeat,tex::wrap_repeat);
float Local13 = (Local12.x * B_1);

float3 EmissiveColor_mdl = float3(0.0,0.0,0.0);
float OpacityMask_mdl = 1.0;
float3 BaseColor_mdl = Local11;
float Metallic_mdl = Local12.z;
float Specular_mdl = 0.1;
float Roughness_mdl = Local13;

} in
::OmniUe4Base(
base_color: BaseColor_mdl,
metallic: Metallic_mdl,
roughness: Roughness_mdl,
specular: Specular_mdl,
normal: Normal_mdl,
opacity: OpacityMask_mdl,
emissive_color: EmissiveColor_mdl,
displacement: WorldPositionOffset_mdl,
two_sided: false);
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
/***************************************************************************************************
* Copyright 2020 NVIDIA Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of NVIDIA CORPORATION nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**************************************************************************************************/

//* 1.0.0 - first version
//* 1.0.1 - merge unlit template
//* 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
//* 1.0.3 - UE4 normal mapping: Geometry normal shouldn't be changed
//* 1.0.4 - using absolute import paths when importing standard modules

mdl 1.3;

import ::df::*;
import ::state::*;
import ::math::*;
import ::tex::*;
import ::anno::*;

float emissive_multiplier()
[[
anno::description("the multiplier to convert UE4 emissive to raw data"),
anno::noinline()
]]
{
return 20.0f * 128.0f;
}

float3 tangent_space_normal(
float3 normal = float3(0.0,0.0,1.0),
float3 tangent_u = state::texture_tangent_u(0),
float3 tangent_v = state::texture_tangent_v(0)
)
[[
anno::description("Interprets the vector in tangent space"),
anno::noinline()
]]
{
return math::normalize(
tangent_u * normal.x - /* flip_tangent_v */
tangent_v * normal.y +
state::normal() * (normal.z));
}

export material OmniUe4Base(
float3 base_color = float3(0.0, 0.0, 0.0),
float metallic = 0.0,
float roughness = 0.5,
float specular = 0.5,
float3 normal = float3(0.0,0.0,1.0),
float clearcoat_weight = 0.0,
float clearcoat_roughness = 0.0,
float3 clearcoat_normal = float3(0.0,0.0,1.0),
uniform bool enable_opacity = true,
float opacity = 1.0,
float3 emissive_color = float3(0.0, 0.0, 0.0),
float3 displacement = float3(0.0),
uniform bool is_tangent_space_normal = true,
uniform bool two_sided = false,
uniform bool is_unlit = false
)
[[
anno::display_name("Omni UE4 Base"),
anno::description("Omni UE4 Base, supports UE4 default lit and clearcoat shading model"),
anno::version( 1, 0, 0),
anno::author("NVIDIA CORPORATION"),
anno::key_words(string[]("omni", "UE4", "omniverse", "lit", "clearcoat", "generic"))
]]
= let {
color final_base_color = math::saturate(base_color);
float final_metallic = math::saturate(metallic);
float final_roughness = math::saturate(roughness);
float final_specular = math::saturate(specular);
color final_emissive_color = math::max(emissive_color, 0.0f) * emissive_multiplier(); /*factor for converting ue4 emissive to raw value*/
float final_clearcoat_weight = math::saturate(clearcoat_weight);
float final_clearcoat_roughness = math::saturate(clearcoat_roughness);
float3 final_normal = math::normalize(normal);
float3 final_clearcoat_normal = math::normalize(clearcoat_normal);

// - compute final roughness by squaring the "roughness" parameter
float alpha = final_roughness * final_roughness;
// reduce the reflectivity at grazing angles to avoid "dark edges" for high roughness due to the layering
float grazing_refl = math::max((1.0 - final_roughness), 0.0);

float3 the_normal = is_unlit ? state::normal() :
(is_tangent_space_normal ? tangent_space_normal(
normal: final_normal,
tangent_u: state::texture_tangent_u(0),
tangent_v: state::texture_tangent_v(0)
) : final_normal);

// for the dielectric component we layer the glossy component on top of the diffuse one,
// the glossy layer has no color tint

bsdf dielectric_component = df::custom_curve_layer(
weight: final_specular,
normal_reflectivity: 0.08,
grazing_reflectivity: grazing_refl,
layer: df::microfacet_ggx_smith_bsdf(roughness_u: alpha),
base: df::diffuse_reflection_bsdf(tint: final_base_color),
normal: the_normal);

// the metallic component doesn't have a diffuse component, it's only glossy
// base_color is applied to tint it
bsdf metallic_component = df::microfacet_ggx_smith_bsdf(tint: final_base_color, roughness_u: alpha);

// final BSDF is a linear blend between dielectric and metallic component
bsdf dielectric_metal_mix =
df::normalized_mix(
components:
df::bsdf_component[](
df::bsdf_component(
component: metallic_component,
weight: final_metallic),
df::bsdf_component(
component: dielectric_component,
weight: 1.0-final_metallic)
)
);

// clearcoat layer
float clearcoat_grazing_refl = math::max((1.0 - final_clearcoat_roughness), 0.0);
float clearcoat_alpha = final_clearcoat_roughness * final_clearcoat_roughness;

float3 the_clearcoat_normal = is_tangent_space_normal ? tangent_space_normal(
normal: final_clearcoat_normal,
tangent_u: state::texture_tangent_u(0),
tangent_v: state::texture_tangent_v(0)
) : final_clearcoat_normal;


bsdf clearcoat =
df::custom_curve_layer(
base: df::weighted_layer(
layer: dielectric_metal_mix,
weight: 1.0,
normal: final_clearcoat_weight == 0.0 ? state::normal() : the_normal
),
layer: df::microfacet_ggx_smith_bsdf(
roughness_u: clearcoat_alpha,
tint: color(1.0)
),
normal_reflectivity: 0.04,
grazing_reflectivity: clearcoat_grazing_refl,
normal: the_clearcoat_normal,
weight: final_clearcoat_weight
);
bsdf surface = is_unlit ? bsdf() : clearcoat;
}
in material(
thin_walled: two_sided, // Graphene?
surface: material_surface(
scattering: surface,
emission:
material_emission (
emission: df::diffuse_edf (),
intensity: final_emissive_color
)
),
backface: material_surface(
emission:
material_emission (
emission: df::diffuse_edf (),
intensity: final_emissive_color
)
),
geometry: material_geometry(
displacement: displacement,
normal: final_clearcoat_weight == 0.0 ? the_normal : state::normal(),
cutout_opacity: enable_opacity ? opacity : 1.0
)
);
Loading