Game Development Community

[Bug 1.0] Can't Enable Basic Lighting

by Gary Hoffmann · in Torque 3D Professional · 09/29/2009 (5:51 pm) · 8 replies

If I attempt to enable basic lighting (either through the editor or by switching the light manager in the startup scripts), I get "GFXD3D9Device::_updateRenderTargets() - Error setting viewport!"

Below is the stack trace and it you look at the viewport at the time of the error...

viewport {X=0 Y=726 Width=512 ...} _D3DVIEWPORT9
X 0 unsigned long
Y 726 unsigned long
Width 512 unsigned long
Height 4294966944 unsigned long
MinZ 0.00000000 float
MaxZ 1.0000000 float

The height is obviously not being set correctly.


Stack Trace:

Test Project_DEBUG.dll!D3D9Assert(HRESULT hr=-2005530516, const char * info=0x110dd598) Line 47 C++
> Test Project_DEBUG.dll!GFXD3D9Device::_updateRenderTargets() Line 269 + 0x2c bytes C++
Test Project_DEBUG.dll!GFXDevice::updateStates(bool forceSetAll=false) Line 515 C++
Test Project_DEBUG.dll!GFXD3D9Device::drawPrimitive(GFXPrimitiveType primType=GFXTriangleStrip, unsigned int vertexStart=0, unsigned int primitiveCount=2) Line 573 C++
Test Project_DEBUG.dll!GFXDrawUtil::drawBitmapStretchSR(GFXTextureObject * texture=0x09dfd120, const RectF & dstRect={...}, const RectF & srcRect={...}, const GFXBitmapFlip in_flip=GFXBitmapFlip_None, const GFXTextureFilterType filter=GFXTextureFilterPoint, bool in_wrap=true) Line 397 C++
Test Project_DEBUG.dll!GFXDrawUtil::drawBitmapSR(GFXTextureObject * texture=0x09dfd120, const Point2F & in_rAt={...}, const RectF & srcRect={...}, const GFXBitmapFlip in_flip=GFXBitmapFlip_None, const GFXTextureFilterType filter=GFXTextureFilterPoint, bool in_wrap=true) Line 329 C++
Test Project_DEBUG.dll!GFXDrawUtil::drawBitmapSR(GFXTextureObject * texture=0x09dfd120, const Point2I & in_rAt={...}, const RectI & srcRect={...}, const GFXBitmapFlip in_flip=GFXBitmapFlip_None, const GFXTextureFilterType filter=GFXTextureFilterPoint, bool in_wrap=true) Line 297 C++
Test Project_DEBUG.dll!renderSizableBitmapBordersFilled(const RectI & bounds={...}, int baseMultiplier=1, GuiControlProfile * profile=0x08f692a0) Line 270 C++
Test Project_DEBUG.dll!renderBorder(const RectI & bounds={...}, GuiControlProfile * profile=0x08f692a0) Line 215 + 0xf bytes C++
Test Project_DEBUG.dll!GuiControl::onRender(Point2I offset={...}, const RectI & updateRect={...}) Line 61 + 0x13 bytes C++
Test Project_DEBUG.dll!GuiControl::renderChildControls(Point2I offset={...}, const RectI & updateRect={...}) Line 191 C++
Test Project_DEBUG.dll!GuiControl::onRender(Point2I offset={...}, const RectI & updateRect={...}) Line 65 C++
Test Project_DEBUG.dll!GuiCanvas::renderFrame(bool preRenderOnly=false, bool bufferSwap=true) Line 1557 C++
Test Project_DEBUG.dll!GuiCanvas::handlePaintEvent(unsigned int did=0) Line 218 C++
Test Project_DEBUG.dll!fastdelegate::FastDelegate1<unsigned int,void>::operator()(unsigned int p1=0) Line 993 + 0x1a bytes C++
Test Project_DEBUG.dll!Signal<void __cdecl(unsigned int)>::trigger(unsigned int a=0) Line 323 + 0x17 bytes C++
Test Project_DEBUG.dll!Journal::Call<Signal<void __cdecl(unsigned int)>,unsigned int>(Signal<void __cdecl(unsigned int)> * obj=0x040f3ac8, void (unsigned int)* method=0x105778c7, unsigned int a=0) Line 541 + 0xa8 bytes C++
Test Project_DEBUG.dll!JournaledSignal<void __cdecl(unsigned int)>::trigger(unsigned int a=0) Line 52 + 0x12 bytes C++
Test Project_DEBUG.dll!GuiCanvas::paint() Line 1387 C++
Test Project_DEBUG.dll!fastdelegate::FastDelegate0<void>::operator()() Line 908 + 0x16 bytes C++
Test Project_DEBUG.dll!Signal<void __cdecl(void)>::trigger() Line 312 + 0x13 bytes C++
Test Project_DEBUG.dll!Process::processEvents() Line 62 C++
Test Project_DEBUG.dll!StandardMainLoop::doMainLoop() Line 538 + 0x5 bytes C++
Test Project_DEBUG.dll!torque_enginetick() Line 78 + 0x5 bytes C++
Test Project_DEBUG.dll!TorqueMain(int argc=2, const char * * argv=0x0234ba30) Line 369 + 0x5 bytes C++
Test Project_DEBUG.dll!torque_winmain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * __formal=0x00000000, char * lpszCmdLine=0x00526616, HINSTANCE__ * __formal=0x00000000) Line 423 + 0x17 bytes C++
Test Project_DEBUG.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpszCmdLine=0x00526616, int nCommandShow=1) Line 47 + 0x16 bytes C++
Test Project_DEBUG.exe!__tmainCRTStartup() Line 263 + 0x2c bytes C
Test Project_DEBUG.exe!WinMainCRTStartup() Line 182 C

