Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [OT] using manually generated mipmaps  (Read 750 times)
0 Members and 1 Guest are viewing this topic.
Offline d3

Senior Newbie




o(_._)o


« Posted 2004-01-15 14:24:24 »

hello


i am trying to manually generated mipmaps to work. with no success. the idea is basically the same as it can be found in the 'red book'.
when i set

GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST_MIPMAP_NEAREST);

to

GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);

i can at least see the first of the mipmaps. probably because mipmapping is turned of then.

i was wandering if anyone has ever successfully done this kind of mipmapping and could help me out with a code snip or correct my mistake.

cheers
d3



TextureReader.Texture[] texture = new TextureReader.Texture[6];
try {
   for (int i=0; i<texture.length; i++){
           texture = TextureReader.readTexture("demos/data/images/"+i+".png");
   }
} catch (IOException e) {
   e.printStackTrace();
   throw new RuntimeException(e);
}

gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST_MIPMAP_NEAREST);

for (int i=0; i<texture.length; i++){
   gl.glTexImage2D(GL.GL_TEXTURE_2D,
   i,
   GL.GL_RGB,
   texture.getWidth(),
   texture.getHeight(),
   0,
   GL.GL_RGB,
   GL.GL_UNSIGNED_BYTE,
   texture.getPixels());
}<a href="http://" target="_blank">http://</a>
Offline pepijnve

Junior Member




Java games rock!


« Reply #1 - Posted 2004-01-15 15:13:25 »

Do your mip map levels go all the way down to a 1x1 version? If you don't do this, texture mapping is automatically disabled (see the note on page 388 of the red book).
If you don't want to provide all the levels you have to call
1  
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, <maximum level>)

or in your specific case
1  
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 5)

Note that this method is only available starting at OpenGL 1.2
Offline d3

Senior Newbie




o(_._)o


« Reply #2 - Posted 2004-01-16 08:20:01 »

thanx it worked very nicely. i have my depth blurring now Smiley
actually in my 'red book' it s not on page 388 or not at all available because it is an old old old relase 1.

i ll buy a new one.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Pippogeek (37 views)
2014-09-24 16:13:29

Pippogeek (29 views)
2014-09-24 16:12:22

Pippogeek (18 views)
2014-09-24 16:12:06

Grunnt (42 views)
2014-09-23 14:38:19

radar3301 (24 views)
2014-09-21 23:33:17

BurntPizza (60 views)
2014-09-21 02:42:18

BurntPizza (30 views)
2014-09-21 01:30:30

moogie (36 views)
2014-09-21 00:26:15

UprightPath (49 views)
2014-09-20 20:14:06

BurntPizza (52 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!