cheesetroyer
Nov. 30, 2023 11:05:53
Can someone explain to me how I can create and apply a double-sided material to in Karma?
I found a post on this forum, but it didn't make it understandable for me.
Enivob
Nov. 30, 2023 13:05:55
You'd think the kma_ray_import would offer some type of 0-1 output value you could use to drive the bias on a mtlxMix. Can't figure it out yet. Some way to fetch the sign of the magnitude of ray:direction then remap that into 0-1?
jsmack
Nov. 30, 2023 14:04:54
Enivob
You'd think the kma_ray_import would offer some type of 0-1 output value you could use to drive the bias on a mtlxMix. Can't figure it out yet. Some way to fetch the sign of the magnitude of ray:direction then remap that into 0-1?
N.I plugged into a greaterthan(0) should do it
cheesetroyer
Dec. 1, 2023 03:14:46
Would someone be willing to give a more detailed explanation on how to do this?
Enivob
Dec. 1, 2023 17:12:59
I tried this type of setup, but couldn't get it to work. N.I means reference the ray normal and export it using an integer signature, right?
jsmack
Dec. 1, 2023 22:28:49
Enivob
N.I means reference the ray normal and export it using an integer
no, it means N dot I, as in dot product of the ray direction and the surface normal
Enivob
Dec. 4, 2023 12:32:17
Getting close with your suggestion. I see some purple, but I need red on one side and blue on the other.
jsmack
Dec. 4, 2023 13:34:07
Enivob
Getting close with your suggestion. I see some purple, but I need red on one side and blue on the other.
What is the input range of the remap set to? it should be something like -0.000001, 0.000001 to 0, 1 and clamped to simulate a switch. The ifgreater would be a better choice.
jomaro
Dec. 4, 2023 15:55:26
I don't know maybe this is the setup you are after?
I think this is not yet supported by XPU
jsmack
Dec. 4, 2023 16:27:42
jomaro
I don't know maybe this is the setup you are after?
I think this is not yet supported by XPU
That node isn't supported in XPU, but it's trivial to emulate it using switches going into a standard material.
Enivob
Dec. 4, 2023 17:13:30
@jsmack I tried the very small range numbers and very large. The greaterif didn't seem to help either.
I just wonder if the ray_import is actually working?
@jamaro Your method certainly works for CPU only render.
jsmack
Dec. 4, 2023 19:15:28
Enivob
I just wonder if the ray_import is actually working?
hmm, it's possible that's the issue. There are presets in the menu that should work for getting the ray direction though. I recently used it for making a fresnel blend, since one is missing in the factory node set.
antc
Dec. 4, 2023 19:31:39
rayimport seems to be working for me with xpu (on Mac OS tho)
jsmack
Dec. 4, 2023 19:43:48
Working fine here as well.
Enivob
Dec. 5, 2023 08:37:56
That was it. Thanks, everyone!
I was using ray:hitN instead of mtlxNormal node. I guess hitN is not the same as the geometry normal.
cheesetroyer
Dec. 6, 2023 12:24:48
Thank you guys very much!
boning
Dec. 26, 2023 10:37:10
There's a simpler way other then using 2 rayimport and dot product. You can directly using ray:backface to get a bool. This is listed in the documentation of the rayimport node, but don't know why it's not listed in the drop down menu probably is a bug.
CalvinJor
Nov. 4, 2024 23:54:59
What should I do if I wanna put a roughness or normal texture on it??
alli13
Nov. 12, 2024 16:48:10
CalvinJor
What should I do if I wanna put a roughness or normal texture on it??
Just use it as a switch input instead of plugging it directly.
YuRock
Nov. 17, 2024 08:16:31
Thanks for the advice, but what if I need 2 different shaders (materials) on different sides, and not just 2 different pictures, colors?