Shadow bug with ITextScenenodes???

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
sdi2000
Posts: 129
Joined: Thu Aug 25, 2005 12:19 pm
Location: Berlin, DE
Contact:

Shadow bug with ITextScenenodes???

Post by sdi2000 »

Hi there,

i try to use an IAnimatedSceneNode with shadows and a ITextSceneNode at the same time. If the ITextSceneNode is visible the shadow was not drawn. but why?
To replicate this bug add some few code lines to the example project "SpecialFX" like this:

Code: Select all


//at first include the std string for a better string handling =)
#include <string>


//add the following code after room loading routine

node = smgr->addEmptySceneNode();
std::string l_tmp = "hello, this is a test!";
std::wstring l_tmpw;
for(size_t idx = 0; idx < l_tmp.size(); ++idx)
{
	l_tmpw += l_tmp[idx];
}
scene::ITextSceneNode *l_text = smgr->addTextSceneNode(gui->getBuiltInFont(), l_tmpw.c_str(), video::SColor(1,250,250,250), node);

now try it. If the textnode is visible, we could not see any shadows, but if the textnode is outside of the viewport the shadow was draw. ?!
a strange bug =)

has anyone a solution for this problem?? :?:

cya
oli



an addition:

in the function "createShadowVolume" from class "CShadowVolumeSceneNode"
is a small bug. To prevent an access violation switch all "IndexCount *5" to "IndexCount*6" because in the bottom part of this function we fill the arrays "svp->vertices" with 6 elements not with 5 =)

cya...
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Thanks for posing. Looks like some render states get ~destroyed~ when switching to 2d text mode for the text rendering. I'll have a look into it.
Snake
Posts: 9
Joined: Sun Jan 08, 2006 2:15 am

Post by Snake »

I have another problem: when I make a text visibile, the shadowmaps get different!!! I think it's related to the same problem... a fix would be great, cos it's quite irritating!
La vita è una tempesta, prenderlo nel culo è un lampo!
MattyBoy
Posts: 19
Joined: Fri Oct 24, 2003 3:07 pm

Post by MattyBoy »

Does anyone have a fix for the first problem mentioned in this thread?

If I change the PreRendering code in CTextSceneNode from

SceneManager->registerNodeForRendering(this, ESNRP_SHADOW);

TO

SceneManager->registerNodeForRendering(this, ESNRP_TRANSPARENT);

It now doesn't mess with the shadows, but the GUI skin gets messed up. The buttons sometimes loose their gradient coloring.
playerdark
Posts: 64
Joined: Mon Aug 01, 2005 5:06 am

Post by playerdark »

I am having a similar problem. Although my original code worked with shadow and the GUI, I switched to shaders mostly. However I did not manage to get the shadow node to have it's own shader becasue it does not have a material.

Now, the shadow is completely distorted, and the GUI seems to be a childnode of one of my scenenodes. It jsut moves with the scenenode and is influenced by it's object space.

I know that shaders aren't a priority, but there seems to be a general problem with the GUI and the shadow that doesn't quite decouple the GUI from what was done beofre it was rendered. Not shure how I can explain this any better
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

i guess this is something to do with render states being changed to 2d mode to draw the textscenenode. It can't be good to continually change the projection matrix for drawing 2d stuff in the middle of 3d draw calls.
I think I'll remove the old text scene node completely, and update Tom's billboard text node to work with the new fonts.
edit: I ditched this idea, the reason being billboard text nodes can only work with IGUISpriteBitmap fonts, not generic IGUIFont.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply