Making texture fill faces

glsl
shaders

#1

Hi everyone, I was wondering if you would be so kind as to give me a hand. Ive been trying to get my head around GLSL and I have made a buffergeometry, then written a shader that transforms some verts and is then supposed to apply a texture however it seems like the texture is not being applied.

Im sure this is a simple issue for the experienced and I think it might have to do with vUv but I dont understand well enough to figure it out. If anyone could help me and/or link me too any good resources they have found that would be great.

I have the code wrapped up here in a codepen

GPU flappy codepen

Thanks for any help


#2

Hi!
As an option, you could create a regular buffer geometry (for example. THREE.PlaneBufferGeometry()) and see, how it’s organized, what attributes it has (especially, about uv) and so on.


#3

Hi, thanks for the response. I created it manually as more of a learning experience but its definitely a good idea to go look at the THREE.PlaneBufferGeometry() and see how that generation works under the hood. Thanks for the feedback


#4

For beginners I have made a very simple example. It may be helpful.

http://threejs.hofk.de/shader/01_shader_wuerfel.html

The headline and some comments are in German, but with https://www.deepl.com/translator very easy to translate into English.