Isotropix Forums

Displacement driven by shading variables or switch node

General Discussion about Isotropix and CG related topics

Displacement driven by shading variables or switch node

Unread postby pizzaia » Fri Oct 16, 2020 8:16 pm

Hi,

I'm trying to get a 1 shader setup with multiple (unique) objects.
The idea is you have for example 3 maps, 3 objects, 1 shader, and the switch of the maps is either driven by a shading variable on the mapfile or by a switch node that uses a float attribute to drive which texture to pickup.
One the texture side everything works, the switch or shading variable works as expected.
The issue is with the displacement, only 1 texture is used on all object for displacement. I imagine this is due to when the displacement is computed, against when the switch or shading variable on the mapfile is computed.

Is there any way to make this work? Or to compute the displacement at render or shading time?

cheers,

Gianluca
pizzaia
 
Posts: 5
Joined: Thu Sep 29, 2016 11:50 am
Location: Vancouver

Re: Displacement driven by shading variables or switch node

Unread postby nickmarshallvfx » Fri Oct 16, 2020 8:59 pm

Would be very interested in a solution to this one, it's caused me issues on quite a few occasions and I've never come up with a satisfactory workaround.
nickmarshallvfx
 
Posts: 4
Joined: Mon Dec 23, 2013 10:34 pm

Re: Displacement driven by shading variables or switch node

Unread postby sam » Sat Oct 17, 2020 8:26 am

Hi guys,

Could you provide a simple example project so we can have a look at the setup?
Thanks!
Sam Assadian
Isotropix
CEO/Founder
User avatar
sam
 
Posts: 1554
Joined: Fri Jan 25, 2013 11:33 pm

Re: Displacement driven by shading variables or switch node

Unread postby nickmarshallvfx » Sun Oct 18, 2020 6:24 am

Hi Sam,

I'll see if I can throw a scene together if Gianluca doesn't beat me to it. In the meantime I'll describe a recent scenario where this caused an issue:

- We have 5000 objects in a scene. Each one has an attribute on it that is a simple integer (between 1 and 10).

- An Extract Property node is used as the input in a texture Switch node (set to Luminance) and the 10 textures are added into the Switch.

At this point each object picks up the correct textures, working fine so far! The problem comes when you now decide to drive Displacement based on this setup.

- Plug the same Switch node into the input of your Displacement, and you'll notice it doesn't work. It will still apply a displacement, but it's like the Extract Property is being completely ignored now. The Displacement only picks up the first map in the Switch and ignores the rest. This means that the exact same output of the Switch used as both the input to a Displacement and a Diffuse albedo of a shader, gives different results on the object.

Let me know if that makes sense. I'll still try to throw a scene together to show this, but hopefully the above description makes that very easy to replicate.
nickmarshallvfx
 
Posts: 4
Joined: Mon Dec 23, 2013 10:34 pm

Re: Displacement driven by shading variables or switch node

Unread postby nguiard » Tue Oct 20, 2020 9:13 am

Hi Gianluca,

pizzaia wrote:The issue is with the displacement, only 1 texture is used on all object for displacement. I imagine this is due to when the displacement is computed, against when the switch or shading variable on the mapfile is computed.

If the shading variable is set on the object, it should be taken into account by the displacement. We have a limitation though when the shading variable is assigned through a shading layer, it doesn't work.
About the custom attribute, this is a case that is currently not handled because the displacement has no idea it depends on the value of this attribute.

To answer to Nick as well, the extract property is also a case that is not handled at the moment.

So to sum it up, the only case that works currently is to use shading variables but only when they are set directly on the object.

Hope it helps!

Cheers
Nicolas Guiard
Isotropix
Head of R&D
User avatar
nguiard
 
Posts: 399
Joined: Fri Jan 25, 2013 11:33 pm


Return to General Discussion