matrix light

Post requests for new features to this forum group. Any suggestion to expand the possibilities of Ventuz are welcome.

matrix light

Postby mofo7777 » 01 Feb 2013, 13:56

Hello.

Would be great to get matrix light (view and projection) directly inside the shader, not only the default data of the light. it saves us time not to make a script and connect the light data.
mofo7777
 
Posts: 53
Joined: 24 Oct 2012, 15:03

Re: matrix light

Postby Alex Klein » 01 Feb 2013, 15:15

What do you mean with "matrix light"? Like the direction of a spot light transformed to screen space (instead of in object-space and you have to multiply it with world*view*projection)? If so, just do it inside the shader. I was worried about the performance of doing such a computation for every vertex/pixel but looking at the disassembly, the compiler optimizes this into a "pre shader" that is only executed once per draw call. So it's just as good as when we would do it on CPU inside Ventuz...

If I misunderstood you, please post a demo scene of what you try to achieve...

Alex
Alex Klein
 

Re: matrix light

Postby mofo7777 » 01 Feb 2013, 16:04

Thank you.

I didn't know that such optimization exists with the shader 3.0. I will make some tests to ensure that optimization is done.

I construct just the matrix light view and the matrix light projection from the position/aim/fov/etc... of the light.
mofo7777
 
Posts: 53
Joined: 24 Oct 2012, 15:03

Re: matrix light

Postby Alex Klein » 01 Feb 2013, 16:37

Yeah, I was surprised too... only found this out after I integrated the "disassembly" window into the shader editor and wondered what that "preshader" part was :)
Alex Klein
 


Return to Feature Requests

cron