Node material editor : Trying to replicate a fake interior shader


#1

As a challenge to try and learn how to use the node material editor, I’m trying to replicate a “fake interior” shader that I have in Unity and which looks pretty cool :

Youtube video

With the amplify shader node editor opened in unity , it looks like I can translate most of the flow to C4D, but there’s a “vertex position” node that I don’t know how to deal with.

Anyone has an idea on how you can get the object’s vertex positions inside the C4D node graph ? Through a custom vertex map maybe ?

If anyone’s interested in getting this to work, I’m all ears.

Thanks


#3

Definitly possible. I had a working prototype during R20 beta but never finished it due to time constraints. I remember that one user did it correctly later with R20.


#5

Thanks Srek, at least it’s encouraging.

I was able to translate almost the whole unity node setup in C4D, but sadly it’s not really working as I’m still stuck with this vertex position thing. Maybe I should try another approach…


#6

Vertex Position? I can’t remember that i needed any direct information about the geometry of the object. The windows were defined by the selection the shader is applied to and the interior is completely virtual without any kind of geometry behind it.


#7

Without knowing the exact algorithm I would still think you need some information about where the sample is in relation to the virtual window?! But I guess the uv-coordinate would be a good starting point. And you get that using the GetContext-Node. By the way, this one will also give you the vertices if you really need them.


#8

I just remebered that i created the In Range Asset specifically for this situation so you can easily detect if a ray hits in a certain area.


#9

Oh, that sounds interesting!
Would love to give it a go too!

@Srek Where do i find the In Range asset? It isn’t shipped with R21 is it?


#10

Hello there,

I did this back when R20 was released.
Here you find the scene: https://drive.google.com/open?id=1J6WO4bCpPMA6xJWODPLwTGMl0qm7DXKD
And a video showing the result: https://www.youtube.com/watch?v=mf8x6jfxWQY

But please be aware that the asset has never been finished (due to its proof-of-concept nature) and lacks documentation. :slight_smile:


#11

I’m not doing raycasting, I’m basing myself on the unity shader I have at hand. From what I can tell, it’s using the camera position, the world to object (inverse matrix of object to world) and this vertex position. The switch node is there if you want a “props” layer in the middle of the room.

after that, it’s only combining, splitting, multiplying and adding color and UV vectors.


#12

Thanks a lot, that looks very interesting. I see you even added a randomizing effect too…

Best,
Eric


#13

The In Range asset is part of the utility nodes, just type in range in the node search. For whatever reason it ended up in the Color category.


#14

Ahhh, my bad. I was in ProRender node space and In Range is only availible for Standard/Physical.