question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NodeMaterial custom UV Mapping

See original GitHub issue

Is 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) );

image

Mentioning @sunag

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
joergjaeckelcommented, Dec 5, 2021

@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.

1reaction
sunagcommented, Dec 5, 2021

@mrdoob Yes, but first I need to add support to IBL and serialization in new NodeMaterial system mainly to WebGL version, I noticed in Twitter too devs still use the legacy version. I will focus more in this development in the next week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CustomUV node — Material Maker documentation
The CustomUV node deforms an input image according to a custom UV map given ... green channels are used as U and V...
Read more >
Node Material - Babylon.js Documentation
The Node Material is a simple, highly customizable material that you can build yourself ... color or the color from the texture map...
Read more >
Customized UVs in Unreal Engine Materials
Customized UVs are an Unreal Engine feature that allows running calculations in the vertex shader to increase performance over running them per-pixel.
Read more >
Feature request to use world coordinates of vertex as UV ...
You can accomplish this with custom shaders, or with the node material system in the examples: const material = new THREE.StandardNodeMaterial() ...
Read more >
Calculate UVs for a Custom Mesh | Babylon.js Playground
Example Node Material for Nine Patch Texture Scaling. Documentation. Using Bump Maps. Simple example of applying bump maps. Documentation. Using Bump Maps.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found