Backplate issue SOLVED

Houdini Integrated Plugin

Moderator: juanjgon

Post Reply
quadcat
Licensed Customer
Posts: 3
Joined: Wed Aug 16, 2017 4:14 am

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
Attachments
temp.zip
(1.56 MiB) Downloaded 368 times
User avatar
juanjgon
Octane Plugin Developer
Posts: 8867
Joined: Tue Jan 19, 2010 12:01 pm
Location: Spain

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
asamaniego
Licensed Customer
Posts: 18
Joined: Thu Apr 27, 2017 10:46 pm

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.
User avatar
juanjgon
Octane Plugin Developer
Posts: 8867
Joined: Tue Jan 19, 2010 12:01 pm
Location: Spain

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
asamaniego
Licensed Customer
Posts: 18
Joined: Thu Apr 27, 2017 10:46 pm

Yes! Works...thank you!!!
muchogrande
Licensed Customer
Posts: 61
Joined: Wed Jan 14, 2015 9:19 pm

Could someone explain this a little further? I created the Projection_OSL node in the rendertarget and added the code, but I'm a little lost what I do next to apply an image?
Renbry
Licensed Customer
Posts: 42
Joined: Fri Nov 23, 2018 9:09 am

@muchogrande - here's a snipping showing how the Projection OSL gets plugged into the existing node network. Specifically the PROJECTION plug on the CamEnviroTexture.

Then you'd just need to make sure your Render Target has Cam Environment turned on in the MAIN tab to make visible the file name selector to choose your background image
Capture.PNG
Capture2.PNG
muchogrande
Licensed Customer
Posts: 61
Joined: Wed Jan 14, 2015 9:19 pm

Awesome, thank you!
Post Reply

Return to “Houdini”