Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (481)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (548)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 3 [4]
  ignore  |  Print  
  So you like Textures eh? Texturing Demo in JOGL.  (Read 20395 times)
0 Members and 1 Guest are viewing this topic.
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #90 - Posted 2003-08-17 23:51:29 »

Done. Still sorting out some issues with the Quicktime Texture stuff as I'm trying to get it running faster, and capable of running with an alpha channel or at least a transparent color. I may give in and just release what I have since its causing me grief (and because there is another OSX seed available and there never is a guarantee this stuff will work from seed to seed Smiley ).

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline aNt

Senior Member




AFK


« Reply #91 - Posted 2003-08-19 10:40:44 »

dude the seed is prity much all there..

fire up what u have and i will take a look- and ask some dudes i no about ways we can make it run alittle faster. it seemed to me that QuickTime was doing alot of processing to get its content into the QTImageProducer.

all tops stufff....
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #92 - Posted 2003-08-27 16:35:38 »

Quote
Done. Still sorting out some issues with the Quicktime Texture stuff as I'm trying to get it running faster, and capable of running with an alpha channel or at least a transparent color.


Any word on this? I just hit a snag with the version of this loader i'm using - I need to generate a font texture at runtime, and was hoping to use the loader to do the heavy lifting of converting a BufferedImage into a GL Texture. Unfortunatly this doesn't seem possible without some reworking here and there.

I'm guessing you've already hit and worked around this problem if you're working on Quicktime animation, is it possible to save myself some time by getting my hands on your current version? And then the font generation can be released to everyone who wants to use it Smiley

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #93 - Posted 2003-08-27 23:05:26 »

Yeah I can zip up what I have, but its not a good base to build from. 10.3 is releasing new builds very rapidly and I find myself reinstalling more than I do anything else at this point so I haven't had a chance to pick it back up. My other dev box is a WindowsXP box which apparently has suffered a hard drive crash so at the moment I'm in a pause until I can recover the files off the Window box.

I plan to pop the drive and attach it to an external Firewire port and see if the Mac can extract some data off the drive (code mostly). I didn't mention it because I didn't want to succomb to the shame of not checking code into CVS Smiley Thanks for making me bring that into the open  Angry


Grin

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #94 - Posted 2003-08-28 13:35:10 »

I found that it was pretty simple to hack together a simple solution, just simply passing a buffered image in with the normal loading parameters, and assuming this is null if loading from disk is needed.

Best of luck salvaging code from the HD, hardware failures are a pain Angry

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Lareon

Senior Newbie




I program for fun... Isn't that weird?!?


« Reply #95 - Posted 2004-11-04 23:26:50 »

FWIW, I just started trying to use these, and on the compile I get the following warning about them (using Java 1.5 -- I've gathered that this warning is nonexistent in 1.4.x):

TextureLoader.java:80: warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.HashMap

I dunno if this is a big deal, though it doesn't seem to be.  Also, Is this still kind of the "definitive" texture loading group for JOGL?  I haven't been able to find anything else that looks as complete.

--Scott

Quote
For completeness, Troggan has provided update versions of my loaders that fix the texture size bug (e.g. it now copes with wierd shape images) and also removed depedancy on my GameFrame code Smiley

He's posted them here:


Offline girvine

Junior Member




Java games rock!


« Reply #96 - Posted 2004-11-08 07:00:23 »

This is merely a Java 1.5 warning related to the new generics stuff.

You're now "expected" to declare and instantiate collection style classes with a content specification.

eg.
Collection<Integer> myIntegerCollection = new ArrayList<Integer>();

I won't go into the generics' spec any further... happy reading. Wink
Offline girvine

Junior Member




Java games rock!


« Reply #97 - Posted 2004-11-09 01:08:50 »

Hi all.

Has anyone else used gregory's texture loader stuff for PNG files that have transparency in it?

I can only assume the PNG format can have alpha or not alpha in the picture file.  I'm having no problems with some PNGs I've gotten from (nehe) lessons, but with some i've got (for fonts for example) that have a transparent background, they load all screwy.

I'm finding (from the initially posted version of the code) the pcitures generally end up fairly corrupted (a lot of vertical lines over the basic picture).  I've tried RGB and RGBA for the texture type.  

I'll be the first to admit I generally don't know a great deal about graphic formats, athough I'm sure I "should" take the time to learn as I'm sure it's relatively simple.

Any suggestions would be great.

Greg.

ps. most of the links in previous posts in this thread no longer work, so i could grab any other code samples identified.


Offline kevglass

JGO Kernel


Medals: 153
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #98 - Posted 2004-11-09 10:45:55 »

The other texture loading example is available in the Wiki at:

http://wiki.java.net/bin/view/Games/TextureLoadingExample

Kev

Offline girvine

Junior Member




Java games rock!


« Reply #99 - Posted 2004-11-10 19:09:03 »

Hi Kev.

Thanks for the links.  I've plugged in the convertImage... routing into the original code and took out the source pixel type as you've done, and all is happy now with my transparent texture fonts.
Mind you, it also helped that I hit myself with a big stick when I remembered to make sure the pictures I was trying to load where n^2 height/width, which they weren't!  That explains why they were always blank! Smiley

Greg.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline funsheep

Senior Newbie




Java games rock!


« Reply #100 - Posted 2005-01-18 08:52:46 »

hi there,

saw the "get2Fold" method in the TextureLoader. I am using the following elegant code snippet for this job

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
      /**
       * Generates the next power of two.
       * @param in An int.
       * @return The next power of two.
       */

      public static final int nextPowerOf2(int in)
      {
             in -= 1;

             in |= in >> 16;
             in |= in >> 8;
             in |= in >> 4;
             in |= in >> 2;
             in |= in >> 1;

             return in + 1;
      }


got this from a c library, actually, i currently don't know, which one it was. if you guys want to know, i can search for it.

regarts,
funsheep
Offline nnevatie

Junior Member




It is slightly better to be simple than correct.


« Reply #101 - Posted 2005-01-18 10:39:15 »

Quote
hi there,

saw the "get2Fold" method in the TextureLoader. I am using the following elegant code snippet for this job

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
      /**
       * Generates the next power of two.
       * @param in An int.
       * @return The next power of two.
       */

      public static final int nextPowerOf2(int in)
      {
             in -= 1;

             in |= in >> 16;
             in |= in >> 8;
             in |= in >> 4;
             in |= in >> 2;
             in |= in >> 1;

             return in + 1;
      }


got this from a c library, actually, i currently don't know, which one it was. if you guys want to know, i can search for it.


That's quite nice. I deduced a version of my own some time ago (next power of two, downwards):

[CODE]
   private static int getPowerOfTwo(int a)
   {
       return (int) Math.pow(2, (int) (Math.log(a) / Math.log(2)));
   }
[/CODE]

Awards:
- Nobel Prize in Physics for inventing his Doomsday Machine
- Nobel Peace Prize for not using it

http://www.g0dmode.com -- a collection of things not real
Offline funsheep

Senior Newbie




Java games rock!


« Reply #102 - Posted 2005-01-18 13:18:22 »

i'm currently porting the postet files to my own application. we are using a sever <-> client concept, where the server loads the textures from a db and then transfer them to the client. so i will split both files into a version without OpenGL (for the server) and a conversion + binding loader/manager on the client side.

currently i'm wondering, if i save the byte array in the db or the real file...

i will post again, when its done Smiley

regards,
funsheep
Offline little-monkey

Junior Newbie




nobody likes to be in my place instead of me...


« Reply #103 - Posted 2005-01-24 19:44:33 »

Quote
Yeah I can zip up what I have, but its not a good base to build from. 10.3 is releasing new builds very rapidly and I find myself reinstalling more than I do anything else at this point so I haven't had a chance to pick it back up.


have you ever released this code? Or, has aNt optimized the QT loading? I need to do exactly the same thing and it would save a lot of time if the code that loads QT stuff (in its most updated form) was accessible.

Many many thanks....
Offline aNt

Senior Member




AFK


« Reply #104 - Posted 2005-02-15 06:56:17 »

arrr- i thought we had this in the bag now.

the movie loader was slow because we had to convert
using a QTImageProducer. Seems Apple my have drop
that little class with there newer QTJ version.

I will have another look at it to see if we can use
RawImageEncoders. At the end of the day QT still needs
to uncompress the media so we can then hand it to
GL. QTJ doesnt have the call to output the Data to a
given format (its in the ObjC/C headers- Apple just didnt
port it). So we have to find other tricks to do the same
thing- these seem to be slower then doing the 'Apple
have done it us' that to ObjC dudes get.

shame we miss out Sad If anyone at Apple wants to tell
us a trick to pull this off fell free.

i will have a look at a more low level way of doing anyways Smiley
Offline little-monkey

Junior Newbie




nobody likes to be in my place instead of me...


« Reply #105 - Posted 2005-02-15 18:24:07 »

oh yes... please... that would be so so cool.
Offline d3

Senior Newbie




o(_._)o


« Reply #106 - Posted 2005-02-15 19:57:58 »

i just threw together a 'proof-of-concept' i was thinking about for some time now.

after having a lot of trouble with the, as of now, crappy QTJ API i finally figured out a way to use the native QT API through the JNI. as mentionened above the code is more of a 'proof-of-concept' and since i have not much experience with C/CPP i didn t manage to come up with a windows version ( maybe someone can help Wink ). it s just osx.

the basic concept is to get rid off the, especially under osx, annoying copying of data from native to java to native to opengl and rather leave all the heavy data pushing in native world where it belongs.

i was really suprised to find out that when suppling a valid opengl context from jogl, you can call 'native' opengl functions via JNI from native code. i m not sure if this is valid, whatever that means, but i tested it under osx on several occasion and it seems to be robust.

with that knowledge i wrote ( and snipped of course ) a little wrapper around the native QT API that would simply allocate some memory, let quicktime write into this memory and copy it to opengl, all on the native side. the java/jogl part would just controll the whole process. which is creating, playing, looping movies etc.

it still seems a bit like blackmagic to me and maybe is. i would be happy to get some feedback and even better some improvement on this approach.

-> QTGLJNI
Offline little-monkey

Junior Newbie




nobody likes to be in my place instead of me...


« Reply #107 - Posted 2005-02-25 18:28:12 »

d3, this is really cool - but is there anyone who could adapt this to windows? i have no experience with C... and have no Macs to test it on...

If anyone could give it a try and convert it to a windows DLL, I would be very grateful.

Thanks a lot...
angelfaerie
Guest
« Reply #108 - Posted 2005-02-25 18:31:18 »

Grin im new Roll Eyes
Offline Foo

Innocent Bystander





« Reply #109 - Posted 2005-12-24 17:46:57 »

I have a problem with the Texturing Demo described at the beginning of this Thread. When I load a bitmap as a texture, all of the blue colors in the bitmap(BLUE channel=255)  are displayed in OpenGL as black and all of my black colors are displayed as blue. I send the picture as follows
1  
textureManager.createManagedTexture("background", "bg.bmp", GL.GL_TEXTURE_2D, GL.GL_BGR, GL.GL_RGB, GL.GL_LINEAR, GL.GL_LINEAR, true, false );

The strange thing is that the problem only occurs when the blue channel is set to 255, so when I load a bitmap where all of of the pixels' blue channels are set to 255 and the green and red channels set to 0 my texture is displayed as black. BUT when the blue channel is set to e.g. 254 and the green and red channels to 0 the texture is displayd as blue. So then the problem doesn't occur. Does someone know what causes this?
Pages: 1 2 3 [4]
  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.

atombrot (27 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (61 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
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!