Scaling a quad to fit the window size in code?

Hi,

I am using a quad (Callada model) with a gradient shader but what I would like to do is scale this to the window_width & window_height in code.

Currently I am using large fixed scale values on the game object but I am not sure this is a good solution as I don’t know if the quad will cover all window area on all devices for mobile.

Any help would be appreciated.

I assume you’re using a custom render script and draw the quad in a separate draw call? You should be able to set view and projection to identity before drawing the quad if I’m not mistaken.

2 Likes

Yes setting to stretch projection on that draw call sorted it out. Super cool.

Thanks!

You could also scale the quad to fit the window size. Wait for width/height info from the render script and pass it as a message to the game object to scale the quad accordingly.

1 Like