The struggles of webGL




I finally got this working in WebGL!

If you were wondering why I didnt end up posting a new build last night, its because after putting all this work into making this nice looking after image trail composed of 14 different sprites captured by a camera, put into a rendertexture, run through a shader, and converted to a sprite... its because it didn't work in webGL.

The only answers I could find to this problem were literally a decade old, and didn't apply to my situation.

Turns out, if you want to create a new RenderTexture at runtime, webGL just says 'Nah.'

I tried dozens of differnet approaches, and even considered rewriting the entire objectpool and after image script to render to a mesh instead of a sprite renderer... which had its own issues... but...
The solution was to pass an empty RenderTexture sitting in my assets to the script along with the parameters, and just reuse that one over and over, clearing it before each use.

There is one more thing I want to do before putting out a new build, but my brains a little fried after debugging this for hours, so possibly tomorrow, a new build will be out, but probably not tonight.

Get Project Kobold's Tale

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.