March 7, 2022 11:25:18
long time reader, but now seem to be a little stuck. i am trying to wedge the basecolor of the principle shader with a color wedge. the goal is to export quite a lot of variations of an asset to a gltf. the list of colors in the wedge make it very overseeable and nicer to art direct.
i can also do this with a switch and multiple constants plugged in the basecolor, but
these values dont get exported in the gltf file. so i believe they seem to only be read from the promoted parameter properties of the shader.
also, the ramp plugged in to the shader of the background also doesnt export. is this just a limitation of gltf?
thanks in advance!
March 7, 2022 17:25:22
Can you attach the .hip file with your TOPs and GLTF setup -- or one that reproduces the issue you're running into?
March 8, 2022 04:40:16
thanks for your fast response!
i tried to simplify the setup.
all the colors on shader 01 and sphere 01 are not being exported to the gltf, plus its difficult to have a nice overview which colors are wedged.
the values in sphere 02 and shader 02 are being exported, but only the first value of the color, as i cannot assign the wedge color to the color paramater of the shader, only to each individual color channels. maybe i am overlooking something completely when assigning those...
i would prefer the way sphere02 is setup, as the export works, plus it gives me a nice overview of which colors are used in which wedge without making another reference to some other color palette.
or maybe there is an even better way...
edit - i added the ramp too in the exmple file
March 8, 2022 10:26:18
i tried to switch shaders with a string wedge, but houdini doesnt seem to pick this up. not in the shopmaterial path nor in the SOP Render Tab material assignment.
is this expected behaviour?
March 8, 2022 11:02:38
Your Sphere_02 material isn't working because your color components values are all set to @color
. You need to use @color.r
instead to access each of the components of the attribute value. The expression @color
is the same as @color.0
-- it will only accesses the first component of the attribute:
With that change, the Sphere_02 material exports properly and shows up in the viewport.
March 8, 2022 11:05:05
In a string parameter, you need to use backticks so that Houdini can tell you're entering a string expression, not a constant string. -- `@body_shader`
in your case. This is the same for any HScript expression in a string parameter: https://www.sidefx.com/docs/houdini/network/expressions.html#string-parameters
March 8, 2022 15:41:45
Oh that’s great to hear! I was sure I was doing something wrong
Thanks for helping out!