Problems with inverse transform and transformations with big values

hello i noticed a strange behaviour in conjunction with inverse (transform) and bigger scene sizes. im not sure if this is a bug (looks like a problem with value resolution/rounding problem). maybe there also better ways to achieve that, therefore i post that under patching questions.

i like to mount a quad in front of a cam in a fixed position. i do that by applying the inversed cameratransformation to that quad, like described elsewhere on this wiki. the problem is now that the quad begins to tremble more and more the greater the cameraposition is away from its origin. it looks like a “rundungsfehler” . Is there a way to prevent this? Are there other methods to fix objects in front of the cam?

i discovered a hidden inlet in the dx9 objects in beta 10 labeled with space. when setting it to projection it mounts also in front of the cam. unfortunately that doesnt work with the multiscreen modules because each screen seems to have its own cordinatesystem and the quad shows up on ech screen this way. can anyone explain what that inlet does?

i attached a little patch to demonstrate that trembling quad effect…

inverseproblem.v4p (5.2 kB)

Ahh I came across the tremble too yesterday! I havent notice the extra pin yet though!

to do that with inverse node is oldschool. since some versions there is a hidden pin in every layer which gives you the possibility to say in which space to draw the layer.

that means if you draw it in the world space then all camera movement and lens/projection properties will influence what you see on the camera.
(internal the view and projection matrices of the renderer are set while drawing.)

if you draw it in view space then camera movement won’t have any influence on the rendering of that layer, because the layer will always draw relative to the camera/view space. however projection properties still have an influence on the drawing.
(internal only the projection matrix of the renderer are set while drawing.)

if you draw it in projection space view and projection transforms of the renderer are totally ignored while rendering.

inverseproblem2.v4p (6.5 kB)

by the way: always use view AND projection pins on the renderer.
if you don’t, then shaders won’t work as expected and the space feature described above also won’t work.

now i show you how tho deal with the near plane pin of the perspective nodes. it is an interesting one…

if you have a big scene and want to render 500 units or more then you should turn of the near distance / makro feature~
what i mean is you should concentrate on landscape shots or portraits. you don’t need to see objects 5 centimeters in front of the lens when renderering “landscapes”.

you profit from that in a way that

  • Depthbuffer will work more precisely on intersections of objects
  • inverse will be more stable

inverseproblem.v4p (6.3 kB)

thanks for your quick and detailed explanation!
as you say every layer fot that space pin. ive found it in all dx9 objects. but how can i do it with ex9 shaders? theres no space inlet in .fx nodes…

somehow we forgot them. sorry. next version

on the other side it should be quite easy in the shader code to remove the multiplication with the view matrix