Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
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]
1  Java Game APIs & Engines / JOGL Development / Shadow Map Stitching problem on: 2008-01-27 02:26:58
Hi.

I've been following this tutorial:

http://www.paulsprojects.net/tutorials/smt/smt.html

which is really good and clear, but I'm getting horrible stitching effects on my scene that I can't get rid of, even using

1  
2  
gl.glPolygonOffset (1f, 1f); 
gl.glEnable(GL.GL_POLYGON_OFFSET_FILL);


Here's a pic:
[img=http://img101.imageshack.us/img101/5247/picture6vm4.th.png]

My model has a high poly count (350,000) and lots of curves, don't know if that makes a difference? Quality seems optimal at 1024 tex size - with 2048 the stitching actually gets worse.

Any help would be gratefully received, if I find a solution, I'll post the code here.

Cheers.

Matt
2  Java Game APIs & Engines / JOGL Development / Re: Matrix math in JOGL on: 2008-01-27 02:15:25
Hi. No I'm not... just following this tutorial: http://www.paulsprojects.net/tutorials/smt/smt.html

Do you know any good resources for learning about FBO's and how to use with shadow maps, to boost performance? Are there any other shadowing techniques I should be looking at?

Cheers.

Matt
3  Java Game APIs & Engines / JOGL Development / Re: Matrix math in JOGL on: 2008-01-27 01:11:34
Ok, I figured it out myself through trial and error! Still got a lot of tidying up to do though in my code, I've pasted it below in case it helps anyone else. For some reason the shadow map has absolutely killed my framerate. I was getting >300fps with one light source and 350,000 polygons, now with shadows it's dropped to 70fps 1/5th!!

Is this normal??? Anyway the code snippet is below...
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  
{   int j=0,k=0;
         for(int i = 0; i < 16; i++) {
            bm.set(j,k,biasMatrix[i]);
            lpm.set(j,k,lightProjectionMatrix[i]);
            lvm.set(j,k,lightViewMatrix[i]);
            j++; if(j>3) j=0;
            if(j==0) k++;
      }   }
     
      tm = bm.mul(lpm.mul(lvm));
     
      //tm.getColumnMajorData(textureMatrix);
     
      {   int j=0,k=0;
         for(int i = 0; i < 16; i++) {
            textureMatrix[i] = tm.get(k,j);
            j++; if(j>3) j=0;
            if(j==0) k++;
      }   }
     
      //Set up texture coordinate generation.
     gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_EYE_LINEAR);
      gl.glTexGenfv(GL.GL_S, GL.GL_EYE_PLANE, textureMatrix, 0);
      gl.glEnable(GL.GL_TEXTURE_GEN_S);
   
      gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_EYE_LINEAR);
      gl.glTexGenfv(GL.GL_T, GL.GL_EYE_PLANE, textureMatrix, 4);
      gl.glEnable(GL.GL_TEXTURE_GEN_T);
   
      gl.glTexGeni(GL.GL_R, GL.GL_TEXTURE_GEN_MODE, GL.GL_EYE_LINEAR);
      gl.glTexGenfv(GL.GL_R, GL.GL_EYE_PLANE, textureMatrix, 8);
      gl.glEnable(GL.GL_TEXTURE_GEN_R);
   
      gl.glTexGeni(GL.GL_Q, GL.GL_TEXTURE_GEN_MODE, GL.GL_EYE_LINEAR);
      gl.glTexGenfv(GL.GL_Q, GL.GL_EYE_PLANE, textureMatrix, 12);
      gl.glEnable(GL.GL_TEXTURE_GEN_Q);
4  Java Game APIs & Engines / JOGL Development / Re: Matrix math in JOGL on: 2008-01-27 00:39:14
Thanks for the reply.

So, how then do I access each row of the matrix used in the code that follows? It's part of a shadow map... textureMatrix being the float[16] that I'm using.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
gl.glTexGeni(GL.GL_S, GL.GL_TEXTURE_GEN_MODE, GL.GL_EYE_LINEAR);
      gl.glTexGenfv(GL.GL_S, GL.GL_EYE_PLANE, textureMatrix, 0);
      gl.glEnable(GL.GL_TEXTURE_GEN_S);
   
      gl.glTexGeni(GL.GL_T, GL.GL_TEXTURE_GEN_MODE, GL.GL_EYE_LINEAR);
      gl.glTexGenfv(GL.GL_T, GL.GL_EYE_PLANE, textureMatrix, 4);
      gl.glEnable(GL.GL_TEXTURE_GEN_T);
   
      gl.glTexGeni(GL.GL_R, GL.GL_TEXTURE_GEN_MODE, GL.GL_EYE_LINEAR);
      gl.glTexGenfv(GL.GL_R, GL.GL_EYE_PLANE, textureMatrix, 8);
      gl.glEnable(GL.GL_TEXTURE_GEN_R);
   
      gl.glTexGeni(GL.GL_Q, GL.GL_TEXTURE_GEN_MODE, GL.GL_EYE_LINEAR);
      gl.glTexGenfv(GL.GL_Q, GL.GL_EYE_PLANE, textureMatrix, 12);
      gl.glEnable(GL.GL_TEXTURE_GEN_Q);
