Paging Landscape v2 - Comments / Questions / Suggestions
- tuan kuranes
- OGRE Retired Moderator
- Posts: 2653
- Joined: Wed Sep 24, 2003 8:07 am
- Location: Haute Garonne, France
- x 4
- Contact:
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
- tuan kuranes
- OGRE Retired Moderator
- Posts: 2653
- Joined: Wed Sep 24, 2003 8:07 am
- Location: Haute Garonne, France
- x 4
- Contact:
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
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 )?
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 )?
-
- Greenskin
- Posts: 131
- Joined: Sun Dec 05, 2004 11:57 am
- Location: Germany, Greifswald
- Contact:
I'm experimenting with this approach in another thread. Check here:Troglodit wrote:Thanks !
In this game terrain maked (I think) by means of square tiles.
It can be I incomprehensible express oneself (sorry ), I will make attempt explain.
(...)
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
http://www.ogre3d.org/phpBB2/viewtopic.php?p=48804
- tuan kuranes
- OGRE Retired Moderator
- Posts: 2653
- Joined: Wed Sep 24, 2003 8:07 am
- Location: Haute Garonne, France
- x 4
- Contact:
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
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.)
Give us a screenshot, to see if we should add this technique into the Code.
@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
yep, seems a good idea.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 )?
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 ;
}
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
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.
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.
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
//EDIT:
Here is the material file.
BTW:
For me the code looks good:sDescription: 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.
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
}
}
}
}
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.how many detail texture ?
Last edited by Crashy on Thu Dec 16, 2004 11:22 pm, edited 4 times in total.
- spoke
- Greenskin
- Posts: 121
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Spain
- Contact:
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.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
Hope I manage to do it right.
May the force be with you.
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
-
- Gnoblar
- Posts: 5
- Joined: Fri Dec 10, 2004 1:07 pm
For me doing a "make install" failed with the mapsplitter. There is this rule in src/Makefile.am:
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:
This could be a automake-1.7 thing, older versions maybe do according to the original rule.
Code: Select all
install-exec-local:
$(INSTALL_PROGRAM) .libs/MapSplitter $(top_builddir)/...
Code: Select all
install-exec-local:
$(INSTALL_PROGRAM) MapSplitter $(top_builddir)/...
- tuan kuranes
- OGRE Retired Moderator
- Posts: 2653
- Joined: Wed Sep 24, 2003 8:07 am
- Location: Haute Garonne, France
- x 4
- Contact:
- tuan kuranes
- OGRE Retired Moderator
- Posts: 2653
- Joined: Wed Sep 24, 2003 8:07 am
- Location: Haute Garonne, France
- x 4
- Contact:
-
- Halfling
- Posts: 97
- Joined: Wed Aug 25, 2004 8:14 am
- Location: Germany
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
Ok it launchs, but the result is horrible for the moment:
http://crashy.cartman.free.fr/pouet/Antharia_1.jpg
http://crashy.cartman.free.fr/pouet/Antharia_1.jpg
- tuan kuranes
- OGRE Retired Moderator
- Posts: 2653
- Joined: Wed Sep 24, 2003 8:07 am
- Location: Haute Garonne, France
- x 4
- Contact:
@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
@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 ;
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
Ok, some pics:
here some eye candy :p
http://crashy.cartman.free.fr/video/Antharia_1.jpg
And here the statement:
Grass detail:
Rock detail:
Snow detail:
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
At the moment, ther is pixellisation when looking veeeeeeeery near to the terrain.
here some eye candy :p
http://crashy.cartman.free.fr/video/Antharia_1.jpg
And here the statement:
Grass detail:
Rock detail:
Snow detail:
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.
- SpannerMan
- Gold Sponsor
- Posts: 446
- Joined: Fri May 02, 2003 10:05 am
- Location: UK
- Contact:
-
- Google Summer of Code Student
- Posts: 1005
- Joined: Wed Jan 08, 2003 9:15 pm
- Location: Lyon, France
- x 49
- Contact:
-
- Gnoblar
- Posts: 9
- Joined: Fri Oct 15, 2004 12:43 pm
- Location: Bremen, Germany
Build process fails on Linux when building the pc files
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
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