Search - User list
Full Version: PDG color wedge to GLTF
Root » PDG/TOPs » PDG color wedge to GLTF
doodlemaker
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!
tpetrick
Can you attach the .hip file with your TOPs and GLTF setup -- or one that reproduces the issue you're running into?
doodlemaker
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
doodlemaker
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?
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:



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]
doodlemaker
Oh that’s great to hear! I was sure I was doing something wrong

Thanks for helping out!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB