antimatter15 / splat

WebGL 3D Gaussian Splat Viewer
https://antimatter15.com/splat/
MIT License
1.7k stars 169 forks source link

Question: I dont understand the position variable in shader? #48

Open zhanglq2024 opened 3 months ago

zhanglq2024 commented 3 months ago
const triangleVertices = new Float32Array([-2, -2, 2, -2, 2, 2, -2, 2]);

Why they are +-2?

position -> vPosition value never changed?

and what is meaning of the fragment shader

    float A = -dot(vPosition, vPosition);
    if (A < -4.0) discard;

Can some one give a brief explaination, appreciated.