Hello fellow Codea fans,
I’m encountering a couple of issues drawing using different projection modes in Codea (drawing a background and having transparency sprites like GUI, along with perspective projected scene).
First issue…In OpenGL, in order to draw a static background, I would disable depth testing, draw my background, then enable depth testing again and draw the scene.
The fastest way I found to draw a static background in Codea was to draw the background (seems by default in orthographic projection so not needing to specify it), then set to perspective projection and draw the scene.
However, when I do that “normally”, the background is still drawn over the scene (it seems orthographic projection is always drawn over perspective)
I found that the only was to set the z value of my background to -10 (anything else and it goes back to being drawn over any perspective projected scene).
This works fine, but it’s too odd for me to believe it’s the proper way to do it, anyone able to help ?
The 2nd issue i’m having is overlaying images with alpha values. For example, when drawing a virtual stick, the transparent part of the image turns to background color, not whatever is drawn under it.
For example:
-- not setting orthographic projection since it seems to activate automatically every draw call
sprite("Planet Cute:Character Boy")
perspective(60)
camera(camx, camY, camZ, lookX, lookY, lookZ, 0, 1, 0)
scene:draw()
It seems things drawn in perspective projections and things drawn in orthographic projections are actually drawn in two different buffers ?
Anyway, I guess manually rendering the image in perspective projection on the near plane of the view frustum would make transparency work, but is it the only way?
Finally, @Simeon , are there any plans to allow the user to have control over things like polygon fill mode and backface/frontface culling ? This would allow for some cool “cheap” stuff like outlining meshes (ala cartoon rendering) etc…
Cheers,
Xavier