www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: MichaelJPCT on September 06, 2020, 10:10:58 am

Title: accessing sampler2D in vertex shader
Post by: MichaelJPCT on September 06, 2020, 10:10:58 am
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.
Title: Re: accessing sampler2D in vertex shader
Post by: EgonOlsen on September 07, 2020, 02:42:03 pm
It should.
Title: Re: accessing sampler2D in vertex shader
Post by: AeroShark333 on September 09, 2020, 04:55:02 pm
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.