Fading with an overlay works on one computer but not another

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
sjcomp
Gnome
Posts: 315
Joined: Sat Apr 23, 2005 2:35 pm
Location: Dover, NH
Contact:

Fading with an overlay works on one computer but not another

Post 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.
Regards, Alexander. http://sjcomp.com
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post 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.
User avatar
sjcomp
Gnome
Posts: 315
Joined: Sat Apr 23, 2005 2:35 pm
Location: Dover, NH
Contact:

Post 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.
Regards, Alexander. http://sjcomp.com
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post 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?
User avatar
sjcomp
Gnome
Posts: 315
Joined: Sat Apr 23, 2005 2:35 pm
Location: Dover, NH
Contact:

Post 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.
Regards, Alexander. http://sjcomp.com
User avatar
sjcomp
Gnome
Posts: 315
Joined: Sat Apr 23, 2005 2:35 pm
Location: Dover, NH
Contact:

Post 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.
Image
An overlay with an image in png format (even if I change it to jpg, I still have noise)
Image
This is an image that is shown with CEGUI as Static Image:
Image
This is a menu that is drawn by cegui
Image
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.
Regards, Alexander. http://sjcomp.com
User avatar
sjcomp
Gnome
Posts: 315
Joined: Sat Apr 23, 2005 2:35 pm
Location: Dover, NH
Contact:

Post by sjcomp »

The problems disappeared once I disabled min maps for the png texture (leaving it 1x1 size).
Regards, Alexander. http://sjcomp.com
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Most odd, but yeah of course you don't need mips. Might be a dodgy card implementation of mipmaps on small textures.
Post Reply