<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Android OpenGL ES &#8211; Mipmaps</title>
	<atom:link href="http://insanitydesign.com/wp/2009/08/01/android-opengl-es-mipmaps/feed/" rel="self" type="application/rss+xml" />
	<link>http://insanitydesign.com/wp/2009/08/01/android-opengl-es-mipmaps/</link>
	<description>The Imagination Enhancer</description>
	<lastBuildDate>Wed, 01 Feb 2012 20:06:32 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Menion</title>
		<link>http://insanitydesign.com/wp/2009/08/01/android-opengl-es-mipmaps/comment-page-1/#comment-1861</link>
		<dc:creator>Menion</dc:creator>
		<pubDate>Thu, 04 Aug 2011 07:46:48 +0000</pubDate>
		<guid isPermaLink="false">http://insanitydesign.com/wp/?p=128#comment-1861</guid>
		<description>I don&#039;t know If I can take some more your time, but I&#039;ll try :)

So firstly, thanks for answer. Anyway you misunderstand me. I already have fully working application (https://market.android.com/details?id=menion.android.locus&amp;feature=more_from_developer), anyway I now try to rotate map around X axis, and few problems occur (more info here http://stackoverflow.com/questions/6863540/problem-with-draw-bitmap-on-rotated-canvas-around-y-axis together with three images). Looks like some problem with drawing on Canvas, so I&#039;ll probably have to start learn OpenGL ES. 

And problem for me: all tutorials on OpenGL ES, use method that during initialize, they load bitmaps and then use them during rendering. In my case, I need to change map tiles (256x256 bitmaps) dynamically, because as you move with map, new tiles have to be loaded and displayed. And I&#039;m still little bit confused how to do it.

So I asked for some tip on some sample application that should bring some light on this for me. Anyway ignore my posts if you don&#039;t understand or not have time. Thanks anyway for your work on NeHe tutorials, if you&#039;ll not point me on some way, I&#039;ll probably start from begin with this!</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know If I can take some more your time, but I&#8217;ll try <img src='http://insanitydesign.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So firstly, thanks for answer. Anyway you misunderstand me. I already have fully working application (<a href="https://market.android.com/details?id=menion.android.locus&#038;feature=more_from_developer" rel="nofollow">https://market.android.com/details?id=menion.android.locus&#038;feature=more_from_developer</a>), anyway I now try to rotate map around X axis, and few problems occur (more info here <a href="http://stackoverflow.com/questions/6863540/problem-with-draw-bitmap-on-rotated-canvas-around-y-axis" rel="nofollow">http://stackoverflow.com/quest.....und-y-axis</a> together with three images). Looks like some problem with drawing on Canvas, so I&#8217;ll probably have to start learn OpenGL ES. </p>
<p>And problem for me: all tutorials on OpenGL ES, use method that during initialize, they load bitmaps and then use them during rendering. In my case, I need to change map tiles (256&#215;256 bitmaps) dynamically, because as you move with map, new tiles have to be loaded and displayed. And I&#8217;m still little bit confused how to do it.</p>
<p>So I asked for some tip on some sample application that should bring some light on this for me. Anyway ignore my posts if you don&#8217;t understand or not have time. Thanks anyway for your work on NeHe tutorials, if you&#8217;ll not point me on some way, I&#8217;ll probably start from begin with this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NeA</title>
		<link>http://insanitydesign.com/wp/2009/08/01/android-opengl-es-mipmaps/comment-page-1/#comment-1857</link>
		<dc:creator>NeA</dc:creator>
		<pubDate>Wed, 03 Aug 2011 06:51:23 +0000</pubDate>
		<guid isPermaLink="false">http://insanitydesign.com/wp/?p=128#comment-1857</guid>
		<description>Hey there

I do not know if I got you correctly but if you need help with OpenGL in general you could start here (http://insanitydesign.com/wp/projects/nehe-android-ports/) or jump over to NeHe directly.
If you need normal streetmaps you could use Googles own Android API to access Google Map.
If you just want to know in general how you could do a &quot;map&quot; app I would recommend to be &quot;inspired&quot; by the tile map loading every bigger map services does now. You cannot load big images at all as they would probably occupy or crash the memory of your phone, therefore you have to look for a &quot;streaming&quot; reloading of tiles of a map. These single tiles can then be loaded and drawn by OpenGL if you wish to. Basically something similar to classic tile maps with support of all the benefits OpenGL can offer.

I hope this is the direction you needed help. Otherwise let me know.


Regards.</description>
		<content:encoded><![CDATA[<p>Hey there</p>
<p>I do not know if I got you correctly but if you need help with OpenGL in general you could start here (<a href="http://insanitydesign.com/wp/projects/nehe-android-ports/" rel="nofollow">http://insanitydesign.com/wp/p.....oid-ports/</a>) or jump over to NeHe directly.<br />
If you need normal streetmaps you could use Googles own Android API to access Google Map.<br />
If you just want to know in general how you could do a &#8220;map&#8221; app I would recommend to be &#8220;inspired&#8221; by the tile map loading every bigger map services does now. You cannot load big images at all as they would probably occupy or crash the memory of your phone, therefore you have to look for a &#8220;streaming&#8221; reloading of tiles of a map. These single tiles can then be loaded and drawn by OpenGL if you wish to. Basically something similar to classic tile maps with support of all the benefits OpenGL can offer.</p>
<p>I hope this is the direction you needed help. Otherwise let me know.</p>
<p>Regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Menion</title>
		<link>http://insanitydesign.com/wp/2009/08/01/android-opengl-es-mipmaps/comment-page-1/#comment-1856</link>
		<dc:creator>Menion</dc:creator>
		<pubDate>Tue, 02 Aug 2011 13:35:01 +0000</pubDate>
		<guid isPermaLink="false">http://insanitydesign.com/wp/?p=128#comment-1856</guid>
		<description>Hi guys,
  I&#039;m sorry for little offtopic, but look you&#039;re skilled enough to just point me on right way. I create map application on Android (Locus) and I &#039;need&#039; to use OpenGL for map rendering. OpenGL is still little mystery for me (just warning).
  May you please point me to some information page, or doc of function that help me with this. Problem for me is that I with every map move, load new bitmap image and old recycle etc. and all tutorial about OpenGL I found, have preloaded bitmaps. Best should be to use directly bitmap object, but this is not possible, because bitmap data needs to be in c (thanks to JNI) right? If you find minute to answer, I&#039;ll be very glad! Thanks</description>
		<content:encoded><![CDATA[<p>Hi guys,<br />
  I&#8217;m sorry for little offtopic, but look you&#8217;re skilled enough to just point me on right way. I create map application on Android (Locus) and I &#8216;need&#8217; to use OpenGL for map rendering. OpenGL is still little mystery for me (just warning).<br />
  May you please point me to some information page, or doc of function that help me with this. Problem for me is that I with every map move, load new bitmap image and old recycle etc. and all tutorial about OpenGL I found, have preloaded bitmaps. Best should be to use directly bitmap object, but this is not possible, because bitmap data needs to be in c (thanks to JNI) right? If you find minute to answer, I&#8217;ll be very glad! Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NeA</title>
		<link>http://insanitydesign.com/wp/2009/08/01/android-opengl-es-mipmaps/comment-page-1/#comment-1818</link>
		<dc:creator>NeA</dc:creator>
		<pubDate>Fri, 10 Jun 2011 09:50:14 +0000</pubDate>
		<guid isPermaLink="false">http://insanitydesign.com/wp/?p=128#comment-1818</guid>
		<description>Hi Alex

Nice nice, thanks for that info. Haven&#039;t ever thought once about that... &#039;doh&#039;...

Thx very much</description>
		<content:encoded><![CDATA[<p>Hi Alex</p>
<p>Nice nice, thanks for that info. Haven&#8217;t ever thought once about that&#8230; &#8216;doh&#8217;&#8230;</p>
<p>Thx very much</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://insanitydesign.com/wp/2009/08/01/android-opengl-es-mipmaps/comment-page-1/#comment-1817</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Fri, 10 Jun 2011 07:52:37 +0000</pubDate>
		<guid isPermaLink="false">http://insanitydesign.com/wp/?p=128#comment-1817</guid>
		<description>that shouldn&#039;t have been a smiley but &#039;8 )&#039;...</description>
		<content:encoded><![CDATA[<p>that shouldn&#8217;t have been a smiley but &#8217;8 )&#8217;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://insanitydesign.com/wp/2009/08/01/android-opengl-es-mipmaps/comment-page-1/#comment-1816</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Fri, 10 Jun 2011 07:51:19 +0000</pubDate>
		<guid isPermaLink="false">http://insanitydesign.com/wp/?p=128#comment-1816</guid>
		<description>Nice post, it helped me get mipmaping to work.

Regarding the &#039;hacked&#039; version where you don&#039;t use GLUUtils, it has a big-endian/little-endian issue. It&#039;ll work on little-endian phones, but not on big-endian phones. Wrapping the pixels as bytes manually solves that problem.

The below is also useful as a general way to load textures in OpenGL on Android if one desires to load bitmaps without premultiplied alpha (when using the GLUUtils alpha gets premultiplied (due to behaviour of Bitmap-class), meaning the colors loaded are a*r, a*g, a*b, a, instead of r,g,b,a).

int[] pixels = GraphicsUtil.extractPixels(bitmap);
			byte[] pixelComponents = new byte[pixels.length*4];
			int byteIndex = 0;
			for (int i = 0; i &gt; 16) &amp; 0xFF); // red
				pixelComponents[byteIndex++] = (byte) ((p &gt;&gt; 8) &amp; 0xFF); // green
				pixelComponents[byteIndex++] = (byte) ((p) &amp; 0xFF); // blue
				pixelComponents[byteIndex++] = (byte) (p &gt;&gt; 24);  // alpha
			}
			ByteBuffer pixelBuffer = ByteBuffer.wrap(pixelComponents);

			gl.glTexImage2D(GL10.GL_TEXTURE_2D, level, GL10.GL_RGBA, bitmap.getWidth(), bitmap.getHeight(), 0, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, pixelBuffer);</description>
		<content:encoded><![CDATA[<p>Nice post, it helped me get mipmaping to work.</p>
<p>Regarding the &#8216;hacked&#8217; version where you don&#8217;t use GLUUtils, it has a big-endian/little-endian issue. It&#8217;ll work on little-endian phones, but not on big-endian phones. Wrapping the pixels as bytes manually solves that problem.</p>
<p>The below is also useful as a general way to load textures in OpenGL on Android if one desires to load bitmaps without premultiplied alpha (when using the GLUUtils alpha gets premultiplied (due to behaviour of Bitmap-class), meaning the colors loaded are a*r, a*g, a*b, a, instead of r,g,b,a).</p>
<p>int[] pixels = GraphicsUtil.extractPixels(bitmap);<br />
			byte[] pixelComponents = new byte[pixels.length*4];<br />
			int byteIndex = 0;<br />
			for (int i = 0; i &gt; 16) &amp; 0xFF); // red<br />
				pixelComponents[byteIndex++] = (byte) ((p &gt;&gt; <img src='http://insanitydesign.com/wp/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> &amp; 0xFF); // green<br />
				pixelComponents[byteIndex++] = (byte) ((p) &amp; 0xFF); // blue<br />
				pixelComponents[byteIndex++] = (byte) (p &gt;&gt; 24);  // alpha<br />
			}<br />
			ByteBuffer pixelBuffer = ByteBuffer.wrap(pixelComponents);</p>
<p>			gl.glTexImage2D(GL10.GL_TEXTURE_2D, level, GL10.GL_RGBA, bitmap.getWidth(), bitmap.getHeight(), 0, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, pixelBuffer);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NeA</title>
		<link>http://insanitydesign.com/wp/2009/08/01/android-opengl-es-mipmaps/comment-page-1/#comment-1650</link>
		<dc:creator>NeA</dc:creator>
		<pubDate>Fri, 30 Jul 2010 11:59:13 +0000</pubDate>
		<guid isPermaLink="false">http://insanitydesign.com/wp/?p=128#comment-1650</guid>
		<description>Hi there

The thing with the squares comes with MipMaps in general: If you have a look at http://en.wikipedia.org/wiki/Mipmapping a MipMap source has to be square. I do not know if there are any specifics how to &quot;fake&quot; something else, but this is how I learned and know it.

Regarding the GL11 problem: Good to know. Still hanging on my Magic ^^&#039; But I already noticed that there are far too many differences in between the different Android Phones as there should be.

Regards</description>
		<content:encoded><![CDATA[<p>Hi there</p>
<p>The thing with the squares comes with MipMaps in general: If you have a look at <a href="http://en.wikipedia.org/wiki/Mipmapping" rel="nofollow">http://en.wikipedia.org/wiki/Mipmapping</a> a MipMap source has to be square. I do not know if there are any specifics how to &#8220;fake&#8221; something else, but this is how I learned and know it.</p>
<p>Regarding the GL11 problem: Good to know. Still hanging on my Magic ^^&#8217; But I already noticed that there are far too many differences in between the different Android Phones as there should be.</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Statz</title>
		<link>http://insanitydesign.com/wp/2009/08/01/android-opengl-es-mipmaps/comment-page-1/#comment-1645</link>
		<dc:creator>Jeremy Statz</dc:creator>
		<pubDate>Mon, 26 Jul 2010 11:11:19 +0000</pubDate>
		<guid isPermaLink="false">http://insanitydesign.com/wp/?p=128#comment-1645</guid>
		<description>Hey there sir, I&#039;m trying to solve a similar problem and was trying to make use of your buildMipMap function.  It seems to work, but only for textures that are square.  I&#039;ve been trying to work out why this is but keep getting black for anything non-square.  do you know why this is?  Do I need to ditch Bitmap as well?  I know it incorrectly premultiplies the alpha channel, so maybe that&#039;s for the best anyway.

Oddly enough, the reason I&#039;m trying to do this is because the test for GL11 isn&#039;t reliable.  The HTC Eris and Hero, for example, will report a GL11 instance but will not generate mipmaps correctly.  At this point I&#039;m hoping to remove all reliance on the auto-generated mipmaps. :/</description>
		<content:encoded><![CDATA[<p>Hey there sir, I&#8217;m trying to solve a similar problem and was trying to make use of your buildMipMap function.  It seems to work, but only for textures that are square.  I&#8217;ve been trying to work out why this is but keep getting black for anything non-square.  do you know why this is?  Do I need to ditch Bitmap as well?  I know it incorrectly premultiplies the alpha channel, so maybe that&#8217;s for the best anyway.</p>
<p>Oddly enough, the reason I&#8217;m trying to do this is because the test for GL11 isn&#8217;t reliable.  The HTC Eris and Hero, for example, will report a GL11 instance but will not generate mipmaps correctly.  At this point I&#8217;m hoping to remove all reliance on the auto-generated mipmaps. :/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Android OpenGL ES â€“ Mipmaps &#124; Adobe Tutorials</title>
		<link>http://insanitydesign.com/wp/2009/08/01/android-opengl-es-mipmaps/comment-page-1/#comment-1397</link>
		<dc:creator>Android OpenGL ES â€“ Mipmaps &#124; Adobe Tutorials</dc:creator>
		<pubDate>Sun, 02 Aug 2009 03:43:57 +0000</pubDate>
		<guid isPermaLink="false">http://insanitydesign.com/wp/?p=128#comment-1397</guid>
		<description>[...] I am currently a little bit experimenting with Android and its SDK as I am proud owner of a HTC Magic as well as I am pretty impressed by the SDK, Android itself and the ideas and principles it follows. More precisely I am playing around with the graphical functionalities of Android, especially OpenGL .  Read the rest here: Android OpenGL ES â€“ Mipmaps [...]</description>
		<content:encoded><![CDATA[<p>[...] I am currently a little bit experimenting with Android and its SDK as I am proud owner of a HTC Magic as well as I am pretty impressed by the SDK, Android itself and the ideas and principles it follows. More precisely I am playing around with the graphical functionalities of Android, especially OpenGL .  Read the rest here: Android OpenGL ES â€“ Mipmaps [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

