Page 1 of 1
Fading with an overlay works on one computer but not another
Posted: Sat Apr 19, 2008 8:44 pm
by sjcomp
Hello,
I create a fading effect using an overlay. I'm using approach described in
Problem implementing fade in/out effect using Overlay and
setAlphaOperation and setColourOperationEx d3d vs opengl. It does work on my laptop, but on my desktop computer I get a blank white screen until I hide the overlay. There are no messages in the log that would indicate a problem with the materials. Desktop has this problem in DirectX only (opengl shows proper fading).
And I suppose the related issue (on my desktop with directx rendering only) is that when I show an overlay (that simulates a progress bar [from BSP demo]) which occludes only part of the screen I get white background, even though I set background of the viewport to be black.
Any suggestions?
Thank you.
Posted: Sun Apr 20, 2008 1:03 pm
by sinbad
Are you using manual colour/alpha parameters in more than one texture unit in the same pass? Some cards don't support per-texture unit manual settings in DirectX, you can test RSC_PERSTAGECONSTANT in RenderSystemCapabilities to see.
Posted: Sun Apr 20, 2008 4:12 pm
by sjcomp
sinbad wrote:Are you using manual colour/alpha parameters in more than one texture unit in the same pass? Some cards don't support per-texture unit manual settings in DirectX, you can test RSC_PERSTAGECONSTANT in RenderSystemCapabilities to see.
Thanks Sinbad, but I do not see such a constant in 1.4.7. I'd expect the video card on the desktop to support this operation, and I'm quite sure I'm not using manual alpha parameter in more than one texture unit anyway. Is there anything else I can do to find the root of the problem?
Thanks.
Posted: Mon Apr 21, 2008 11:59 am
by sinbad
Gah, I really have to get v1.6 out soon
Alpha and colour are the same as regards the 'manual' slot. So, are you using manual colours or manual alpha in more than one texture unit?
Posted: Mon Apr 21, 2008 6:44 pm
by sjcomp
sinbad wrote:Gah, I really have to get v1.6 out soon

That will be swell
sinbad wrote:
Alpha and colour are the same as regards the 'manual' slot. So, are you using manual colours or manual alpha in more than one texture unit?
I'm using only manual alpha in only one texture unit. This is the material
Code: Select all
material Fader
{
technique
{
pass
{
scene_blend alpha_blend
lighting off
depth_check off
depth_write off
texture_unit
{
texture Black.png
alpha_op_ex modulate src_manual src_texture 0 0
}
}
}
}
And this is how I change it:
Code: Select all
m_TexUnit->setAlphaOperation(Ogre::LBX_MODULATE, Ogre::LBS_TEXTURE, Ogre::LBS_MANUAL, 1 - Fading, Fading);
Black.png is PF_R8G8B8, 1x1x1. Fading works properly on both computers in OpenGL. My dektop has NVIDIA GeForce 7900 GS and my laptop has GeForce Go 7600
Thank you.
Posted: Mon Apr 21, 2008 8:39 pm
by sjcomp
I changed Black.png to be 2x2 and both progress bar background (which was using black.png and fader) started to work. But there is some white noise at random locations on the screen. Examples follow. There could be runs when everything works and there could be runs when I get white strips.
This is an overlay that is done the same way as LoadingProgressBar in BSP demo. It has nothing to do with CEGUI (other than appearance) It's actually displayed before cegui is even initialized.

An overlay with an image in png format (even if I change it to jpg, I still have noise)

This is an image that is shown with CEGUI as Static Image:

This is a menu that is drawn by cegui

The white lines move around. And sometimes are not present at all (Every third run the overlays look fine, but cegui menus have noise, the rest of the time cegui menus are ok, but overlays have noise) I observe this only on my desktop computer.
Posted: Wed Apr 23, 2008 8:11 pm
by sjcomp
The problems disappeared once I disabled min maps for the png texture (leaving it 1x1 size).
Posted: Wed Apr 23, 2008 11:40 pm
by sinbad
Most odd, but yeah of course you don't need mips. Might be a dodgy card implementation of mipmaps on small textures.