Home Technical Talk

Odd results when pinching vertices to create a cone-shaped linear gradient

Hi,

So I recently needed to create a cone which fades out to the edges. It seemed very simple to me, but I ran into some issues, which I see as an opportunity to learn something.

So, since the cone doesn't necessarily need to be 3D, my first idea was to create a simple plane with a ramp like this:



And then pinch the vertices on one end. This would, in my theory, lead to something like this (Photoshop example):



The shader (in UE4) for that would obviously be really, really simple, if the mesh would work like that.
However – what actually happens when pinching the verts is this:



This is not related to 3dsMax (we tried it in Maya and Houdini aswell) and it's also not related to not welding the vertices (also tried that).
Importing the plane "anyway" in UE4 and trying to use it on a shader yields the exact same artifact.

Tesselating the plane and doing the same thing with soft-selection works. However, I don't know why the initial technique (four verts) doesn't work. There seems to be some principle of 3D that I'm missing that makes what I'm trying to do impossible. But I don't quite understand why.

Is there any kind soul that is also a 3D mastermind that can explain what I'm missing here?

Cheers,
- Nico

Replies

  • Eric Chadwick
    This is not about writing code, so I'm moving this from the Coding section into Technical Talk.
  • Eric Chadwick
    This is due to the way UV coordinates work. 

    It's a linear interpolation from vertex to vertex, and you're basically trying to smoosh one end.

    All games suffer from this "problem". To avoid this, create a cone texture, and UV it flat.
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    You can see what happens in the gif.  

    An invisible  edge runs from top right to bottom left so the lower/right triangle maintains its shape and thus good UVs.  The upper/left triangle gets crushed to a very narrow shape and the uvs get busted. 

    Adding an edge across the middle means the distortion of triangles is consistent and less dramatic 
Sign In or Register to comment.