PDG color wedge to GLTF
2996 7 1- doodlemaker
- Member
- 16 posts
- Joined: Feb. 2015
- Offline
Hi everyone,
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!
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!
- tpetrick
- Staff
- 600 posts
- Joined: May 2014
- Offline
- doodlemaker
- Member
- 16 posts
- Joined: Feb. 2015
- Offline
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
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
Edited by doodlemaker - March 8, 2022 10:51:50
- doodlemaker
- Member
- 16 posts
- Joined: Feb. 2015
- Offline
- tpetrick
- Staff
- 600 posts
- Joined: May 2014
- Offline
Your Sphere_02 material isn't working because your color components values are all set to @color. You need to use @color.r, @color.g and @color.b instead to access each of the components of the attribute value. The expression @color is the same as @color.0 or @color.r -- 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.
With that change, the Sphere_02 material exports properly and shows up in the viewport.
- tpetrick
- Staff
- 600 posts
- Joined: May 2014
- Offline
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 [www.sidefx.com]
- doodlemaker
- Member
- 16 posts
- Joined: Feb. 2015
- Offline
- psychoboy852
- Member
- 15 posts
- Joined: March 2022
- Offline
tpetrick
Your Sphere_02 material isn't working because your color components values are all set to @color. You need to use @color.r, @color.g and @color.b instead to access each of the components of the attribute value. The expression @color is the same as @color.0 or @color.r -- it will only accesses the first component of the attribute:Image Not Found
With that change, the Sphere_02 material exports properly and shows up in the viewport.
tpetrick
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 [www.sidefx.com]
Thank you!
-
- Quick Links