Now I’m experimenting with interactive form of ASCII art in Unity and I’m wondering what would be the most efficient way to do it.
I’ve put together a little test ground (attachment!) - a simple plane with two cubes on it, lit with 3 point lights and a “player” being able to move around. There is a “render camera” in the scene, rendering to 64x32 texture that I copy to Texture2D, sample pixel intensities (grayscale) from there (using GetPixels) and converting those intensities to string (doubling characters just to make final string more proportional and using just 4 “shades” of ascii) that I show using GUI.
The whole process is killing the framerate (although it’s still usable at 64x32 texture size) and I hope there is a better way to achieve the same result. Is there?
Also, I feel limited using GUI to show the characters - I’d like something more dynamic like polys (mapped with single characters) that I can move around, acting like particles (that’s what I’ve been doing in Maya, but it was faaaar from the real-time ) but there’s no point heading that way without being able to do pixel->ascii conversion much faster than now.
There’s some complex, positively eye-hurting interactive ascii art in this thread. LeFishy didn’t appear to disclose how this effect was achieved, but it may well have been done with an unusual shader.
haha nah no shaders. I am actually casting a ray from the centre of every 10x10 pixel square on the screen and simply taking the colour and distance of the hit.
Not very efficient at all but it looks funky and doesn’t run too slowly.
A-ha! That also explains your 40x30 ascii matrix (my method is constrained to ^2 resolutions). How you show ascii characters: by texture mapping planes (“sprites”), using Unity’s GUI (my way) or somehow else…?