M1ke
M1ke

Reputation: 259

Reversing Vertex Order in Shader

I want to reverse the order that vertices are fed to a vertex shader. Any suggestions? I'm using ThreeJS, but the shader is custom.

Some background information: To solve the problem in the past, when I wasn't using a custom shader, I would just create the object geometry like this:

new THREE.CylinderGeometry( 16, 16, -32 )

instead of:

new THREE.CylinderGeometry( 16, 16, 32 )

and it would achieve what I need. The problem is that the geometry I'm using now is created in Blender and imported into the scene.

Upvotes: 0

Views: 161

Answers (1)

manthrax
manthrax

Reputation: 5036

Why do you need to reverse the vertex order?

Perhaps you can just change the sidedness of your material to .side=THREE.BackSide or .side = THREE.DoubleSide if you are trying to solve backface culling problems?

Upvotes: 1

Related Questions