#1
09/29/2009 (10:47 pm)
Hum... this is a weird one.

Anything else you can tell me about your graphics card would help.
#2
09/29/2009 (11:03 pm)
Hmmm, how did that viewport get created?
Quote:
X 0 unsigned long
Y 726 unsigned long
Width 512 unsigned long
Height 4294966944 unsigned long
#3
09/30/2009 (1:11 pm)
Card name: NVIDIA GeForce 8800 GTX
Manufacturer: NVIDIA
Chip type: GeForce 8800 GTX
DAC type: Integrated RAMDAC
Display Memory: 2530 MB
Dedicated Memory: 739 MB
Shared Memory: 1791 MB
Current Mode: 1920 x 1200 (32 bit) (59Hz)
Monitor: Generic PnP Monitor
nvd3dumx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvd3dum,nvwgf2um,nvwgf2um
Driver Version: 8.15.0011.9038 (English)
DDI Version: 10
Driver Attributes: Final Retail
Driver Date/Size: 7/14/2009 12:54:00, 9375232 bytes
#4
09/30/2009 (1:13 pm)
Pat - I haven't been able to find where but somehow the y extent is being set to a negative value that is then being assigned to the unsigned long.
#5
09/30/2009 (1:22 pm)
Shot in the dark: Maybe there is some editor window that got put into an invalid state, and then saved, causing that viewport?
#6
09/30/2009 (1:52 pm)
It's comming from EditorGuiStatusBar.

When it sets it's clip rect its inRect is:

- inRect {point={...} extent={...} } const RectI &
+ point {x=0 y=726 One={...} ...} Point2I
+ extent {x=1024 y=22 One={...} ...} Point2I

which is then intersected with max rect:

- maxRect {point={...} extent={...} } RectI
+ point {x=0 y=0 One={...} ...} Point2I
+ extent {x=512 y=374 One={...} ...} Point2I


which returns:

- mClipRect {point={...} extent={...} } RectI
+ point {x=0 y=726 One={...} ...} Point2I
+ extent {x=512 y=-352 One={...} ...} Point2I


which when assigned to the unsigned longs in the viewport, gives:

- viewport {X=0 Y=726 Width=512 ...} _D3DVIEWPORT9
X 0 unsigned long
Y 726 unsigned long
Width 512 unsigned long
Height 4294966944 unsigned long
MinZ 0.00000000 float
MaxZ 1.0000000 float
#7
09/30/2009 (4:40 pm)
@Gary - Did you happen to install the 1.0 SDK over the top of one of the betas?

I worry that maybe you have old DSOs or bad scripts being executed. Maybe try doing a clean install if this is the case?
#8
09/30/2009 (4:45 pm)
I always install to a new folder and I've tried running the cmd's to clean basically everything.

I guess when I get some time I can try another clean install, just in case something freaky happened the first time.