Dear NVIDIA Community.
Using the Replicator Framework you can easily create the following image
/Assets/Isaac/4.1/Isaac/Environments/Office/Props/SM_Armchair.usd
What is wrong with it is that there should be the only One Single decal - smiley face, closest to the projector cube (gray). Unfortunatelly it is not possible to filter out in a single mesh (with the cutout_opacity or with diffuse_bsdf bounds) the next smiley face on the other side of the chair. And it is even shown and counted in the rest of replicator framework like Annotators.
You can find that in extscache\omni.replicator.core-1.11.14+106.0.1.wx64.r.cp310\mdl\project_pbr_material.mdl
the uv
is calculated from the projector quad by simple transformations and scale shifts, but this produces an uv
which is shown on the next image.
you can see that 0,0 and 1,1 are repeated in 2 places (actually 4 - the opposite sides of chair arms have them too). And if you clip them spatially like in mdl:
float uv_clip = (uv.x >= 0.0 && uv.x <= 1.0 && uv.y >= 0.0 && uv.y <= 1.0) ? 1.0 : 0.0;
You will get this:
By applying something like:
float directional_clip = math::dot(state::normal(), p_right*1.0);
you can get rid of back parts (idea used in project_pbr_material.mdl
):
But I could not find any reasonable way of how to filter the secondary uv 0,0 1,1 range which has same normal vectors using the concepts, modules or tools provided in NVIDIA Omniverse Replicator, MDL or Render Engine.
The only way of dealing with that is to provide a third dimensional depth_clip
clip with something like this:
float depth_clip = math::step(distance, math::dot((state::position() - p_position), p_right));
float projection_clip = uv_clip * directional_clip * depth_clip;
, where distance
is a settable parameter.
The latter approach gets me a correct single decal from single projector on a single mesh!
And if I put some texture instead of (uv.x, uv.y) on the diffuse_reflection_bsdf
tex::lookup_color(texture, float2(uv.x, uv.y)) * projection_clip
I will get what I expect to see:
The problem with depth
is that it is very mesh (like what number to set on curved surface mesh) and projector location specific number and I have no idea how to automatically calculate it for every case.
@pcallender
Could you please show this to developers or MDL specialists because this issue substantially limits the usage of Replicator framework and it produces unexpected results.