Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

26. May 2012, 11:56:27 pm
Xith3D CommunityXith3D InternalsDeveloper discussion (Moderators: Marvin Fröhlich, 'n ddrylliog)Bumpmapping
Pages: 1 2 [3]
Print
Author Topic: Bumpmapping  (Read 5148 times)
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #30 on: 22. December 2007, 12:20:42 am »

No, it isn't impossible. I didn't work on that topic anymore. I will try to get my handy on it during the christmas days. I will convert the bumpmapping code to use vertex-attributes instead of the second texture unit's texture coordinates. Then the geometry isn't forced to have 3-dim-texture-coords anymore.

The current code would require you to replace the existing 2-dim-texture-coordinates by 3-dim ones (where the third coord is 0). But I guess, you can wait until I converted the code Wink.

Marvin
Logged
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #31 on: 22. December 2007, 03:48:56 pm »

That's fine.  Thanks  Smiley.
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #32 on: 26. December 2007, 06:52:29 pm »

It is possible now. Though I haven't managed to get the GLSL bumpmapping to work, the old Assembly shaders do work. And since we now have support for different texture-coodinates sizes on the same geometry, we can use the current bump-mapping factory.

You just have to call the shape.setBumpMappingEnabled( true, bumpMapTex ) method, and everything should be done automatically.

Marvin
Logged
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #33 on: 26. December 2007, 08:05:42 pm »

Thank you!  Cheesy
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
Mancer
Enjoying the stay
*
Offline Offline

Posts: 68


View Profile
« Reply #34 on: 27. December 2007, 09:24:36 am »

I just have tested your new changes on the BumpMappingTest: that's great !

But i have two remarks :

- The test BumpMappingTest2 is broken because some ressources missing:
Code:
java.io.FileNotFoundException: \space\workspace\xith-tk\test-resources\shader\shader.bump.vertex.glsl (Le chemin d'accès spécifié est introuvable)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
at java.net.URL.openStream(URL.java:1009)
at org.xith3d.loaders.shaders.impl.glsl.GLSLShaderLoader.loadShader(GLSLShaderLoader.java:136)
at org.xith3d.loaders.shaders.impl.glsl.GLSLShaderLoader.loadVertexShader(GLSLShaderLoader.java:201)
at org.xith3d.effects.GLSLBumpMappingFactory.getVertexProgram(GLSLBumpMappingFactory.java:75)



- When i add an HUD, and if bumpmapping is enabled there's some strange HUD rendering results.
For example i have just added an HUD with one button, and one image on the test "BumpMappingTest" with this :
Code:
    private HUD createHUD(Canvas3D canvas, OperationScheduler opSched){
HUD hud = new HUD(canvas, opSched);

hud.addWidget(new Button(100f, 25f, "test"),10f,10f );
hud.addWidgetCentered(new Image(100f, 100f, "lena.dds"));
return hud;
    }
and this
Code:
        env.addHUD(createHUD(canvas, this.getOperationScheduler()), this.getInputManager());
And, depending on the light position, the HUD widgets are lighted or not.
But if the bumpmapping is disabled like this
Code:
torus.setBumpMappingEnabled( false, "normalmap.bmp" );
the widgets are OK

Sorry to be so annoying with all my bugs, i'm just learning how Xith works  Grin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #35 on: 27. December 2007, 12:43:00 pm »

- The test BumpMappingTest2 is broken because some ressources missing:
Code:
java.io.FileNotFoundException: \space\workspace\xith-tk\test-resources\shader\shader.bump.vertex.glsl (Le chemin d'accès spécifié est introuvable)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
at java.net.URL.openStream(URL.java:1009)
at org.xith3d.loaders.shaders.impl.glsl.GLSLShaderLoader.loadShader(GLSLShaderLoader.java:136)
at org.xith3d.loaders.shaders.impl.glsl.GLSLShaderLoader.loadVertexShader(GLSLShaderLoader.java:201)
at org.xith3d.effects.GLSLBumpMappingFactory.getVertexProgram(GLSLBumpMappingFactory.java:75)

Well, the BumpMappingTest2 is my personal testcase to work on GLSL bump mapping. So I didn't link to the jared shader files, but absolutely on my filesystem. When the test is working I will put the shader files back into the jar and this problem will be gone.

- When i add an HUD, and if bumpmapping is enabled there's some strange HUD rendering results.
For example i have just added an HUD with one button, and one image on the test "BumpMappingTest" with this :
Code:
    private HUD createHUD(Canvas3D canvas, OperationScheduler opSched){
HUD hud = new HUD(canvas, opSched);

hud.addWidget(new Button(100f, 25f, "test"),10f,10f );
hud.addWidgetCentered(new Image(100f, 100f, "lena.dds"));
return hud;
    }
and this
Code:
        env.addHUD(createHUD(canvas, this.getOperationScheduler()), this.getInputManager());
And, depending on the light position, the HUD widgets are lighted or not.
But if the bumpmapping is disabled like this
Code:
torus.setBumpMappingEnabled( false, "normalmap.bmp" );
the widgets are OK

Good to know. I will check that.

Sorry to be so annoying with all my bugs, i'm just learning how Xith works  Grin

You're not annoying. Actually I love good feedback.

Marvin
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #36 on: 27. December 2007, 07:29:02 pm »

I have finished the GLSLBumpMappingFactory, which is now used by default. It works and looks just great. Check it out...

Marvin
Logged
Mancer
Enjoying the stay
*
Offline Offline

Posts: 68


View Profile
« Reply #37 on: 27. December 2007, 08:03:41 pm »

Very nice rendering and job.
Moreover you resolved the HUD problem in the same time..

You're the bumpmaps's king, Marvin  Cool

Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #38 on: 27. December 2007, 09:59:18 pm »

Very nice rendering and job.
Moreover you resolved the HUD problem in the same time..

No, that bug wasn't solved. It just didn't appear, since the AssemblyShaders weren't used. Now it is fixed Wink.

You're the bumpmaps's king, Marvin  Cool

Grin

Marvin
Logged
Pages: 1 2 [3]
Print
Jump to:  

Theme orange-lt created by panic