opengl es 2.0 mojo equivalent

Monkey Archive Forums/Monkey Projects/opengl es 2.0 mojo equivalent

NoOdle(Posted 2013) [#1]
Started a side project the other day to create a 2d gl 2.0 shader mojo equivalent that I could plug into existing projects to add some extra shine. Ive managed to get working:

Scissor, Viewport, Cls, ClsColor, Alpha, Color, Blend ( Alpha, Add or Multiply )

A few alterations for images, they are called Textures and can be loaded with a similar command to LoadImage.

SetShader( shader ) - Sets the current shader
SetTexture( texture ) - Sets the current drawing texture
DrawQuad - Draws quad with x, y, w, h, uv's, angle

A default shader is used to render, user implemented ones can be extended and uniforms and attributes can be fetched and updated using overridden methods allowing custom values to be passed in.

At the base of the rendering is a batch that groups quads together to save on shader and texture binds.



The black and white texture has a ripple shader applied and the cobble stones have a lighting dot3 shader with a light at the mouse position (looks awesome!), the other quads are using different colors and blends.

I have tested on ios + html5 (safari + chrome) and everything is working so far, still need to test glfw and Android before uploading a small demo.

[edit] might also write a simple gpu particle shader and add to the demo...


Shinkiro1(Posted 2013) [#2]
Well, that's awesome :)
I would love to get my hands on this.

Some questions:
1) Is it just drop in the module and go or will I have to recompile trans
2) Is it an addition to mojo or a replacement (cls, ...)
3) Render to texture?


dragon(Posted 2013) [#3]
are quads coords floats or shorts?
i do a test long time ago .. and shorts are much much faster
(perfect for tile-maps or so)

same for UV-coords... shorts are again faster with "scaled texture coord" - instead using values between 0 and 1 / i used values between 0 and 4096 (4096 is virtual resolution - even if your texture is only 1024 px)


rIKmAN(Posted 2013) [#4]
Nice work NoOdle, that looks sweet!


Raz(Posted 2013) [#5]
Very interested in this. Am hopeful of some bloom and/or blur shaders for GLFW one day :D


Shinkiro1(Posted 2013) [#6]
Ok NoOdle, you teased us enough with your awesome project.
Now give us a download link already :P


rIKmAN(Posted 2014) [#7]
Any news NoOdle?