Closed Adolio closed 2 years ago
Hey Aurélien, this is "as designed", although you are perfectly right: this information needs to be part of the documentation! I just extended the asdoc info accordingly.
I also had a look if I could automate this — call "clear" automatically on first render if it hasn't yet happened – but that is not so easy. The error occurs when the image/quad/mesh that has the texture assigned is rendered; and from the perspective of that object, it's just a normal texture, like any other, so there's no way to "ask" if the texture is ready. And the RenderTexture itself isn't notified that it's being rendered at all.
So I guess the best thing to do is inform users about this requirement (it's easy to follow, anyway), and otherwise leave this as it is.
In any case, thanks for making me aware of this!
Thanks Daniel, it looks good to me as well 👍
Thanks for the investigations & the asdoc update 🙂
You're very welcome, my friend! 😃
Hi Daniel!
I just found this issue while trying to implement a post-process stack using render textures.
Best, Aurélien
Description
When
Starling::enableErrorChecking
is active, if aRenderTexture
is created & assigned to anImage
without being cleared or drawn before anError
fromContext3D::drawTriangles()
is raised when the rendering procedure is executed.Full stack trace
Potentially related forum thread
How to reproduce?
Error checking must be on
Failing code
Workaround
Solution idea / questions
Should
Starling
ensures that theRenderTexture
is properly cleared at creation or should this be stated in the documentation (I didn't managed to found it)?