Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | 2plus2makes5 |
This is probably a stupid question but i want to know for sure.
If you use something like this in the spatial fragment shader:
if(FRAGCOORD.x<0.0 || FRAGCOORD.x>VIEWPORT_SIZE.x || FRAGCOORD.y<0.0 || FRAGCOORD.y>VIEWPORT_SIZE.y)
{
discard;
}
you will discard(=avoid the draw) every fragment/pixel that is outside the screen, does godot do this automatically?
If you are in the editor with the camera preview and the view is wider than the camera preview you will see the difference, without this everything is drawn, with this only the content inside the camera preview is drawn.
Obviously showing everything has to be a desired feature in the editor but i wanted to know if it’s the same in game or not.
Just for your info if i add those lines to the spatial fragment shader my game runs slower lol.