Is this vector displacement shader preset available to C4DtoA?

Is this vector displacement shader preset available to C4DtoA?

lamarKPDHG
Participant Participant
2,141 Views
23 Replies
Message 1 of 24

Is this vector displacement shader preset available to C4DtoA?

lamarKPDHG
Participant
Participant
0 Likes
2,142 Views
23 Replies
Replies (23)
Message 2 of 24

madsd
Advisor
Advisor

I can see it's compiled for Arnold 5 in that thread.
Someone could compile it for Arnold 6 I guess.

Also, we can do this with OSL code, so we can drop the c++ compiler stuff.

0 Likes
Message 3 of 24

diego6S3FN
Advocate
Advocate

Hi, I find this vector displacement shader really interesting, I already tried to bring it to C4D but without success.

If someone knows how to do it it would be great and if it could work with C4D noises it would be really extraordinary to explore the possibilities.

Cheers

Diego

0 Likes
Message 4 of 24

madsd
Advisor
Advisor

OK, let me try come up with a very generic and universal mini kit with an example done via OSL.
No ETA.
But will start to look at it today.

First things first, a refference, I baked out the vector displacement to a polygoon.
Use the Arnold procedural node and load it in.

Next to it, make a sphere.
Add a Displacement tag, or however you define that in C4D to this sphere, and make sure that the mapping comes from the exsisting mapping, which means it pulls the mapping cooridinates from the shader directly, you do not want to add a custom UV space, remove all UV/UVW overulers and let the shader dictate it.
( this part is only thing you need to solve basically to get a situation going )

aaa.png


Notice I disabled "step function" in the noise, this is needed as it destroys the vector displacement if ON.
Then pipe it to the vector displacement node I have here, you can download it.
https://github.com/gkmotu/OSL-Shaders/blob/master/VolumeDisplacement.osl

Also dont forget to get the OSL noise.
https://github.com/ADN-DevTech/3dsMax-OSL-Shaders/blob/master/3ds%20Max%20Shipping%20Shaders/Noise3D...

Attached the .ass file for refference.
You SHOULD, in theory, get a perfect match look with the .ass file and a procedural version you make on your sphere next to it.

http://masd.dk/temp/refference_volume_displacement.ass

Now.
Your goal is to match the .ass file, and we need to sort the space definition on your displacement in C4D. This is a pr. host tweak we just need to set up, I do it with the tick on the displacement modifier in the right side of the image.

Let me know how it goes, we might need to go a bit forth and back to nail it.

Once its working, I can issue more types of procedurals that can be extracted into vector displacements, blobs and what have you.

The VolumeDisplacement node looks like this, and you use the default 86 as your displacement amplifier, do not use the Amplitude at 1.0 in the shader, it should be done in the volume displacement, AFTER the noise has been moved to vector space which is putting it into ->

-1+input*2

sss.png

Naturally, you want to attach the output called "Displacement" to your spheres displacement tag. Or something of that nature.


You can also use this to displace volumes, like clouds and stuff, same texture, just as displacement on the volume material.

2020-11-30-16-20-26.gif


I have a small example of Voronoi vector displacement here, using same nodes.
However, this is using the rendertime Arnold displacement, and here we need to add 1 more node before sending to displacement.

Add an Arnold UV Transform node, in front of the chain you displace, and pipe the Uv Transform into the Arnold displacement, then you have vector displacement.

ddd.png

0 Likes
Message 5 of 24

diego6S3FN
Advocate
Advocate

Hi Mads, thank you very much for the detailed information and the screenshots as well as the links, I was able to reproduce your displaced sphere with the OSL shader.

I got something similar.

1606756744227.png


but in the example of "docs.arnoldrenderer", the displacement is not linear the bubbles at the end are wider than the base, isn't this supposed to be done by the vector displacement?

In your Voronoid example I don't see anything else but a standard displacement either.

how do you get this bubble effect at the end of the extrusion?

In C4d you can get it by applying a displacement repeatedly but this shader is supposed to do it all at once.


1606756704198.png


Thanks again for your help. This is the first time I have managed to bring an OSL to C4DtoA


0 Likes
Message 6 of 24

diego6S3FN
Advocate
Advocate

I have tried to use the shader that comes from the example in docs.arnoldrenderer but it gives me a series of fatal errors. I have looked for it in the C4DtoA page and I have not found that article, it is probable that C4DtoA has not incorporated this shader yet, this is known by Peter Horvath,

Thanks

0 Likes
Message 7 of 24

madsd
Advisor
Advisor

Ok, good.
First things first as I mentioned. Now the connection is done.
Next I can try fabricated double folding geometry.

If you know the Blaschke Product. This might be a next thing to run as debug.

It can take a flat plane and displace it around in cirular tunnels, double folding, which is what vector displacement is.

Let me try and look at next step to give you something like that.
No ETA.

0 Likes
Message 8 of 24

diego6S3FN
Advocate
Advocate

Am I supposed to be able to connect any OSL shader to C4DtoA now by following this procedure?

Do you know of any source for OSL shaders?


Thank you for your help,

I have not found information on how to do this in C4D


0 Likes
Message 9 of 24

madsd
Advisor
Advisor

An example of double folding geometry, overhangs, with the OSL shaders.

