Paging Landscape v2 - Comments / Questions / Suggestions

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Locked
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

@Crashy : fixed in cvs. mappsplitter generates raw now only for the heightmap, unless you specify LandScapeExportExtension=raw.

@Madlion : link problem with listener is fixed in cvs.

Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 997
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
x 48
Contact:

Post by Crashy »

Thanks :)
Do you want I submit the changes I made for the landscape texture loading?
Follow la Moustache on Twitter or on Facebook
Image

User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

Yes, thanks !

I'm also very interested in updated *.dsp and any modification needed to make vc6 to compile, if any.

Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 997
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
x 48
Contact:

Post by Crashy »

I'll try it, but I'm unable to test if the dsp will work in aplication(I've updated to VS 2003), or I'll must make a separate compilation of OGRE for VC6. For the moment, I don't think hte dsp projects are out of date, only the code could be incompatible.

Here are the change I made to the plugin:
-added "String ImageFormat;" in PagingLandScapeOptions.H

-added "ImageFormat = config.getSetting( "ImageFormat" );" in the PaginLandScapeOptions.cpp (load function of course).

and finally, changed this line
"const String texname = PagingLandScapeOptions::getSingleton().image_filename + "." +
commonName + "." + PagingLandScapeOptions::getSingleton().ImageFormat; "

in PagingLandscapeTexture_Image.cpp.
Of course you must add an ImageFormat parameter in the .cfg file.

(yes, not very hard to do, that's why I succeed).

There is any point that I'm interested about.
Is it theorically possible to improve the Image technique, using a slope splatting for the detail texture? I think it is just use the splatting texture as a second pass in the Image Texture material.

What splatting thechnique is the most adapted to do such a thing(understand slope variation,not only height )?
Follow la Moustache on Twitter or on Facebook
Image

Filopher
Greenskin
Posts: 131
Joined: Sun Dec 05, 2004 11:57 am
Location: Germany, Greifswald
Contact:

Post by Filopher »

Troglodit wrote:Thanks !
In this game terrain maked (I think) by means of square tiles.
It can be I incomprehensible express oneself (sorry :oops: ), I will make attempt explain.

Image

(...)
You can to object me, that (14 * (amount of pair of soils which transition is possible between)) is too much. Maybe.
Another way. It is needed to form every tile from two maps, the overhead from which will have transparency similar [2]

Is it possible to realize it (First way/second way) ? This would be great
I'm experimenting with this approach in another thread. Check here:

http://www.ogre3d.org/phpBB2/viewtopic.php?p=48804

User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

Anyone using VC6 out there ?

@Crashy, finally used "TextureImageFormat" over "ImageFormat" in order to avoid confusion.

Btw new cvs fixes :

- TextureImageFormat added in plsm2 and mappsplitter. (Crashy)
- normals was false on scaling
- fix persistence bug
- fix deformation bug when deforming a 4 page intersection
Is it theorically possible to improve the Image technique, using a slope splatting for the detail texture? I think it is just use the splatting texture as a second pass in the Image Texture material. What splatting thechnique is the most adapted to do such a thing(understand slope variation,not only height )?
yep, seems a good idea.
Do you have some detail texture depending on slope ? or some example to look at ? What do you have in mind ? how many detail texture ?

It will generates as many techniques as color/texture splatting has... shaders / multitexture / multipass...

it's easy to implement...

Here is a cg shader that you can use as NormalSplat.cg in a modified splatting5.material (where texture0 is your image, texture 1 is detail no-slope and texture2 is detail-slope.)

Code: Select all

// Vertex program for automatic terrain texture generation
void main_vp
(
    float4             iPosition           : POSITION,
	float4             iNormal             : NORMAL,
	float2             iTexcoord           : TEXCOORD0,

	out float4         oPosition           : POSITION,
	out float4         oTexcoord           : TEXCOORD0,
	out float4         oCoverage           : TEXCOORD1,
	out float4         oScaled             : TEXCOORD2,
	//out float4         oFog              : TEXCOORD3,

	uniform float4x4   worldViewProj,

	uniform float4     configSettings,
	uniform float4     fogSettings,
	uniform float4     fogColour
)
{
    
oCoverage.x = clamp (iNormal.y, 0.0, 1.0);
oCoverage.y = clamp (1.0 - iNormal.y, 0.0, 1.0);

// Calculate the output position and texture coordinates
oPosition  = mul(worldViewProj,iPosition);
oTexcoord = float4(iTexcoord.x, iTexcoord.y, 0.0, 0.0);
oScaled = oTexcoord * 20.0f;
}

// Fragment program for automatic terrain texture generation
void main_fp
(
    float4              iTexcoord	: TEXCOORD0,
    float4              iCoverage	: TEXCOORD1,
    float4              iScaled	    : TEXCOORD2,

	out float4          oColor		: COLOR,

    uniform sampler2D   textureUnit0,
    uniform sampler2D   textureUnit1,
    uniform sampler2D   textureUnit2,
    uniform sampler2D   textureUnit3
)
{
oColor = tex2D(textureUnit0, iTexcoord.xy) + tex2D(textureUnit1, iScaled.xy) * iCoverage.x) + tex2D(textureUnit1, iScaled.xy) * iCoverage.y ;

}
Give us a screenshot, to see if we should add this technique into the Code.

Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 997
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
x 48
Contact:

Post by Crashy »

What I really have in mind is to use different detail texture for grass/rock/snow, etc. I want to use it with slope in order to have details textures that are corresponding to the texture below, wich is generated under terragen(or terrain texture utils).
I see two advantages:
-better rendering when near to terrain.
-possibility to use little (1024², and not 4096²)colormaps but without quality degradation(because with this technique, the colormap has only to give a color, and no more to give much details)->take less time to generate the texture

I'll immediatly try your shader, and give a screenshot as soon as possible.
Last edited by Crashy on Thu Dec 16, 2004 7:16 pm, edited 1 time in total.
Follow la Moustache on Twitter or on Facebook
Image

Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 997
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
x 48
Contact:

Post by Crashy »

//EDIT:
Description: Unable to compile Cg program normalsplatFP: CG ERROR : The compile returned an error.
(44) : error C0000: parse error, unexpected ')', expecting ';' or ',' at token ")"
(44) : error C0501: type name expected at token ")"
(44) : error C0000: parse error, unexpected ',' at token ","
(44) : error C0501: type name expected at token ","
(46) : error C1108: function "main_fp" has no statements
45 lines, 5 errors.
For me the code looks good:s

Here is the material file.

Code: Select all

vertex_program normalsplatVP cg
{
	source normalSplat.cg
	entry_point main_vp
	profiles ps_2_0 

}
fragment_program normalsplatFP cg
{
	source normalSplat.cg
	entry_point main_fp
	profiles ps_2_0

}


material PagingLandScape.0.0
{
	

	technique
	{
		
		pass
		{
			lighting off

			 //coverage
			fragment_program_ref normalsplatFP
			{
			}

			// coverage
			texture_unit
			{
				texture colourMapTG.0.0.png
			}
			texture_unit
			{
				texture landscape_detail.jpg
				scale 0.05 0.05
				tex_address_mode mirror
			}
			texture_unit
			{
				texture rock.jpg
				scale 0.05 0.05
				tex_address_mode mirror
			}
			texture_unit
			{
				texture grass.jpg
				scale 0.05 0.05
				tex_address_mode mirror
			}
		}
	}
	
}
BTW:
how many detail texture ?
One for rock, one for grass, one for snow could be sufficent, but why not more. The shader is not very difficult to modify in order to have more different details textue.
Last edited by Crashy on Thu Dec 16, 2004 11:22 pm, edited 4 times in total.
Follow la Moustache on Twitter or on Facebook
Image

User avatar
spoke
Greenskin
Posts: 121
Joined: Sun Oct 06, 2002 11:19 pm
Location: Spain
Contact:

Post by spoke »

Falagard wrote: I think the paging landscape scene manager is for whatever you want to use it for. Personally, I use the Image technique to do splatting ;-)
Yup, when I started coding v2, my main goal was to provide a framework to allow other people to plugin 2D data loaders and texture loader, so they have the freedom to feed the plugin what they need. :wink:

