RSL to VEX questions

   2725   2   2
User Avatar
Member
86 posts
Joined: Sept. 2008
Offline
hi all..

I've got some RSL that computes the aspect ratio, but i'm not sure how to port it to VEX:

uniform point Pcorner0 = transform (“NDC”, “screen”, point(0,0,0));
uniform point Pcorner1 = transform (“NDC”, “screen”, point(1,1,0));
float aratio = (xcomp(Pcorner1)-xcomp(Pcorner0)) /
(ycomp(Pcorner1)-ycomp(Pcorner0));

The docs at http://www.sidefx.com/docs/houdini9.5/news/9/vex [sidefx.com] don't mention space:screen yet, strangely enough, when ported to VEX the shader compiles cleanly and generates the following at runtime:

Warning: can't find object, light or fog named ‘space:screen’ to compute transform

and produces a result of 1.33 for 640x480 resolution. The 3delight renderer produces -1.33. Can i simply ignore the warning or perhaps do this cleanly? I notice there is an iaspect(), but it's for the COPs context.

thanks!
I installed a skylight in my apartment… the people who live above me are furious!
- Steven Wright
User Avatar
Member
37 posts
Joined: June 2008
Offline
Hi David,

You should be able query the the “image:resolution” property http://www.sidefx.com/docs/houdini10.0/props/mantra10_0 [sidefx.com] and derive the aspect ratio from that result. The VEX renderstate function should do this http://www.sidefx.com/docs/houdini10.0/vex/functions/renderstate [sidefx.com]

I don't have time to try this right now but hopefully this helps

Good luck
User Avatar
Member
86 posts
Joined: Sept. 2008
Offline
Thanks - that works.
I installed a skylight in my apartment… the people who live above me are furious!
- Steven Wright
  • Quick Links