How many fragments is calclate at once?

sent44sent44 Posts: 39Member
edited July 18 in Shaders

Let's say I have Viewport size of 20x20 and a ColorRect node fill inside it with shader script.
How many fragment is it, is it 400 or more than that? If it more than that, how much more of it?


Tags :

Best Answers

  • TwistedTwiglegTwistedTwigleg Posts: 2,831
    Accepted Answer

    I'm not super well versed in shaders, so please take this with a grain of salt, but I believe fragment is called on each pixel of the screen that the object takes up. So if the size is 20x20 pixels, the entire ColorRect node is visible, and there is no Viewport scaling applied, then it will be 400 fragment calls, one for each pixel. This number can be reduced if the Viewport size is scaled down, and increased if the Viewport is scaled up. I think it really depends on the number of pixels the node occupies within the Viewport.

  • SIsilicon28SIsilicon28 Posts: 746
    Accepted Answer

    To add on to what @TwistedTwigleg said, the number of fragments processed by a shader greatly depends on the dimensions of the viewport. The number is always less than or equal to the width times height of the viewport depending on how much screen space the graphical element covers.

Answers

  • TwistedTwiglegTwistedTwigleg Posts: 2,831Admin
    Accepted Answer

    I'm not super well versed in shaders, so please take this with a grain of salt, but I believe fragment is called on each pixel of the screen that the object takes up. So if the size is 20x20 pixels, the entire ColorRect node is visible, and there is no Viewport scaling applied, then it will be 400 fragment calls, one for each pixel. This number can be reduced if the Viewport size is scaled down, and increased if the Viewport is scaled up. I think it really depends on the number of pixels the node occupies within the Viewport.

  • SIsilicon28SIsilicon28 Posts: 746Moderator
    Accepted Answer

    To add on to what @TwistedTwigleg said, the number of fragments processed by a shader greatly depends on the dimensions of the viewport. The number is always less than or equal to the width times height of the viewport depending on how much screen space the graphical element covers.

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file