5  Java Game APIs & Engines / JOGL Development / Matrix math in JOGL on: 2008-01-26 19:45:17
Hi.

I've asked a similar question in a reply to a different thread but I thought I'd simplify...

How do I go about doing this:

1  
MATRIX4X4 textureMatrix=biasMatrix*lightProjectionMatrix*lightViewMatrix;


in JOGL using float[16] instead of MATRIX4x4 as listed in the C example above?

Thanks in advance to anyone who can help!
6  Java Game APIs & Engines / JOGL Development / Re: shadow mapping on: 2008-01-26 13:56:48
Hi.

I know I'm digging up an old thread here. I'm just trying to get this working myself here and I'm having trouble understanding how matrices work in jogl and how they're manipulated. I've used the gleem library to convert my float arrays to Mat4f to multiply them. Can anyone tell me if the following look correct?

tm, bm, lvm, lpm are Mat4f of transformMatrix, biasMatrix, lightViewMatrix and lightProjectionMatrix ( all float[16] )

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
//Calculate texture matrix for projection
     //This matrix takes us from eye space to the light's clip space
     //It is postmultiplied by the inverse of the current view matrix when specifying texgen
     int j=0,k=0;
      for(int i = 0; i < 16; i++) {
         bm.set(j,k,biasMatrix[i]);
         lpm.set(j,k,lightProjectionMatrix[i]);
         lvm.set(j,k,lightViewMatrix[i]);
         j++; if(j>3) j=0;
         if(j==0) k++;
      }
     
      tm = bm.mul(lpm.mul(lvm));  //equivalent to MATRIX4X4 textureMatrix=biasMatrix*lightProjectionMatrix*lightViewMatrix; ?


I've done a lot of googling and searching this forum... 

Basically, if anyone has any code they'd be willing to share to help me understand the matrix operations going on in the above tutorial, I would be very, very grateful!!

Thanks in advance...
7  Java Game APIs & Engines / JInput / 3dConnexion Space Navigator on Mac on: 2008-01-22 12:53:52
Hi.

I'm a student writing a VJ app in Java/JOGL and I'd like to be able to hook up a Space Navigator and do some cool things. I think I have jinput installed correctly and when I run:

1  
java net.java.games.input.test.ControllerTextTest



I get this:

1  
2  
Controller Env = net.java.games.input.DefaultControllerEnvironment@dd5b
Loading: net.java.games.input.OSXEnvironmentPlugin


And it lists all my peripherals including usb mouse and bluetooth keyboard but no Space Navigator.

Also not listed when running this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
java net.java.games.input.test.RumbleTest
Loading: net.java.games.input.OSXEnvironmentPlugin
Scanning Apple Internal Keyboard / Trackpad
Found 0 rumblers
Scanning Trackpad
Found 0 rumblers
Scanning Apple Internal Keyboard / Trackpad
Found 0 rumblers
Scanning matt’s keyboard
Found 0 rumblers
Scanning USB-PS/2 Optical Mouse
Found 0 rumblers


Also using net.java.games.input.test.ControllerReadTest, it seems to detect movement from the internal trackpad on my laptop and built in keyboard & bluetooth keyboard, but doesnt detect movement from my usb mouse.

Has anyone got this working on a Mac or can shed any light on this? Any help would be much appreciated.

Cheers.

Matt
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (48 views)
2014-04-15 18:08:23

BurntPizza (44 views)
2014-04-15 03:46:01

UprightPath (60 views)
2014-04-14 17:39:50

UprightPath (42 views)
2014-04-14 17:35:47

Porlus (58 views)
2014-04-14 15:48:38

tom_mai78101 (81 views)
2014-04-10 04:04:31

BurntPizza (140 views)
2014-04-08 23:06:04

tom_mai78101 (240 views)
2014-04-05 13:34:39

trollwarrior1 (200 views)
2014-04-04 12:06:45

CJLetsGame (207 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!