Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: BeginScene failed in StartRenderSurface  (Read 482 times)
DanDixon
Customers
Community Member
*****
Posts: 181


« on: May 22, 2008, 12:57:46 AM »

I'm getting the following error in the debug file when I turn on glow:

Code:
05-21-2008 22:43:37 | TEXTURE MANAGER : BeginScene failed in StartRenderSurface, be sure to draw on rendersurface outside the usual TV.Clear/TV.RenderToScreen block

However... Glow works just fine and I'm quite certain that I'm doing what it says to do (only drawing on a rendersurface outside the TV.Clear/TV.RenderToScreen block).

My project also has as 3D mode (requiring red/blue glasses) which works great, yet this error is generated when I enable that (as it also works with a render surface).

My glow code is as follows:

Code:
            rsGlow.StartRender(False)
            World.DrawBackground()
            rsGlow.StartRender(True)
            Scene.RenderAll(True)
            rsGlow.EndRender()
            GraphicFX.UpdateGlow()

Then I draw the world:

Code:
            TV.Clear()
            World.DrawBackground()
            TV.Clear(True)
            Scene.RenderAll(True)
            Phys.DrawLabels()
            GraphicFX.DrawGlow()

Some additional code that draw the UI, etc. And finally:

Code:
            TV.RenderToScreen()

So again... Everything works, but the debug file would suggest otherwise. And this error is generated every frame, so the debug file gets really big.

Any thoughts on why this happens?

Thanks...
« Last Edit: May 22, 2008, 12:07:07 PM by DanDixon » Logged
sybixsus
Customers
Community Member
*****
Posts: 1094


WWW
« Reply #1 on: May 22, 2008, 11:14:04 AM »

Quote
Glow works just fine and I'm quite certain that I'm not doing what it says I am (drawing on a rendersurface outside the usual TV.Clear/TV.RenderToScreen block).
I assume that's just a slip of the tongue. Do you mean you're sure you *are* doing what it tells you to do?
Logged
DanDixon
Customers
Community Member
*****
Posts: 181


« Reply #2 on: May 22, 2008, 12:09:37 PM »

I assume that's just a slip of the tongue. Do you mean you're sure you *are* doing what it tells you to do?
Yes... That's what I meant.  Smiley  I corrected the original message.

Any idea why I get these errors in the log file?
Logged
sybixsus
Customers
Community Member
*****
Posts: 1094


WWW
« Reply #3 on: May 22, 2008, 12:52:56 PM »

Well, you have these lines..
Quote
rsGlow.StartRender(False)
World.DrawBackground()
rsGlow.StartRender(True)
Now I'm pretty sure I know why you're doing that, but I wonder if TV does. To TV, it might look as though you're trying to render a second rendersurface when you haven't finished rendering the first one. Can you not safely call rsGlow.EndRender() before calling StartRender() a second time, or does that defeat the purpose?
Logged
jviper
Community Member
*
Posts: 1382

Discipline in training


« Reply #4 on: May 22, 2008, 01:48:04 PM »

Is there a call to the RSGlow.EndRender anywhere inside the World.DrawBackground() or in it's stack? If not, then you will need to add a RSGlow.EndRender after World.DrawBackground(). Also, the World_Drawbackground cannot call RSGlow.StartRender, or you'll run into the same problem.
Logged

JAbstract.....Don't just imagine, make it happen!
DanDixon
Customers
Community Member
*****
Posts: 181


« Reply #5 on: May 23, 2008, 10:46:06 PM »

So that was an easy fix:

Added another "rsGlow.EndRender()" after the background is drawn and before the 2nd StartRender.

Code:
          rsGlow.StartRender(False)
            World.DrawBackground()
            rsGlow.EndRender()
            rsGlow.StartRender(True)
            Scene.RenderAll(True)
            rsGlow.EndRender()
            GraphicFX.UpdateGlow()

Application works the same way, but the errors are no longer showing up in the debug output.

Cheers to jviper and sybixsus.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks