Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / #renderer "Advanced" and shadows and DrawObject() enabled causes error : RenderShadowMap() must be called before drawing anything to the screen

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 31st Mar 2020 00:36 Edited at: 31st Mar 2020 01:04
#renderer "Advanced", shadows enabled AND DRAWOBJECT() causes error

I noticed that DrawObject() also persists after a sync() using #renderer "Basic". I'm not sure that was the case previously




*NOTE*: If a mod sees this could you change the title to include "And DrawObject() " for me please

Attachments

Login to view attachments
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 31st Mar 2020 14:40 Edited at: 31st Mar 2020 14:41
This requirement is because switching rendering to the shadow map throws away any rendering you previously did to the screen and starts again after the shadow map is done. If you use DrawObject then this can be avoided by inserting your DrawObject calls into the separated render calls.

Sync() calls the following three commands in order: Update(0), Render(), Swap()
Render() calls the following four commands in order: RenderShadowMap(), Render2DBack(), Render3D(), Render2DFront()

So you can replace Sync() with the follow sequence of commands



Quote: "I noticed that DrawObject() also persists after a sync() using #renderer "Basic""

This may go away with the above code, if not then can you give more details?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 31st Mar 2020 21:59 Edited at: 31st Mar 2020 22:00
Ok. i'll give that a go. Thank you very much for your help

Login to post a reply

Server time is: 2024-04-26 12:44:58
Your offset time is: 2024-04-26 12:44:58