accessing sampler2D in vertex shader

Started by MichaelJPCT, September 06, 2020, 10:10:58 AM

Previous topic - Next topic

MichaelJPCT

hi Egon,
if i write a shader with sampler2D only in vertex shader but not in fragment shader, (other thing are similar to default shader) will jpct prepare the texture for the shader?
this is because i use pure color texture on some objects, texture color doesn't vary.

EgonOlsen


AeroShark333

I have tried myself and it should work (usually)...
Though I'd recommend using the 'additional color' variable you can assign to Object3D's, if you only want to use a single color.
Since not all devices allow texture access in the vertex shader stage.
However, these days I believe you can assume most devices do support it.