Shader Graph - position node with texture ?
Hello ! I've been trying out the new shader graph, and came to an issue : I want to move the position of each vertex base on a texture, but when a texture is plugged into the formula, I cant link it to the position node, the point next to "position" on Master goes gray.
An I missing something ? Thanks !
Did you end up finding a way to do this? I've tried multiple times and can't seem to figure it out.
I found a solution this morning (I think it's working, didn't test it yet). According to this tweet (https://twitter.com/John_O_Really/status/1026941844444405760), it seems like you need to use the "Sample Texture 2D LOD" node tomake it work with positions !
Thank you! Using the 'Sample Texture 2D LOD' node ins$$anonymous$$d of a simple 'Sample Texture 2D' did the trick for me
Answer by V0odo0 · Dec 13, 2018 at 08:20 AM
Use "Sample Texture 2D LOD" instead of "Sample Texture 2D" node. This is special sampler node for vertex shader.
Thank you! I was starting to think that masking vertex positions in shader graph wasn't possible. Glad that isn't the case!
Answer by Trentity · Aug 05, 2018 at 11:27 PM
@Tsequier I've been trying to do the same thing with similar results.
I'm far from a shader expert, but I'm assuming the issue has something to do with Shader Graph deciding what nodes are part of the vertex shader vs. fragment?? Just spit balling.
What I was trying to do, is plug in a texture into a tri-planar node, and offset the vertex positions accordingly.
Although I can't help with the actual issue, if your use case is similar to mine, I think I've found a decent workaround. It revolves around the Gradient Noise node, and then a bunch of math nodes that handle the triplanar projection without using the actual triplanar node (which only has a texture for input).
Hope it helps...Sorry, it won't let me upload the actual shader file. :(
Your answer
Follow this Question
Related Questions
Shadergraph same texture different result 0 Answers
Auralike effect on full object? 0 Answers
Is it possible to apply a dissolve shader created with shader graph to a UI button? 0 Answers
How to access shader graph property values through C# script? 0 Answers
LWRP - Vertex displacement and intersection shader shows artefacts 1 Answer