fade whole screen from black...

panda3d.org/manual/index.php/C … te_Changes

Like this?:

render.setColorScale(0, 0, 0, 1.0) 

With models with texture stenciling one of the textures doesn’t change at all. Is that a bug?
I suppose I could attach a black quad in front of the camera and fade it to complete transparency (with tasks and setAlphaScale()) but want to be sure…
PS. Also a typo in the text

import direct.directbase.DirectStart
from direct.showbase.Transitions import Transitions

transition = Transitions(loader)
transition.setFadeColor(0, 0, 0)

base.accept("1", transition.fadeOut, [2])
base.accept("2", transition.fadeIn, [2])

run()

should be self-explaining

It is. Thanks.
But I still wonder if this is a bug and should it be reported…
EDIT: Okay some weird stuff i noticed about transitions:

  1. I dont seem to be able to fade in right after the application starts:
import direct.directbase.DirectStart
from direct.showbase.Transitions import Transitions

transition = Transitions(loader)
transition.setFadeColor(0, 0, 0)

transition.fadeIn(5)

run()
  1. In the same case fadeOut flashes in the beginning
  2. And all the keyboard input seems to be disabled when fading in/out
    If these are expected behaviors I rather go back to setAlphaScale() on a black plane

It’s not a bug. If you use custom texture stenciling, or shaders, you have to take care of applying the color scale yourself.

Note that it’s probably cheaper to fade in an on-screen quad, rather than fading out ‘render’. I bet the Transitions class does it like that.

What do you mean by custom?

Well it was suggested in the manual. Not my idea.

Yeah, its a quad/plane attached to render2d(or aspect2d?).
It looks just what I need. Only I mentioned 3 weird behaviours I encountered when using transition. What will you say about those?
And I dont seem to be able to change the fade colour…