First download this curl noise, I just added it to a generic pastiebin, the link should not expire.
https://pastiebin.com/5fc5329c66484

Then download the OSL UV Transform node here.
https://github.com/ADN-DevTech/3dsMax-OSL-Shaders/blob/master/3ds%20Max%20Shipping%20Shaders/UVWTran...

The UI will not look like mine, as the Max implementation has a qt .ui file, you will get the raw auto UI, everything should work, just set a very small scale, default 1.0, try something like 0.07 for starters.

Set the VolumeDisplacement you already got, to something like 2.5?
And you should do like normal with the Arnold render time displacement, this time, we dont need the UV transform node infront, so just pop it in directly.

This should result in a feature set simular to the blob shader on the visualization.


aaa.png



Added another example, this is the Noise3D you got earlier.
It started as a sphere, but as you can see, the whole model is covered with overhanging displacement, things stick out and bend over the local Z axis, which would otherwise be straight edges, like regular displacement.

qwe.jpg

0 Likes
Message 10 of 24

madsd
Advisor
Advisor

Posted example of overhanging geometry via a curl noise in the main thread as a new post, since its relevant and should not be covered in a sub thread easily missed.

Try it out.

You need to make sure that the "noise" or whatever shader you use, sends out data in the correct space.
In theory, you could try your old legacy C4D noise and plug that into the volumedisplacement node, it might work.

Else, we can make OSL versions of the maps. Or at least appoximate them.

0 Likes
Message 11 of 24

diego6S3FN
Advocate
Advocate

wow, this looks really interesting, now I'm out of the studio but tomorrow morning I'll try it out and let you know.

Being able to do this with the c4dtoa noises would be super good

Thank you,

0 Likes
Message 12 of 24

peter.horvath6V6K3
Advisor
Advisor

Recompiled the shader for Arnold 6 and added it to the docs: https://docs.arnoldrenderer.com/display/A5ARP/Vector+Displacement

0 Likes
Message 13 of 24

lamarKPDHG
Participant
Participant

Thanks for the update, Peter. Is this then placed into the C4D2A->Shaders folder? Are we then required to compile the noise shaders and their variants?


Apologies for my lack of coding knowledge.

0 Likes
Message 14 of 24

diego6S3FN
Advocate
Advocate

Hi, I've been able to do the tests you sent and so far it seems to work.


But you will have seen that Peter Horvath has compiled the nonlinear noise displacement for Arnold 6.1.0.0.


But I didn't get that bubble effect that appears in Arnoldrender. I just get a normal displacement

1606814670318.png

1606814204614.png

1606814237498.png

0 Likes
Message 15 of 24

diego6S3FN
Advocate
Advocate

HI, Thank you for compiling the non linear noise for Arnold 6.1.0.0.

It works and can be read inside the shaders in C4DtoA,


I have not yet achieved the vectorial displacement as in docs.arnoldrenderer (see the attached images)


It still behaves as a normal displacement, it does not make that inflation effect that occurs when you repeat a displacement several times.


I am unable to reproduce these instructions:

https://docs.arnoldrenderer.com/display/A5ARP/Vector+Displacement




1606814817144.png


1606814857120.png

0 Likes
Message 16 of 24

peter.horvath6V6K3
Advisor
Advisor

@lamar Yes, you have to copy the shader to the C4DtoA/shaders folder. Note that this shader only uses some builtin noise patterns, it can not be used with the C4D Noises.

@Diego The effect depends on the dimension of the object and scene scale. The docs uses a subdivided Cube of 500 units scaled down by 0.01. Here's a Cinema 4D scene with the same geo and settings: nonlinear_noise_test.zip

0 Likes
Message 17 of 24

madsd
Advisor
Advisor

Your last 2 images shows it's vector displacement.
The overhanging geometry, double folding faces, the bottom one looks like the curl noise.

So, this is all technic, it's not a replication of the blob shader, it is using the technic to do all kinds of blobs and things, so I show you how to do it in a generic way, where the Arnold shader with blob returns 1 specific look, but they all rely on the same thing, vector displacement.

We can also go far beyond vector displacement and do things with the implicit construct that you cannot do with vector displacement.


0 Likes
Message 18 of 24

madsd
Advisor
Advisor

Fancy shader(tm)
This kind of shader technic goes beyond regular vector displacement.
You can see I got multiple knots in there.

I just show example of what is possible, this is not directly related to the c++ blob shader, other than showing you can get something more complex going if you wanted to.

It's done in a single pass, so no reprojecting multiple displacements.
The OSL shader is just parsed to Arnold and out comes a blob pole.

But it requires some coding, in 2 seperate systems, in order to work, so its not something entry folks just pick up and waltz through with, so it's more a thing, "you can do it" not, a, this is super trivial.

qwe.jpg

0 Likes
Message 19 of 24

diego6S3FN
Advocate
Advocate

That's great! Thanks a lot Peter, now I see how the configuration is. I understand that it is not possible to use C4D noises. Although it would be very useful to understand how to drive a Ramp through this non linear noise.

1606826123216.png

0 Likes
Message 20 of 24

diego6S3FN
Advocate
Advocate

Thank you Iamar, I've been wanting to use these vectorial displacements for some time, how nice that you brought it here.

0 Likes