Monday, November 28, 2011

Tree collision demo - getting the texture and color to N9

I didn't use textures from demo http://opengles20study.blogspot.com/2011/01/cel-shading-toon-shading-silhouette-how.html after porting to N9: http://opengles20study.blogspot.com/2011/08/meego.html
To get the textures work if using jpeg library (if not using iPhone SDK to generate images - code under #ifdef USE_IPHONE_SDK_JPEGLIB) it is needed to change m_pixelColorComponents from GL_RGBA to GL_RGB here.
It seemed like a good idea not to texture the tree, but to supply color via uniform value when rendering the  tree per instance. I plan to check how the tree looks with very few leaves and for that ngPlant leaves group probably would be better to use textures (billboards). For example about how to use uniform color value in shader, just grep the code for u_Color - there are several available.
This is how it looks on N9 - sorry for the poor video quality.


No comments:

Post a Comment