Exclude sprite from viewport pixel effect

Godot Version

v4.2.2

Question

My game is using a pixel effect for all objects in the game, which is working well. To accomplish this, I’m using a SubViewportContainer with the Stretch Shrink set to 3. I have an AnimatedSprite3D which is already pixelated however, and thus shouldn’t be included in the effect. How would I go about this? I’ve tried using a separate viewport container to no avail.

image

You are on the right track, I think, with utilizing 2 viewports. You will also want to use the CanvasLayer node to help you draw them in the correct order. This is what the hierarchy would look like:

Root
├── CanvasLayer (Layer 0)
│   └── SubViewportContainer (Pixelated)  # Pixelated objects
│       └── Viewport
│           └── PixelatedObjects (all objects that need pixelation)
└── CanvasLayer (Layer 1)
    └── SubViewportContainer (Non-Pixelated)  # Non-pixelated objects
        └── Viewport
            └── AnimatedSprite3D (and other non-pixelated objects)

Hope this helps.

1 Like

Hey, thanks for your help! You’re right about the canvas layers, I modified my scene to fit the hierarchy you presented. Still, for some reason the layers don’t seem to blend, even though I set BG transparency to true.

I think there is a

Clear Mode

in the Viewports and I THINK that setting it to ONLY_NEXT_FRAME or NEVER instead of the default ALWAYS would maybe solve the problem if Transparency doesn’t seem to be working

1 Like

The issue ended up being a obsolete post processing shader I had forgotten to remove. Thanks for your help!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.