Page 1 of 1

Backplate issue SOLVED

PostPosted: Tue Jun 18, 2019 6:37 am
by quadcat
octane 2018.1.3.0
houdini 17.5.173
The Backplate checkbox doesn't works as expexted.
When it is ON - input texture is appear but environment geometry represents as sphere, not as flat image.
May be I doing somthig wrong but it is seems as bug.
Also I tryed modify subnet of rendertarget - no success.
Could you check attached scene?

upd. so it seems like everything work correct. But placing flat texture on background reaching by diffirent way. How?

upd.2 SOLVED

1. from here viewtopic.php?f=21&t=65575
2. create *.txt with
Code: Select all
shader CameraMap_env(
    output point uvw = 0)
{
    vector p = transform("camera", I);
    float fov;
    int res[2];
    getattribute("camera:fov", fov);
    getattribute("camera:resolution", res);
    uvw[0] = 0.5 + 0.5 * p[0] / p[2] / tan(fov / 2) ;
    uvw[1] = 0.5 - 0.5 * p[1] / p[2] / tan(fov / 2) * res[0] / res[1];

3. Go to octane render target (right click > allow edit content) and create PROJECTION OSL node
4. Load *.txt
5. Feed all interested Texture Imager nodes trough projection port - in Camera_Environment group for example

Re: Backplate issue SOLVED

PostPosted: Tue Jun 18, 2019 4:05 pm
by juanjgon
Great! Yes, this is a nice example of how a simple OSL projection shader can help with this task. Thanks for sharing your solution.

Thanks,
-Juanjo

Re: Backplate issue SOLVED

PostPosted: Thu Feb 13, 2020 3:37 am
by asamaniego
Hello,

I'm putting in the .txt in the projection OSL and when I go to compile and build GUI I get a syntax error. When I pasted the code in and connect to the projection part of my texture, it's still spherical. Please help, I just need a simple backplate for a scene. Thanks.

Re: Backplate issue SOLVED

PostPosted: Thu Feb 13, 2020 1:23 pm
by juanjgon
I think that the OSL code had a closing brace missing at the end. Try this code:

Code: Select all
shader CameraMap_env(
    output point uvw = 0)
{
    vector p = transform("camera", I);
    float fov;
    int res[2];
    getattribute("camera:fov", fov);
    getattribute("camera:resolution", res);
    uvw[0] = 0.5 + 0.5 * p[0] / p[2] / tan(fov / 2) ;
    uvw[1] = 0.5 - 0.5 * p[1] / p[2] / tan(fov / 2) * res[0] / res[1];
}



Thanks,
-Juanjo

Re: Backplate issue SOLVED

PostPosted: Thu Feb 13, 2020 4:09 pm
by asamaniego
Yes! Works...thank you!!!