jPCT-AE - a 3d engine for Android > Support

modelViewProjectionMatrix

(1/6) > >>

Thomas.:
How can I get modelViewProjectionMatrix in code? Is there some getter for this?

EgonOlsen:
No, it's a combination of model view (i.e. object's transformation and camera matrix) and projection matrix (i.e. frustum matrix). It's computed on the fly and feed into the shader. Why would you want to access it from outside the shader?

Thomas.:
I need previous MVPM for motion blur...

EgonOlsen:
That's a bit difficult...every solution that i can think of so far either feels wrong or will be much too complicated. The best option might be to add a special getter for this to GLSLShader. While this still feels wrong somehow, it's the only place where it actually fits...

Much hassle for a feature that i would turn off in the blink of an eye...

Thomas.:
From my side is every solution very complicated. I have one suggestion. I can not think of any other use of old MVPM, just motion blur. So, what about new boolean attribute in Object3D for send previous MVPM to shader? When matrix is calculated, it can be saved to attribute and send in next render. This is the simplest solution for us, IMHO :)

edit: In theory is motion blur as demanding as depth of field, so should not be any problems with performance.

And some method like renderScene(FrameBuffer, GLSLShader), which will set input shader for all objects while rendering and after return original, would be very useful. It is possible also from my side through IRenderHook, but...

Navigation

[0] Message Index

[#] Next page

Go to full version