Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (736)
Games in Android Showcase (223)
games submitted by our members
Games in WIP (813)
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  
  Should JCD create a thread specific to his demos?  (Read 2882 times)
0 Members and 1 Guest are viewing this topic.
Offline Java Cool Dude

Senior Devvie




Java forever


« Posted 2004-03-09 04:34:51 »

After spending few hours creating my first LWJGL fragment/Vertex shaders demo, I was ready to start a JWS thread where I expose webstart applications, zip files and online code.
But then it hit me; do people really care what a guy on the other side of the planet does with his free time?
Am I bothering some of you fellow programers with my posting habits?
Am I just a cocky bastard? <--- I know for sure I'm not
Anyways, here's a little snap shot of my awt/swing less lwjgl demo:


Some little code
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
  private static void makeShaderCode(String filename, boolean isFragment){

    ClassLoader   fileLoader      = ModelLoader.class.getClassLoader();
    InputStream   fileInputStream = fileLoader.getResourceAsStream(filename);
    StringBuffer  fileContent     = new StringBuffer();

    int           charByChar      =  0;

     try{
       if(fileInputStream == null)
        fileInputStream = new java.io.FileInputStream(filename);
      while ((charByChar = fileInputStream.read()) != -1)
        fileContent.append((char)charByChar);

     fileInputStream.close();
    }
    catch(Exception e ){}

    byte[] shaderCode = fileContent.toString().getBytes();

    if(isFragment){
      IntBuffer   id          = createIntBuffer(1);
      ByteBuffer  fragmentPro = ByteBuffer.allocateDirect(shaderCode.length)
                                          .order(ByteOrder.nativeOrder())
                                          .put(shaderCode);
      fragmentPro.flip();
      ARBFragmentProgram.glGenProgramsARB(id);
      fragmentProID = id.get(0);

      ARBFragmentProgram.glBindProgramARB(ARBFragmentProgram.GL_FRAGMENT_PROGRAM_ARB ,
                                          fragmentProID);
      ARBFragmentProgram.glProgramStringARB(ARBFragmentProgram.GL_FRAGMENT_PROGRAM_ARB,
                                            ARBFragmentProgram.GL_PROGRAM_FORMAT_ASCII_ARB,
                                            fragmentPro);
    }
    else{
      IntBuffer   id        = createIntBuffer(1);
      ByteBuffer  vertexPro = ByteBuffer.allocateDirect(shaderCode.length)
                                        .order(ByteOrder.nativeOrder())
                                        .put(shaderCode);
      vertexPro.flip();
      ARBVertexProgram.glGenProgramsARB(id);
      vertexProID = id.get(0);

      ARBVertexProgram.glBindProgramARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB ,
                                        vertexProID);
      ARBVertexProgram.glProgramStringARB(ARBVertexProgram.GL_VERTEX_PROGRAM_ARB,
                                          ARBVertexProgram.GL_PROGRAM_FORMAT_ASCII_ARB,
                                          vertexPro);
    }
  }
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #1 - Posted 2004-03-09 05:23:41 »

FWIW, I like when people show what is possible using an API (be it any api). especially the more advanced stuff, since it shows what is possible using OpenGL (with Java).

Would you mind donating (and releasing under bsd) some of your demos for inclusion in an LWJGL example package?

Keep 'em coming!

ps. Turn on anti aliasing!!

Offline princec

« JGO Spiffy Duke »


Medals: 945
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #2 - Posted 2004-03-09 07:05:45 »

One day somebody will tell me how to write shaders Smiley
Or better still there will just be a nice big library of them then I can pick and choose from...

Cas Smiley

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

JGO Kernel


Medals: 57
Projects: 11


Monkey for a head


« Reply #3 - Posted 2004-03-09 08:32:08 »

I wish I had a graphics card that ran ARB Fragment Programs. Cry

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

Senior Newbie




Java games rock!


« Reply #4 - Posted 2004-03-09 09:49:06 »


as an artist, it makes me wish java games start to appear everywhere. Few free engines in c++ to do some of the features you show.

True realtime reflection is something I even doubt is possible in a game, though...

I have worked in a game  , and we just used environment maps...

the md3 demo (hey, I think I saw that sony character too in the Lone Runner opengl demos Wink ) for example showed me java can display md3 quite well..

I have lately seen some java engines like JMEL or something and JTPtc or something like that, with which I saw this first basic demo : www.tokima.com  .Seriously these days I'm discovering a new world. I thought it all was restricted to c++, blitz3d , dbpro and gamestudio...






Offline snaga

Senior Newbie




Java games rock!


« Reply #5 - Posted 2004-03-09 09:50:29 »

Quote
ps. Turn on anti aliasing!!


yep.... Wink

Offline Orangy Tang

JGO Kernel


Medals: 57
Projects: 11


Monkey for a head


« Reply #6 - Posted 2004-03-09 10:05:00 »

Quote
True realtime reflection is something I even doubt is possible in a game, though...

*cough* Project Gotham Racing *cough*

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

Junior Devvie





« Reply #7 - Posted 2004-03-09 10:32:15 »

I'd love to see them, and I'm sure a lot of people who are new opengl/lwjgl (me for one) will be able to pick up a few pointers from your code. As long as I don't get the culling bug that is Grin

Offline snaga

Senior Newbie




Java games rock!


« Reply #8 - Posted 2004-03-09 18:34:14 »

Quote
*cough* Project Gotham Racing *cough*


oops

And I even read the review in a magazine...


heck

getting old

Offline Java Cool Dude

Senior Devvie




Java forever


« Reply #9 - Posted 2004-03-09 18:48:58 »

Check my newly created thread Grin
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #10 - Posted 2004-03-11 12:54:07 »

Quote

Would you mind donating (and releasing under bsd) some of your demos for inclusion in an LWJGL example package?


And if any of them could legitimately be called "games", and are webstart, then I'd rush to include them in the java games list...

malloc will be first against the wall when the revolution comes...
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 
cybrmynd (120 views)
2017-08-02 12:28:51

cybrmynd (144 views)
2017-08-02 12:19:43

cybrmynd (138 views)
2017-08-02 12:18:09

Sralse (154 views)
2017-07-25 17:13:48

Archive (624 views)
2017-04-27 17:45:51

buddyBro (733 views)
2017-04-05 03:38:00

CopyableCougar4 (1260 views)
2017-03-24 15:39:42

theagentd (1239 views)
2017-03-24 15:32:08

Rule (1216 views)
2017-03-19 12:43:22

Rule (1268 views)
2017-03-19 12:42:17
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!