Game Development Community

TSE MS4 error: Cannot have an active render target bound to...

by Jack Stone · in Torque Game Engine Advanced · 09/17/2006 (6:14 pm) · 6 replies

Im currently porting my MS3 game to MS4, and am receiving this error. When I load a mission and move my player object (A Vehicle) I get the following error:
"Cannot have an active render target bound to a texture sampler!" from GFXD3DDevice::setActiveRenderSurface, around line 842. (GFX3dDevice.cpp)
I originally believed this was due to th Star Rendering resource I had ported: http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6644 which is compiling, however this error occurs both in mission with no sky or space object at all (Just a player drop point and a mission area) and in missions with the stock skybox.
Interestingly, when I use the stock skybox, I can play normally for a few minutes until the error occurs. When I use a blank mission or the space skybox, the error occurs whenever I move the player object.
The TSE demos work fine.
I include my callstack:

ntdll.dll!7c901230()
> TSE_DEBUG.exe!Platform::debugBreak() Line 15 + 0x8 C++
TSE_DEBUG.exe!PlatformAssert::process(PlatformAssert::Type assertType=Fatal, const char * filename=0x00d29518, unsigned int lineNumber=845, const char * message=0x00d29550) Line 89 C++
TSE_DEBUG.exe!PlatformAssert::processAssert(PlatformAssert::Type assertType=Fatal, const char * filename=0x00d29518, unsigned int lineNumber=845, const char * message=0x00d29550) Line 109 + 0x23 C++
TSE_DEBUG.exe!GFXD3DDevice::setActiveRenderSurface(GFXTextureObject * surface=0x03b802c8, unsigned int renderTargetIndex=0, unsigned int mipLevel=0) Line 845 + 0x34 C++
TSE_DEBUG.exe!sgShadowProjector::sgRenderShadowBuffer() Line 469 + 0x31 C++
TSE_DEBUG.exe!sgShadowProjector::sgRender(float camdist=4.8868117) Line 635 C++
TSE_DEBUG.exe!sgObjectShadows::sgRender(SceneObject * parentobject=0x03b60540, TSShapeInstance * shapeinstance=0x03b629cc, float camdist=4.8868117) Line 328 + 0x11 C++
TSE_DEBUG.exe!ShapeBase::renderShadow(SceneState * state=0x03bdcc7c, RenderInst * ri=0x03b8475c) Line 2472 C++
TSE_DEBUG.exe!RenderObjectMgr::render() Line 17 + 0x23 C++
TSE_DEBUG.exe!RenderInstManager::render() Line 277 + 0x2a C++
TSE_DEBUG.exe!SceneState::renderCurrentImages() Line 144 C++
TSE_DEBUG.exe!SceneGraph::traverseSceneTree(SceneState * pState=0x03bdcc7c) Line 364 C++
TSE_DEBUG.exe!SceneGraph::renderScene(const unsigned int objectMask=4294967295) Line 190 C++
TSE_DEBUG.exe!GameRenderWorld() Line 1029 C++
TSE_DEBUG.exe!GameTSCtrl::renderWorld(const RectI & updateRect={...}) Line 42 C++
TSE_DEBUG.exe!GuiTSCtrl::onRender(Point2I offset={...}, const RectI & updateRect={...}) Line 117 + 0x14 C++
TSE_DEBUG.exe!GameTSCtrl::onRender(Point2I offset={...}, const RectI & updateRect={...}) Line 77 C++
TSE_DEBUG.exe!GuiCanvas::renderFrame(bool preRenderOnly=false) Line 1250 C++
TSE_DEBUG.exe!DemoGame::processTimeEvent(TimeEvent * event=0x0012fca0) Line 756 C++
TSE_DEBUG.exe!GameInterface::processEvent(Event * event=0x0012fca0) Line 72 + 0x11 C++
TSE_DEBUG.exe!GameInterface::postEvent(Event & event={...}) Line 154 + 0x11 C++
TSE_DEBUG.exe!TimeManager::process() Line 1012 + 0x17 C++
TSE_DEBUG.exe!DemoGame::main(int argc=2, const char * * argv=0x016024c8) Line 546 C++
TSE_DEBUG.exe!run(int argc=2, const char * * argv=0x016024c8) Line 885 + 0x1a C++
TSE_DEBUG.exe!main(int argc=2, const char * * argv=0x016024c8) Line 963 + 0xd C++
TSE_DEBUG.exe!mainCRTStartup() Line 398 + 0x11 C
kernel32.dll!7c816fd7()

from my limited understanding, it seems that the shadow rendering code, (new to MS4) is causing, or involved with, the crash.
I understand that this kind of error is a mess to debug, but I wonder if anyone could offer any advice?
If even to tell me how to begin debugging this kind of thing, the engine compiles fine, I dont know where the problem is.
I have only added two modified files, for the skysphere code, and when I start a mission that doesnt use those files, I still get the crash.
Thanks,
JS

Btw, I did find this thread: http://www.garagegames.com/mg/forums/result.thread.php?qt=23322
but it appears to be an unrelated issue.

#1
09/18/2006 (1:17 am)
I believe Mr. Kabus fixed this issue recently in the forums. The next update of TSE will have those fixes in; in the meanwhile, if you can't find the thread, you could try dropping him an e-mail and asking him nicely for a link to the fix.
#2
09/18/2006 (8:13 am)
Here is the fix.

(also added to TSE 1.0)
#3
09/18/2006 (9:40 am)
Thanks guys, that worked great. (I just pulled a new copy of the affected files off the CVS) Thanks for your prompt replies.
JS
#4
09/18/2006 (9:52 am)
I actually got my fix from HEAD, I just updated the relavent files.
JS
#5
09/18/2006 (11:14 am)
Just a note, that star rendering resource can be made a LOT more efficient (and cooler looking) :)
#6
09/18/2006 (6:02 pm)
No offence, but your post isnt all that useful unless you mention how... 'm assuming you mean by using point sprites? Not a priority for me at the moment.
JS