plangton
(plangton)
March 4, 2016, 2:00pm
14
yop
I get custom node working with textures but it’s a bit tricky, here is how I proceed :
Look at my nodes build.
Display the HLSL code window (in material editor).
search in this window the code part relative to “CustomExpression” (you will show your code updated eah time you press enter in the code box of the custom node)
If you connect a texturesample node to custom node, you will see in the code the texture2d name declaration and its associated SamplerState.
reuse this in your code, and use Texture2D instead of Sampler2D (so Sample function instead of tex2D)
code example :
float4 color = MaterialTexture2D_0.Sample(MaterialTexture2D_0Sampler, uv0);return color;
nodes :
PS : We really need an update for the custom node and at least a real code window to edit code.
in this method the sampled texture cannot be used for vertex shader. it will throw error.
do you have any solution for the vertex shader case as well ?