splatapult icon indicating copy to clipboard operation
splatapult copied to clipboard

Question for jacobian matrix

Open yuyaolong opened this issue 1 year ago • 4 comments

Hi Anthony, Do you have the derivation steps of this jacobian matrix or any material/links for better understanding? Thanks a lot ! https://github.com/hyperlogic/splatapult/blob/d05e3699384f82c7f12a8dfaadae244658aababe/shader/splat_vert.glsl#L167

yuyaolong avatar Aug 25 '24 06:08 yuyaolong

I thought the 3DGS still using ray space like in EWA volume paper. Looks I am wrong, it's using Projection matrix here

One more question: jsx should be -SX / t.z according to projection from eye coordinate to NDC here. what the * WIDTH / 2 here is for?

yuyaolong avatar Aug 25 '24 10:08 yuyaolong

If I remember correctly, the matrix in the paper wasn't quite the same projection transform used by OpenGL, also it did not include the viewport transformation. For the shader I needed something to go directly from view to viewport coords. In Mathematica I took the gradient of functions for each dimension (x, y, z) of the combined proj*viewport transform, including the homogeneous divide by z. And used this to end up with the Jacobian. image Which is what you see in the shader.

hyperlogic avatar Aug 26 '24 16:08 hyperlogic

About your second question, the (WIDTH / 2) term is from the "window to viewport" transform. My Jacobian includes both the projeciton matrix and the viewport transform.

hyperlogic avatar Aug 26 '24 16:08 hyperlogic

"window to viewport" transform means NDC [-1~1] -> window coordinates [0 ~ WinWidth]? If so, that makes sense to me since the direction vector(vec2 d = gl_FragCoord.xy - frag_p;) is in window coordinates too.

yuyaolong avatar Aug 27 '24 02:08 yuyaolong