Fullscreen Rectangle with Phong Material

Tags: #<Tag:0x00007f70379a2a00> #<Tag:0x00007f70379a2938>

Hey Guys,

I am working on a project where i need to use a phong material for normal map effects. The patch will be used as a background. The problem is, that the phong material does not work with the fullscreen rectangle op. I am ok with using a normal rect, but the problem is now, that it is never really fullscreen, and the background of the patch bleeds through, depending on what height the canvas is, which is really bad in terms of responsive design.

Here is a simplified patch that illustrates the problem: https://cables.gl/ui/#/project/8gy1ky

So i am asking for a workaround, where I can use a phong material on a rect, but still be able to fill the whole canvas with it. Can anybody help me out? Is there a solution, which wont result in some stretching/distortion of the textures? even with stretching, how would i keep the rect always the same height and width as the canvas?

Thanks,
Artur

hi

https://cables.gl/ui/#/project/85bjky

fullscreenrectangle internally works with orthogonal/isometric projection.

you can do this manually using the orthogonal op.
i added an output for width/height in worldspace. so you can use this as width/height for a regular rectangle…

also, the fullscreenrectangle did not have normals/tangents etc, i guess this is what you mean by “not working”. it has that now, but your patch does not work with that, but i guess more because of the way you map the mouse coordinates …

hf

1 Like

Hey Tom,

Thanks for the fast reply and fix! Greatly appreciated :slight_smile: Will try it out in the real project, but it looks like it does what i wanted, thanks!