Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2
1  Java Game APIs & Engines / JOGL Development / Re: shadow mapping on: 2007-03-23 14:59:28
Are you sure nothing is drawn ? I followed the same tutorial and at first I thought nothing was drawn but it's possible that all the z-values are very close together.

Koen
2  Java Game APIs & Engines / JOGL Development / Re: JOGL and CG on: 2007-03-14 12:09:16
You need a valid OpenGL context so the cg library can use it to query the graphics card.

It's better to construct all your objects from the init(GLDrawable gl) method, because you also need a valid OpenGL context to create Texture objects.

Koen Samyn
3  Java Game APIs & Engines / JOGL Development / Re: JOGL and CG on: 2007-03-13 13:06:58
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  
private void initShaders(){
        context = cgCreateContext();
        cgGLSetManageTextureParameters(context,true);
        vertexProfile = cgGLGetLatestProfile(CG_GL_VERTEX);
        switch(vertexProfile){
            case CG_PROFILE_ARBVP1:System.out.println("ARBVP1");break;
            case CG_PROFILE_VP20:System.out.println("VP20");break;
            case CG_PROFILE_VP30:System.out.println("VP30");break;
            case CG_PROFILE_VP40:System.out.println("VP40");break;
            case CG_PROFILE_UNKNOWN:System.out.println("Unknown Profile");break;
        }
        if ( vertexProfile != CG_PROFILE_UNKNOWN){
            cgGLSetOptimalOptions(vertexProfile);
            cgVertexInitialized=true;
        }
        cgError();
        fragmentProfile = cgGLGetLatestProfile(CG_GL_FRAGMENT);
        switch(fragmentProfile){
            case CG_PROFILE_ARBFP1:System.out.println("ARBFP1");break;
            case CG_PROFILE_FP20:System.out.println("FP20");break;
            case CG_PROFILE_FP30:System.out.println("FP30");break;
            case CG_PROFILE_FP40:System.out.println("FP40");break;
            case CG_PROFILE_UNKNOWN:System.out.println("Unknown Profile");break;
        }
        if ( fragmentProfile != CG_PROFILE_UNKNOWN){
            cgGLSetOptimalOptions(fragmentProfile);
            cgFragmentInitialized=true;
        }
        cgError();
    }


This init method needs to be called from the init method of the GLCanvas :

1  
2  
3  
public void init(GLAutoDrawable gl) {
initShaders();
}


By the way, fx files are the way to go when you use cg.

Koen
4  Java Game APIs & Engines / JOGL Development / Re: JOGL and CG on: 2007-03-12 22:40:21
You need a valid opengl context before you can determine the profile for your card.
5  Java Game APIs & Engines / JOGL Development / Re: JOGL and CG on: 2007-03-12 12:56:16
CG effect files can be precompiled and that is what usually happens for these demos.
However if you want to compile the fx files from within your own program (in other words on the fly) you need to have the cg dlls.

(cg.dll & cgGL.dll)

Koen
6  Java Game APIs & Engines / JOGL Development / Re: JOGL and CG on: 2007-03-12 12:31:48
What cg version do you have installed ?
Mine is NVIDIA Cg 1.4.1 and everything works.

Koen
7  Java Game APIs & Engines / JOGL Development / Re: JOGL and CG on: 2007-03-10 16:48:09
It looks like the jogl_cg.dll is not found.
You need to make sure you copy it to the same location you copied jogl.dll, jogl_awt.gll & gluegen-rt.dll to

I'm working on some support classes for cg effect files , I'll post them in the shared code section when I'm done.

Koen
8  Game Development / Newbie & Debugging Questions / copying the zbuffer to the alpha channel of an FBO on: 2007-03-09 10:16:20
Hi,

as the subject says I would like to copy the contents of the zbuffer to the alpha channel of a render target.
Is this possible ?

The reason I want to do this is to make a water surface more opaque when it is further away.

