When using a custom block which outputs a value to both the fragment and vertex outputs, any UV node connected to the flow returns the Mesh’s UV, instead of the fragment UV. This results in any textures getting sampled at a lower resolution (depending on the mesh density).
Also, when a node material includes a custom block and you do any change, you need to toggle Force alpha blending, to force update the material. Otherwise, it’s stuck showing the material as if nothing changed.
The custom node simply returns the same value as its input. I also have this issue with a more complex custom block. This indicates that it doesn’t matter what the custom node does, the UV gets altered regardless.
My bad, I should have used a better mesh to display the issue. I used the default plane, which if I had to guess, is 100x100 quads. So, it made it look like the image was 100x100 pixels.
If you switch to a different mesh, you can see how the pixels get smeared across the triangles:
Your DebugCustomCode is emitted in the vertexShader as its output is then used to get the vertex data.
By doing so, NME has to export a varying of its value and send it to the fragment shader but in this case it is a pure linear interpolation of its value.
So the texture color is read only per vertex and then interpolated instead of being read per pixel
If it is possible, and I have no idea how difficult this would be, but I think it would be fantastic if there was some sort of indicator, such as an icon on the block, showing that the block is processed by the vertex shader.
The example that I used was of course very simple, for the purpose of reproducing this behavior with a minimal example. However, I have encountered this behavior a handful of times with quite complex graphs.
Oh, I didn’t know that the triangle and square icons was used to indicate this. I thought it just meant that it was an input, but I can see it now on a few other blocks.
Though I’m still a bit confused due to this:
How come the color block has a triangle, and the fragment output has a square?