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

27. May 2012, 12:25:43 am
Xith3D CommunityGeneral CategoryFeature Requests & Brilliant Ideas (Moderators: Marvin Fröhlich, 'n ddrylliog)Terrain Textures
Pages: [1]
Print
Author Topic: Terrain Textures  (Read 2512 times)
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« on: 04. September 2007, 03:46:09 pm »

Cylab, is there a way to implement/add a repeating texture over a TerrainSurface or ChunkedTerrain?  I would like to put a rock or dirt-looking texture over the terrain surface, to make it look more realistic.  Also, maybe support for different blending modes, etc.?
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #1 on: 05. September 2007, 07:51:37 am »

The texture-lod code is not ready, but what you are asking for should be already possible using normal xith (multi-)texturing support. I will try to add this to the TerrainTest5 tomorrow if I find time or at the weekend. If you have your source in a versioning system (svn/cvs) and are willing to give me access, we could also directly implement it in your code.
Logged

kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #2 on: 05. September 2007, 01:56:23 pm »

If you have your source in a versioning system (svn/cvs) and are willing to give me access, we could also directly implement it in your code.

No, sorry, I am not using any versioning system.

But BTW, are versioning systems compatible with non-open-source code?

Thanks about the textures thing.
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 #3 on: 05. September 2007, 04:48:26 pm »

But BTW, are versioning systems compatible with non-open-source code?

Of course. Versioning Systems are independent of the source code or even the general content being stored in it. Though you cannot (or shouldn't) commit anything to an (e.g.) sourceforge project, if you don't want to opensource it.

Marvin
Logged
kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #4 on: 05. September 2007, 06:13:09 pm »

Yeah, that's why I don't use CVS/SVN - my MMORPG is not open source (or at least, it's not supposed to be, but with all the hackers these days... Angry);
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #5 on: 09. September 2007, 09:46:39 pm »

Please update your Xith-tk source and take a look into TerrainTest5. I added a GridShader implementation to show the use of detail textures:

Code:
    /**
     * Constructs a GridShader with detail texture support.
     * 
     * @param colorTexture the name/path of the main color texture for the grid.
     * @param detailTexture the name/path of the repeating detail texture.
     * @param detailRepeat the amount of repetitions (per side) of the detail texture
     * @param blendMode the blend mode of the detail texture (see TextureAttributes)
     */
    public DetailTextureSurface(String colorTexture, String detailTexture, float detailRepeat, int blendMode)


Enjoy Smiley
Logged

kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #6 on: 09. September 2007, 10:20:06 pm »

Should line 148 of TerrainTest5 be:

Code:
surface= new DetailTextureSurface("terrain-splat.png", "rock_details.png", 4, TextureAttributes.BLEND);

Or is it just me.  I get the "black and white alternating thing" when I try the original line.

Great work though. Thanks Smiley
« Last Edit: 09. September 2007, 10:29:44 pm by kukanani » Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #7 on: 10. September 2007, 07:57:12 am »

Hmm, worked for me. The textures are loaded using the TextureLoader, so maybe your classpath settings differ from mine. Does it work for you with the altered line?
Logged

kukanani
Fierce Warrior
****
Offline Offline

Posts: 504


My game is coming along fairly smoothly...


View Profile WWW
« Reply #8 on: 10. September 2007, 03:28:14 pm »

Yeah, but that's fine.  Whatever works for you  Smiley.  I'll just change the line and use my own private version.
Logged

xith.setCoolnessLevel(10);
jMe.setCoolnessLevel(0);
xith.rock();
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #9 on: 10. September 2007, 03:39:59 pm »

Fine. As you might have noticed by looking into the DetailTextureSurface.java, the implementation is quite simple. Feel free to copy the code and roll your own surface. Maybe by using more texture units and providing different Appearances for different regions of your terrain. Only the detail parameter will always be 0, since texture lod is not implemented yet.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic