Hex terrain editor [updated]

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Hex terrain editor [updated]

Post by elvman »

Finally I released my terrain/splatting editor. Here are some screenshots:
Image
Image
Features:
Terrain editing
Lightmap (with shadows) generation and filtering
Splatting
For now editor supports only 2 splatting overlays (because of limitations of Irrlicht).
Load save lightmap/splat map (heightmap saving does not work for now, but I will fix this) and save project into .xml file (later I will release the terrain scene node, which is able to load them).

Future plans:
Changing/editing brushes.
Changing the light direction
LOD
More splatting layers

Download: here
Development thread: here

Check it out and post your suggestions etc. here.
Last edited by elvman on Fri Sep 28, 2007 2:04 pm, edited 5 times in total.
mhack
Posts: 38
Joined: Sun Apr 01, 2007 2:13 am
Location: Montana, USA

Post by mhack »

Will you be releasing it with source code?
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

mhack wrote:Will you be releasing it with source code?
I will decide later if I will release the source of the editor, but I for sure will release the source of modified ShlTerrain scene node (you will be able to load Hex editor's output in your application with it). For now I just want to give Irrlicht developers a tool to generate good quality terrain for their game.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

That looks really pretty! Well done!
Image Image Image
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

Hey I modified the shaders so that it automatically produces rock texture on steep parts without doing any splatting. Here is an image showing this in action:

Image

This is what the new shaders look like:

HLSL PS:

Code: Select all

sampler2D coverage; //coverage
sampler2D lightmap; //lightmap

sampler2D splat1;
sampler2D splat2;

// Pixel shader output structure
struct PS_OUTPUT
{
    float4 Color : COLOR0;  // Pixel color    
};

struct PS_INPUT
{
	float4 Position : POSITION;
	float4 Diffuse  : COLOR0;
	
	float2 LightmapTexCoord : TEXCOORD1; //lightmap texture coords
	
	float2 SplatTexCoord1 : TEXCOORD2; //1st spalt texture coords
	float2 SplatTexCoord2 : TEXCOORD3; //2nd spalt texture coords
	float normalDist : TEXCOORD0;
};
	
PS_OUTPUT main( PS_INPUT Input ) 
{ 
	PS_OUTPUT Output;

		
	float4 TexColor = lerp(tex2D( splat2, Input.SplatTexCoord2),
					tex2D( splat1, Input.SplatTexCoord1),Input.normalDist);
	
	float4 LightmapColor = tex2D( lightmap, Input.LightmapTexCoord );  // lightmap

	Output.Color = Input.Diffuse * TexColor * LightmapColor;

	return Output;
}

HLSL VS:

Code: Select all

float4x4 mWorldViewProj;  // World * View * Projection transformation

// Vertex shader output structure
struct VS_OUTPUT
{
	float4 Position   : POSITION;   // vertex position 
	float4 Diffuse    : COLOR0;     // vertex diffuse color
	
	float2 LightmapTexCoord : TEXCOORD1; //lightmap texture coords
	
	float2 SplatTexCoord1 : TEXCOORD2; //1st spalt texture coords
	float2 SplatTexCoord2 : TEXCOORD3; //2nd spalt texture coords
	float normalDist : TEXCOORD0;
};

struct VS_INPUT
{
	float4 Position	: POSITION;
	float3 Normal		: NORMAL;
	float4 Diffuse		: COLOR0;
	float2 TexCoord0	: TEXCOORD0;
	float2 TexCoord1	: TEXCOORD1;
};


VS_OUTPUT main(VS_INPUT Input)
{
	VS_OUTPUT Output;

	// transform position to clip space 
	Output.Position = mul(Input.Position, mWorldViewProj);
	
	Output.Diffuse = Input.Diffuse;
	Output.LightmapTexCoord = Input.TexCoord1;
	
	Output.SplatTexCoord1 = Input.TexCoord0;
	Output.SplatTexCoord2 = Input.TexCoord0;
	
	Output.normalDist = Input.Normal.y;
	
	return Output;
}
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
monkeycracks
Posts: 1029
Joined: Thu Apr 06, 2006 12:45 am
Location: Tennesee, USA
Contact:

Post by monkeycracks »

If it's over the capabilities of my card will you make an option for it to be turned off xD
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

It shouldn't be over the capabilites. IIRC it didn't allow more than 4 texcoords so its probably even lower than PS 1.4. It'll run fine on your card MonkeyCracks...

BTW The thing I just made goes faster then the original splatting thing because it doesn't have to read from an additional texture to know how to splat it, it just tests the normal.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

I will leave it up to users' choice whether to use Shaders 1.1 (2 splatting layers) or Shaders 2.0 (6 splatting layers).
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi. I've tested it. It's great! Like a 3D painter for landscape.

This should be great for creating "trails"!
This is excellent. I just can't wait to see the next release of this editor!
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

I just finished the realistic water scene node (I use it for landscapes) and now I am working on the splatting terrain. I will release the next (hopefully full) version of Hex terrain editor when these scene nodes will be finished.
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

Nice editor. Your terrain is very smooth. And the texture splat looks good too. Great. :D
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

Finally released the next version of Hex editor with load/save options enabled. The heightmap saving/loading still does not work, but I will fix this in the next release.
First post updated.
SiriusCG
Posts: 58
Joined: Tue Feb 14, 2006 1:05 am

Post by SiriusCG »

Hey no offense but "Hex Editor"? A Hex editor is a used for modifying code such as this one:
http://www.chmaas.handshake.de/delphi/f ... /xvi32.htm

I came thinking someone had built a Hex Editor in Irrlicht code...
TheGameMaker
Posts: 275
Joined: Fri May 12, 2006 6:37 pm
Location: Germany

Post by TheGameMaker »

me 2^^ its looking cool though..
elvman
Posts: 253
Joined: Sun Sep 17, 2006 9:37 am
Location: Riga, Latvia
Contact:

Post by elvman »

Hey no offense but "Hex Editor"? A Hex editor is a used for modifying code such as this one:
There were many reasons why we chose the name "Project Hex" for our project an that's the reason why project's built-in level editor is named "Hex editor". But I agree that it can be confusing and changed the topic's title to "Hex terrain editor".
P.S. The editor I am presenting here is not a fully functional level editor, it is only a terrain editor (the real level editor is a little bit upgraded and has all needed features for our game).
Post Reply