NodeMaterial custom UV Mapping
See original GitHub issueIs your feature request related to a problem? Please describe.
I want to have create or manipulate a UV map to fit a RingGeometry nicely. The math and GLSL way is clear but it seems to me there is no way to use Nodes input. UVNode takes a UVTransformNode what sounds like the right place to do so. But this Node accepts only numeric input and no Nodes, same with Vector2Node for example? Don’t know if I’m completly right with this and if there are good reasons why its like that.
Describe the solution you’d like
In GLSL we just use any vec2 value with the freedom of putting together two floats if we need so.
Describe alternatives you’ve considered
Stick it together in a FunctionNode. But we want Nodes to avoid GLSL 🙄 And further manipulation of mapping needs to be done in your custom GLSL function too.
Additional context
To give you a clearer idea.
// radians remapped to 1 - 0
// distance from center remapped from inner/outer size of the ring to 0 - 1
return texture2D( uvTexture, vec2(radians, distance) );
Mentioning @sunag
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (1 by maintainers)
Top GitHub Comments
@sunag thank you for everything! Legacy solution works but of course I want to use the new one in the future. I think I tried the JoinNode but didnt worked for some other reason.
@mrdoob Yes, but first I need to add support to IBL and
serialization
in newNodeMaterial
system mainly toWebGL
version, I noticed in Twitter too devs still use the legacy version. I will focus more in this development in the next week.