Hope I manage to do it right. :?
May the force be with you.

Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 997
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
x 48
Contact:

Post by Crashy »

Hope I manage to do it right
No doubt: the PGLSM is the best for great landscapes!
Follow la Moustache on Twitter or on Facebook
Image

barnabe42
Gnoblar
Posts: 10
Joined: Fri Nov 05, 2004 12:08 pm

Post by barnabe42 »

hi !!!

I got a trouble when changing my terrain ( EXTERIOR_CLOSE ) to PLSM2. The level of the PLSM terrain is much more high than the previous one.

there is a way to set the position of the map to correct it.

thxx

chakie
Gnoblar
Posts: 5
Joined: Fri Dec 10, 2004 1:07 pm

Post by chakie »

For me doing a "make install" failed with the mapsplitter. There is this rule in src/Makefile.am:

Code: Select all

install-exec-local:
        $(INSTALL_PROGRAM) .libs/MapSplitter $(top_builddir)/...
The ... is just the rest of the line. At least on my system the final binary wasn't created into .libs, but into the current directory, ie I changed the rule to be:

Code: Select all

install-exec-local:
        $(INSTALL_PROGRAM) MapSplitter $(top_builddir)/...
This could be a automake-1.7 thing, older versions maybe do according to the original rule.

User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

@Crashy : it's a ) in line 44 after iCoverage.x that you must remove.

@Spoke : It's indeed a perfect modularization, as there's
so much dataformats (7) and so much TextureFormats (11) that it's a problem to explain (and test) them all !

@Chakie : thanks for the report. I'll add your fix in CVS.

User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

@barnabe42 : in paginglandscape2.cfg there's "scale" parameters to adjust to your needs.

MadLion
Halfling
Posts: 97
Joined: Wed Aug 25, 2004 8:14 am
Location: Germany

Post by MadLion »

@tuan Just an update of my test... compiling is fine now. And i can run it. The only think is that i see no terrain. but i think that it is a problem auf my linux system, because of the bad ati linux driver support i have no running 3d. Currently i only have mesa. :(

Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 997
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
x 48
Contact:

Post by Crashy »

Ok it launchs, but the result is horrible for the moment:

http://crashy.cartman.free.fr/pouet/Antharia_1.jpg
Follow la Moustache on Twitter or on Facebook
Image

User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

@madlion : does demo_terrain from ogr works ?

@crashy :

- Don't forget to set vertexnormal=1 in plsm2.cfg

- you NEED the vertex program part to be declared in the material
(the vertex_program_ref normalsplatVP
{
...copy here from splattingmaterial5.
})
It's the VP that sets the blending factors.

- and Replace the oColor = tex2D... line by

Code: Select all

oColor = tex2D(textureUnit0, iTexcoord.xy) * tex2D(textureUnit1, iScaled.xy) * iCoverage.x + tex2D(textureUnit0, iTexcoord.xy) *tex2D(textureUnit1, iScaled.xy) * iCoverage.y ;

MadLion
Halfling
Posts: 97
Joined: Wed Aug 25, 2004 8:14 am
Location: Germany

Post by MadLion »

@tuan I think yes, but i have to check this.

Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 997
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
x 48
Contact:

Post by Crashy »

...copy here from splattingmaterial5.
There was no vertex Program par declared in my splatting 5( it was an old one :roll: ).

Rectified now, but I just show the first detail map, I'm looking in for some changes.
Notte: vertexNormal are set to yes.
Follow la Moustache on Twitter or on Facebook
Image

Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 997
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
x 48
Contact:

Post by Crashy »

Ok I'm beginning to have a good render, using a modified version of the splatting 5 shader.
?Some pics this evening?
Follow la Moustache on Twitter or on Facebook
Image

Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 997
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
x 48
Contact:

Post by Crashy »

Ok, some pics:
here some eye candy :p
http://crashy.cartman.free.fr/video/Antharia_1.jpg

And here the statement:
Grass detail:
Image
Rock detail:
Image
Snow detail:
Image
As you can see(or maybe not), it is based only on height, and not on slope, but I'll do so.(using this code Kuranes has given
oCoverage.x = clamp (iNormal.y, 0.0, 1.0);
oCoverage.y = clamp (1.0 - iNormal.y, 0.0, 1.0);
)


At the moment, ther is pixellisation when looking veeeeeeeery near to the terrain.
Last edited by Crashy on Fri Dec 17, 2004 9:45 pm, edited 3 times in total.
Follow la Moustache on Twitter or on Facebook
Image

User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK
Contact:

Post by SpannerMan »

Very tasty looking scenes !

MadLion
Halfling
Posts: 97
Joined: Wed Aug 25, 2004 8:14 am
Location: Germany

Post by MadLion »

@Crashy Wow looks fantastic! ^^

@tuan Yes the ogre terrain demo is working. There is a screenshot of PLSM2 demo.

Crashy
Google Summer of Code Student
Google Summer of Code Student
Posts: 997
Joined: Wed Jan 08, 2003 9:15 pm
Location: Lyon, France
x 48
Contact:

Post by Crashy »

@MadLion: try to change position to 0,0,0, and , in the cfg file, to set the height to 1, maybe some pages are going to load themselves.
Follow la Moustache on Twitter or on Facebook
Image

jmm
Gnoblar
Posts: 9
Joined: Fri Oct 15, 2004 12:43 pm
Location: Bremen, Germany

Build process fails on Linux when building the pc files

Post by jmm »

I just tried to compile current CVS on Linux and it does not build completely:

make[3]: Leaving directory `/home/jmm/tarballs/ogreaddons/paginglandscape/Tools'
make[2]: Leaving directory `/home/jmm/tarballs/ogreaddons/paginglandscape/Tools'
make[2]: Entering directory `/home/jmm/tarballs/ogreaddons/paginglandscape'
make[2]: *** No rule to make target `Plugin_PagingLandScape2.pc', needed by `all-am'. Stop.
make[2]: Leaving directory `/home/jmm/tarballs/ogreaddons/paginglandscape'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/jmm/tarballs/ogreaddons/paginglandscape'
make: *** [all] Error 2

Locked