Problems with XEffects and DirectX 9
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Yeah, I also fell into that trap. Somehow, the RTTs are not stored in the texture cache, and hence my algo didn't work last time (because I only searched the texture cache for RTTs ). So it should be enough to simply drop the RTT, reset should work then. However, I got the whole problem fixed as well - automatically - so with some time tonight I should get a fully working fix into trunk.
Hybrid
The latest patch in the trunk certainly fixed the issue when resetting the DX device - fantastic - thanks very much.
I have been looking at 1.5 in a bit more detail and there does appear to be some problems overall. How do I go about reporting problems (should I even bother) or should I try and fix the problems myself. I found problems with the LWO loader and there has been some regression on the .OBJ loader. Does the 1.5 trunk support arbitrarily large RTT's in DX mode? I am not sure if it should be capable of doing this.
On another issue - mentioned before (sorry to use the same thread). I am still having a problem with casting when using a ISceneNode * iterator to then cast to IBillboardSceneNode * :
The error messages I get are :
1>c:\msdev\onyx\src\commonstuff\Drawing3D.cpp(353) : error C2635: cannot convert a 'irr::scene::ISceneNode*' to a 'irr::scene::IBillboardSceneNode*'; conversion from a virtual base class is implied
1> c:\msdev\onyx\src\trunk\include\ISceneNode.h(35) : see declaration of 'irr::scene::ISceneNode'
1> c:\msdev\onyx\src\trunk\include\IBillboardSceneNode.h(20) : see declaration of 'irr::scene::IBillboardSceneNode'
1>c:\msdev\onyx\src\commonstuff\Drawing3D.cpp(353) : error C2039: 'setSize' : is not a member of 'irr::scene::ISceneNode'
1> c:\msdev\onyx\src\trunk\include\ISceneNode.h(35) : see declaration of 'irr::scene::ISceneNode'
Any ideas?
Thanks
Anton
The latest patch in the trunk certainly fixed the issue when resetting the DX device - fantastic - thanks very much.
I have been looking at 1.5 in a bit more detail and there does appear to be some problems overall. How do I go about reporting problems (should I even bother) or should I try and fix the problems myself. I found problems with the LWO loader and there has been some regression on the .OBJ loader. Does the 1.5 trunk support arbitrarily large RTT's in DX mode? I am not sure if it should be capable of doing this.
On another issue - mentioned before (sorry to use the same thread). I am still having a problem with casting when using a ISceneNode * iterator to then cast to IBillboardSceneNode * :
Code: Select all
core::list<ISceneNode *>::ConstIterator it;
ILightSceneNode *pLight;
IBillboardSceneNode *pNode;
:
:
for (Pos = m_Lights.GetHeadPosition(); Pos;)
{
Light = (LIGHTSOURCEPTR) m_Lights.GetNext(Pos);
pLight = Light->pIRRLight;
it = pLight->getChildren().begin();
if (*it)
((IBillboardSceneNode *) *it)->setSize(Size * pLight->getPosition().getDistanceFrom(pos) * A1_SIZE);
1>c:\msdev\onyx\src\commonstuff\Drawing3D.cpp(353) : error C2635: cannot convert a 'irr::scene::ISceneNode*' to a 'irr::scene::IBillboardSceneNode*'; conversion from a virtual base class is implied
1> c:\msdev\onyx\src\trunk\include\ISceneNode.h(35) : see declaration of 'irr::scene::ISceneNode'
1> c:\msdev\onyx\src\trunk\include\IBillboardSceneNode.h(20) : see declaration of 'irr::scene::IBillboardSceneNode'
1>c:\msdev\onyx\src\commonstuff\Drawing3D.cpp(353) : error C2039: 'setSize' : is not a member of 'irr::scene::ISceneNode'
1> c:\msdev\onyx\src\trunk\include\ISceneNode.h(35) : see declaration of 'irr::scene::ISceneNode'
Any ideas?
Thanks
Anton
Last edited by aheymann on Fri Oct 10, 2008 6:57 am, edited 1 time in total.
Thats great news.
Cheers
Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Hallo
I tried that :
it = pLight->getChildren().begin();
if (*it)
{
(static_cast<IBillboardSceneNode *>(*it))->setSize(Size * pLight->getPosition().getDistanceFrom(pos) * A1_SIZE);
}
and compiler generates :
1>c:\msdev\onyx\src\commonstuff\Drawing3D.cpp(354) : error C2635: cannot convert a 'irr::scene::ISceneNode*' to a 'irr::scene::IBillboardSceneNode*'; conversion from a virtual base class is implied
1> c:\msdev\onyx\src\trunk\include\ISceneNode.h(35) : see declaration of 'irr::scene::ISceneNode'
1> c:\msdev\onyx\src\trunk\include\IBillboardSceneNode.h(20) : see declaration of 'irr::scene::IBillboardSceneNode'
1>c:\msdev\onyx\src\commonstuff\Drawing3D.cpp(354) : error C2039: 'setSize' : is not a member of 'irr::scene::ISceneNode'
1> c:\msdev\onyx\src\trunk\include\ISceneNode.h(35) : see declaration of 'irr::scene::ISceneNode'
I replaced it with a dynamic_cast, which generated no errors, but then it crashed at runtime.
I basically have a lightsource (ILightSceneNode), with billboards attached (IBillboardSceneNode) showing the light position and I want to change the size of the billboard.
Thanks
Anton
I tried that :
it = pLight->getChildren().begin();
if (*it)
{
(static_cast<IBillboardSceneNode *>(*it))->setSize(Size * pLight->getPosition().getDistanceFrom(pos) * A1_SIZE);
}
and compiler generates :
1>c:\msdev\onyx\src\commonstuff\Drawing3D.cpp(354) : error C2635: cannot convert a 'irr::scene::ISceneNode*' to a 'irr::scene::IBillboardSceneNode*'; conversion from a virtual base class is implied
1> c:\msdev\onyx\src\trunk\include\ISceneNode.h(35) : see declaration of 'irr::scene::ISceneNode'
1> c:\msdev\onyx\src\trunk\include\IBillboardSceneNode.h(20) : see declaration of 'irr::scene::IBillboardSceneNode'
1>c:\msdev\onyx\src\commonstuff\Drawing3D.cpp(354) : error C2039: 'setSize' : is not a member of 'irr::scene::ISceneNode'
1> c:\msdev\onyx\src\trunk\include\ISceneNode.h(35) : see declaration of 'irr::scene::ISceneNode'
I replaced it with a dynamic_cast, which generated no errors, but then it crashed at runtime.
I basically have a lightsource (ILightSceneNode), with billboards attached (IBillboardSceneNode) showing the light position and I want to change the size of the billboard.
Thanks
Anton
Well normally to go from base to derived you need a dynamic cast, because it needs to query the vtable for info at runtime, hence dynamic. The next issue is fixing the crash.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
I do not understand this. In 1.4.2 it all worked fine. Why I am having problems casting in 1.5 - surely something basic have changed.
I have tried declaring the iterator as Iterator and not ConstIterator :
core::list<ISceneNode *>::Iterator it;
:
:
it = pLight->getChildren().begin();
but the following error is being generated :
1>c:\msdev\onyx\src\commonstuff\Drawing3D.cpp(351) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'irr::core::list<T>::ConstIterator' (or there is no acceptable conversion)
1> with
1> [
1> T=irr::scene::ISceneNode *
1> ]
1> c:\msdev\onyx\src\trunk\include\irrList.h(81): could be 'irr::core::list<T>::Iterator &irr::core::list<T>::Iterator::operator =(const irr::core::list<T>::Iterator &)'
1> with
1> [
1> T=irr::scene::ISceneNode *
1> ]
1> while trying to match the argument list '(irr::core::list<T>::Iterator, irr::core::list<T>::ConstIterator)'
1> with
1> [
1> T=irr::scene::ISceneNode *
1> ]
What am I doing wrong!!!
In 1.4.2 the declaration for ISceneNode is
class ISceneNode : public io::IAttributeExchangingObject
and in 1.5 it is
class ISceneNode : virtual public io::IAttributeExchangingObject
I am no c++ language design expert - but is this not where the problem is - it is a major change from 1.4.
Please this is driving me nuts!!!!!!
Anton
I have tried declaring the iterator as Iterator and not ConstIterator :
core::list<ISceneNode *>::Iterator it;
:
:
it = pLight->getChildren().begin();
but the following error is being generated :
1>c:\msdev\onyx\src\commonstuff\Drawing3D.cpp(351) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'irr::core::list<T>::ConstIterator' (or there is no acceptable conversion)
1> with
1> [
1> T=irr::scene::ISceneNode *
1> ]
1> c:\msdev\onyx\src\trunk\include\irrList.h(81): could be 'irr::core::list<T>::Iterator &irr::core::list<T>::Iterator::operator =(const irr::core::list<T>::Iterator &)'
1> with
1> [
1> T=irr::scene::ISceneNode *
1> ]
1> while trying to match the argument list '(irr::core::list<T>::Iterator, irr::core::list<T>::ConstIterator)'
1> with
1> [
1> T=irr::scene::ISceneNode *
1> ]
What am I doing wrong!!!
In 1.4.2 the declaration for ISceneNode is
class ISceneNode : public io::IAttributeExchangingObject
and in 1.5 it is
class ISceneNode : virtual public io::IAttributeExchangingObject
I am no c++ language design expert - but is this not where the problem is - it is a major change from 1.4.
Please this is driving me nuts!!!!!!
Anton
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
The problem is that we have multiple inheritance of ISceneNode in IBillboardTextSceneNode (as you can see from its name ) And virtual base classes (in this case ISceneNode) cannot be casted to derived ones without dynamic_cast (or major errors with other casts). So I'll simply remove the virtual inheritance of ISceneNode and duplicate the interface into an IBillboardTextSceneNode. Not a clean solution, but the only one which avoids dynamic_cast and RTTI, at least AFAIK.