osl and matrix

68 views
Skip to first unread message

haggi

unread,
Mar 26, 2016, 8:11:00 AM3/26/16
to appleseed-dev
Hi,

I try to implement projection mapping in the Maya plugin. I place everything into one "world" assembly and transform it to match Appleseed and Maya units.
By default this is a factor of 0.01 for centimeters to meter. This looks like this in pseudocode:

scene
    assembly
"world"
        geometry
        osl shaders
        lights
..
    assembly instance of
"world"
        transform
0.01


I have a placement matrix for a projection node which is located in the osl shaders of the assembly. It seems that the matrices are calculated not relative to the assembly but to the scene element what leads to a matrix scaling which is 100 times to large. Or this is the result of a wrong space I use in the shader. This is the code I use for the placement node: https://github.com/haggi/appleseed-maya/blob/master/module/shaders/src/maya/place3dTexture.osl

Maybe anyone has an idea what's wrong.

Est

unread,
Mar 27, 2016, 6:08:45 AM3/27/16
to appleseed-dev
Hi,

In appleseed the coordinate system for OSL shaders is world space.
All points and vectors in shaders are in world space.

Other coordinate systems you can use include object and camera.
We don't support raster or NDC yet (I think there's a ticket for it in github).

Est.

Reply all
Reply to author
Forward
0 new messages