How and where can I access to the varying vec3 fPosition inside the shader chunks system?
I have no clue of how to do it?
I can do it in a simple shader, but I want to maintain shadows, …
In a simple shader I did:
attributes: {
aPosition: pc.SEMANTIC_POSITION,
in VShader:
varying vec3 fPosition;
void main(void){
fPosition=aPosition.xyz;
…
}
and in fragmentShader:
varying vec3 fPosition;
void main(void){
if(fPosition.y>(0.5- 1.0*uTime)){
discard;
}
}
Thanks in advance