Koen
9  Java Game APIs & Engines / JOGL Development / Re: TextureIO Flipping Out?? on: 2007-03-02 17:16:01
Quote
I'm facing this problem in another context and I think I'm going to solve it by setting up a texture matrix. That would also save you from having to mutate your texture coordinates. Would that approach work better? You can compute the values that have to go into the texture matrix from the various parameters of the Texture object (look at the implementation of getSubImageTexCoords for pointers).

A matrix would be the best solution (wish I thought of it Smiley, it's the simplest and cleanest solution.

Koen
10  Java Game APIs & Engines / JOGL Development / Re: TextureIO Flipping Out?? on: 2007-03-02 13:52:48
I am aware of the advantages of Immutable objects.

However in this case, a lot of very temporary objects are created. In all cases the reference to the object will only exist inside the loop that transforms the textures coordinates.

An alternative solution would be to add a batch processing method like this :

calculateSubImageTexCoords(float[] uvs);
&
calculateSubImageTexCoords(FloatBuffer uvs);

Koen
11  Java Game APIs & Engines / JOGL Development / Re: TextureIO Flipping Out?? on: 2007-03-02 10:32:31
Would it be possible to change the method getSubImageTexCoords, so we can feed it with a TextureCoords object ?

For example :

TextureCoords loopTC = new TextureCoords();
while (moreUVsToProcess){
int p1x = ...
int p1y = ...
texture.getSubImageTexCoords(p1x,p1y,p1x,p1y,loopTC);
// write back the new texture coordinates
}

12  Java Game APIs & Engines / JOGL Development / Re: TextureIO Flipping Out?? on: 2007-03-02 07:43:05
The problem was that uvw coordinates are used for cubemaps. I solved it for now by swapping the positive & negative faces of the entire cubemap (it was a procedural texture anyway so that doesn't matter much).

Thx for the hint.  Wink

Koen
13  Java Game APIs & Engines / JOGL Development / Re: TextureIO Flipping Out?? on: 2007-03-01 10:27:05
I still have a problem with this for cubemaps.   Huh

Koen
14  Game Development / Newbie & Debugging Questions / Re: Runtime.exec() problem on: 2006-09-12 19:59:25
There is also a method requestFocus() , I remember I needed to do that before registering a keylistener on a component.

Koen
15  Game Development / Shared Code / Skeletal animation with quaternions on: 2006-09-09 14:21:08
Hi,

As I was working on some code for real time character animations I wrote some documentation to help me understand it better (a little trick that never fails me). 

Anyhow the result is a 4 page pdf tutorial on how to rotate the different bones of a skeleton efficiently. Use it any way you want, remarks are always welcome (English is not my native language so go easy on me).

Erratum  1: made a mistake on page 4, third translation should be : Translation : T3 = (W-E)*q2*q1 + T2
Erratum 2 : changed total rotation to global rotation

Koen

16  Java Game APIs & Engines / JOGL Development / Re: Mini HOWTO : Netbeans + JOGL + Webstart setup on: 2006-08-31 20:46:31
There are a lot of the hooks in the build.xml file for Netbeans. One of these hooks is -post-compile, which means you can define a target like this :

<target name="-post-compile">
<!-- Do post compile actions -->
</target-name>


This target will then be executed after the build action was completed.

Koen
17  Games Center / Archived Projects / Re: SOAR Implementation demo (landscape rendering) on: 2006-08-29 12:34:13
New version of the demo :

+Added reflection (no water ripples yet unfortunately)
+Added some scenery (trees & huts)

Still working on a good way to add shaders to the program.

The link is still the same : Landscape demo

Koen
18  Java Game APIs & Engines / JOGL Development / Re: Performance question on: 2006-08-20 18:09:30
It's hard to say where the problem is without knowing what your application does and how it does it.

A couple of observations :

* I'd say the biggest problem is with Swing , not JOGL. You could replace GLJPanel with GLCanvas (the awt equivalent) and use awt for your application.

* Secondly you can use FPSAnimator to throttle the application.

* -Dsun.java2d.opengl=true is not necessary unless you want to draw something with Java2D. Some JOGL developers also turn of ddraw.

* Sanest and fastest way of measuring fps is to download fraps.

* another tip is that all open gl calls travel through JNI so it pays to use VBO's,vertex arrays, display lists,...

Koen
19  Games Center / Showcase / Re: Got a smoke? on: 2006-08-19 20:29:22
Renders on my laptop at 10fps too now. It's a steady 100ms per frame on JDK 1.6. Looks very nice Smiley

I lost the mouse cursor though during the demo, but maybe that is LWJGL specific.

Koen
20  Games Center / Archived Projects / Re: SOAR Implementation demo (landscape rendering) on: 2006-08-19 20:10:18
Update :

+skydome added
+walking (running on terrain)
+swapinterval is zero now, to measure raw performance. (only found out about that command recently  Roll Eyes )

-Had an issue with cg shaders, so those will be for the next update.
-The application is mostly fillrate bound now, I'll try to implement front to back rendering too.

Controls are still the same, link is the same too :

Soar Webstart click here


Koen
21  Java Game APIs & Engines / JOGL Development / Mini HOWTO : Netbeans + JOGL + Webstart setup on: 2006-08-16 19:35:42
Hi,

I always hated making a webstart application until I realized I could add some custom ant targets to the build.xml file of my netbeans project. The ant file creates the self signed certificate (doesn't need to be executed each time), compiles the main class (and any other classes that might be needed) and finally signs the resulting jar.

The first target creates a new certificate :

generatekey target (build.xml in Files tab in Netbeans) :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
<target name="generatekey">
        <genkey alias="dae" storepass="yourpassword" >
            <dname>
                <param name="CN" value="Hogeschool Westvlaanderen"/>
                <param name="OU" value="Digital Arts And Entertainment"/>
                <param name="O"  value="http://www.howest.be"/>
                <param name="C"  value="BE"/>
            </dname>
        </genkey>
</target>



The second target compiles the program, creates the jar file and signs it :
(I compile from the main class, so I only add the class files I really need for the demo. Off course it's possible to compile the whole project)

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
<target name="buildsoar" depends="-post-init,-do-clean">
        <mkdir dir="${build.classes.dir}"/>
        <javac classpath="${javac.classpath}" srcdir="${src.dir}"
        destdir="${build.classes.dir}"  includes="dae/objects/landscape/LandscapeTest.java" target="1.5"/>
        <copy todir="${build.classes.dir}">
            <fileset dir="${src.dir}">
                <include name="**/*.ter"/>
            </fileset>
        </copy>
        <mkdir dir="webstart"/>
       
        <jar basedir="${build.classes.dir}"
            destfile="webstart/soar.jar">
            <manifest>
                <attribute name="Main-Class" value="dae/objects/landscape/LandscapeTest"/>
            </manifest>
        </jar>
        <signjar jar="webstart/soar.jar" signedjar="webstart/ssoar.jar" alias="dae" storepass="yourpassword"/>
</target>


That's all there is to it, it's also possible to add a target that ftp's the resulting jar file (and jnlp file) to your webserver of choice. You can invoke the two targets by right clicking on the build.xml file.

For completeness the jnlp file :

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for SwingSet2 Demo Application -->
<jnlp
  spec="1.0+"
  codebase="http://home.euphonynet.be/xanadu/soar"
  href="soar.jnlp">
  <information>
    <title>Soar Demo</title>
    <vendor>Digital Arts & Entertainment,University of Westflanders</vendor>
    <description>An implementation of the SOAR algorithm</description>
    <offline-allowed/>
  </information>
  <security>
      <all-permissions/>
  </security>
  <resources>
    <j2se version="1.5+"/>
    <jar href="ssoar.jar" main="true"/>
    [b]<extension name="jogl" href="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp" />[/b]
  </resources>
  <application-desc main-class="dae.objects.landscape.LandscapeTest"/>
</jnlp>


An important line in the jnlp file is in bold. with the extension tag you can use the jogl jnlp file (which is properly signed). Using the extension has 2 important advantages :

1) Users that have allready used another webstart application that uses the extension don't have to download the jogl jars.

2) The jogl extension defines all the platform specific resources (dll's and so's specifically).

Result (shameless plug to my terrain engine demo ) : Soar demo


hth,
Koen Samyn

22  Games Center / Archived Projects / Re: My first terrain renderer on: 2006-08-16 19:13:07
The camera movement is very nice.

I need to read up on chunked lod but you probably also need some kind of error metric to decide which level of the lod to show.

Also a webstart version would be nice, you can easily include the jnlp file from the jogl website.

Koen
23  Games Center / Archived Projects / Re: SOAR Implementation demo (landscape rendering) on: 2006-08-13 22:40:27
I implemented some extra features for the demo :

+mouse look (drag mouse)
+ e/d to go to higher / lower viewpoint
+ fps
+ number of triangles
+ one dimensional texture

Also some tweaks that I hope will result in a better fps.

Start it here

Koen
24  Game Development / Newbie & Debugging Questions / Re: VBO problem with triangle strip on: 2006-08-11 21:32:17
Thanks Riven, but I found my mistake (good thing this is the clueless newbie section)

I  didn't specify the correct size for my buffers.
I used the limit() function to get the size for the vbo buffer , but offcourse it has to be terrainData.limit()*4 (float size),same goes for the triangle strip buffer.
25  Games Center / Archived Projects / Re: SOAR Implementation demo (landscape rendering) on: 2006-08-11 21:28:32
Added :

+ Wireframe mode (press w)
+ VBO support

full screen on my pc i'm getting a minimum of 60 fps
on my laptop I get 30fps-60fps

What configuration do you have darkprophet ?

I'm still working on your other suggestions g666.

Koen
26  Game Development / Newbie & Debugging Questions / Re: VBO problem with triangle strip on: 2006-08-11 20:09:36
I'm one step closer to the solution of my problem. I specified a STATIC DRAW buffer but this crashes with a lot of geometric data. When I specify a STREAM DRAW vbo buffer my application doesn't crash anymore, BUT

I get a lot of extra triangles in my application. A lot of vertices seem to connect back to index 0, which is really strange to say the least.
(say attached screenshot)

Without vbo's the same triangle strip is rendered correctly.

Anybody have any idea what could be the cause ? Huh
27  Games Center / Archived Projects / Re: SOAR Implementation demo (landscape rendering) on: 2006-08-11 17:14:01
Do you have any jogl jars in the jre/lib/ext directory of the current jre ? That might be the cause of the problem.
28  Games Center / Archived Projects / Re: SOAR Implementation demo (landscape rendering) on: 2006-08-11 16:02:25
to bahuman :  The soar algorithm is a continuous lod , this means the algorithm starts with 2 top level triangles, and starts refining (dividing)  those 2 top triangles. The algorithm generates a triangle strip.

For example in a 512x512 mesh there are 18 levels of details.

I didn't look into chunked lods that much but there are less levels of detail I think in a chunked lod and you do not stop at one individual triangle but for example the lowest level of detail could be a patch of 6by6 vertices.

Allee, next problem to solve is texturing , I think that is going to be an fps dropper. However I found a SOAR implementation with procedural textures that looks promising : http://web.interware.hu/bandi/ranger.html
29  Games Center / Archived Projects / Re: SOAR Implementation demo (landscape rendering) on: 2006-08-11 14:32:59
It doesn't require 1.6 , I forgot to change the jnlp file, should be ok now.

30  Games Center / Archived Projects / SOAR Implementation demo (landscape rendering) on: 2006-08-11 14:07:04
Hi,

This is an implementation of the SOAR algorithm (paper can be found at http://www-static.cc.gatech.edu/~lindstro/papers/visualization2001a/ )

The terrain is a terragen file of dimension 512x512.
View frustum culling is implemented.
No geomorphing yet so expect pops  Smiley

Movement :

arrow keys
page up / pagedown to move viewpoint up or down
mousewheel to tilt viewpoint.

I want to share the source code if people are interested, but I still have to clean up the code  Wink

Soar Java Webstart

Any feedback is appreciated.

Koen
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

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

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

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

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

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

BurntPizza (30 views)
2014-09-19 03:14:18

Dwinin (47 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
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!