Simple Paged Terrain [v2.00 Released! Page 21]

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Buckcherry
Goblin
Posts: 279
Joined: Tue Oct 04, 2005 4:28 pm

Post by Buckcherry »

Hello everybody,

I am trying to compile SPT2 with Ogre 1.6 SDK and Visual Studio 2008 and I am getting a lot of errors.

One of them is:

Code: Select all

..\src\QNode.cpp(28) : error C2027: use of undefined type 'SPT::Terrain'
This is shown trying to compile the SPTv2 solution.

Any idea about this?
User avatar
calsmurf2904
Orc
Posts: 401
Joined: Tue Sep 16, 2008 9:39 pm
Location: Netherlands

Post by calsmurf2904 »

mmm...weird....I have Ogre 1.6 and Visual C++ 2008 with sp1 and I am able to successfully compile it.
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)
Image
Buckcherry
Goblin
Posts: 279
Joined: Tue Oct 04, 2005 4:28 pm

Post by Buckcherry »

Well, I found the problem.

I had defined "..\include" AFTER "$(OGRE_HOME)\include", so it was taking the Terrain.h from the Ogre folder rather than from the SPT include folder.

By the way, is it possible to change the texture of the terrain dinamically?
lvlnx
Gnoblar
Posts: 2
Joined: Tue Jun 24, 2008 8:16 am

yeah.....

Post by lvlnx »

Buckcherry wrote:Well, I found the problem.

I had defined "..\include" AFTER "$(OGRE_HOME)\include", so it was taking the Terrain.h from the Ogre folder rather than from the SPT include folder.

By the way, is it possible to change the texture of the terrain dinamically?

yeah like this:
"terrain->setMaterial("Material.003/TEXFACE/books.png");"

Where terrain is a pointer to a SPT::Terrain.

There is a problem with adding multiple heightmaps though, and that has been my biggest pain.
Seems the collision and buffers only work in the origin area. i'll try to word things better.
For instance if you move the Terrain scenenode, the manual object and everything visible will move.
But the collision and or brush will only work from the origin area.
If you moved your cursor to the begining top left position of the terrain position, the brush would show up
in the top left terrain position of the terrain where you moved the scenenode.
Hopefully i worded that correctly :D

cigiley at www.trinityreign.com
User avatar
eugen
OGRE Expert User
OGRE Expert User
Posts: 1422
Joined: Sat May 22, 2004 5:28 am
Location: Bucharest
x 8
Contact:

Re: yeah.....

Post by eugen »

lvlnx wrote:yeah like this:
"terrain->setMaterial("Material.003/TEXFACE/books.png");"
I'm afraid this isnt going to work, you will need to get the actual TextureUnitState of the texture you want to change and just call SetTextureName(newTextureName) on that unit state or using terrain->setSelectedTexture(newTextureName)
User avatar
buckED
Greenskin
Posts: 133
Joined: Fri Feb 15, 2008 9:51 pm

Post by buckED »

now the camera is always at 0,0,0 and the world moves with it and adjusts new tile geometry based on how far away from the center the camera has accumulated over time. This keeps that stupid vertex jittering from happening at huge distances.
I'm not sure I understand this correctly. How would one than move the camera letting the terrain stay in place?
Move the cam directly, leaving it's sceneNode where it is, or some other trick?

Thanks in advance

Ed.
Many of life's failures are people who did not realize how close they were to success when they gave up.

~ Thomas Edison ~
User avatar
m808
Gnoblar
Posts: 2
Joined: Sun Jan 04, 2009 6:50 am

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by m808 »

I tried to search the forum but didnt see any conclusion. Can someone confirm if this library can be integrated with ogrenewt?

Thanks
User avatar
aguru
Goblin
Posts: 236
Joined: Tue Feb 26, 2008 5:48 pm
x 3

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by aguru »

This library is dead, you would have to pick up the source code yourself and integrate on your own.
User avatar
m808
Gnoblar
Posts: 2
Joined: Sun Jan 04, 2009 6:50 am

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by m808 »

Well, that's not a very nice thing to hear. :cry:
Anyway, would you consider this as a stable library regardless of the discontinuation? :?:
Is there any reason someone would pick this instead of plsm2, for example?

Thanks for any help on this
Regards
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by jacmoe »

I would like to see this continue.
HexiDave made the mistake of trying to please everyone, and this turned the project into unfinished business.. :(

However, I do believe that you can take SPT version 1 and add the good stuff from SPT2.
Then you will probably have a great project.
It is in ogreaddons SVN.
Feel free. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
trnrez
Greenskin
Posts: 127
Joined: Mon Jan 19, 2009 5:34 pm
Location: Murfreesboro, TN
Contact:

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by trnrez »

Problem running SPT2 demo

I had no problem getting SPT2 and the demo compiled but when I run them the system is crashing any time Terrain::getDefaulMaterialScheme() is called when using D3D.

Code: Select all

Ogre::String Terrain::getDefaultMaterialScheme()
{
  if (mTerrainMaterial.isNull() == false)
  {
    if (mTerrainMaterial->getCompilationRequired())
      // It falls through and performs this when it gets called.
      mTerrainMaterial->compile();

    return mTerrainMaterial->getBestTechnique()->getSchemeName();
  }
  return "";
}
When using OpenGl it crashes inside of SPT::GPULightmapper::updateHeightmapBuffer() at line 273 :
img.resize(iTexWidth,iTexWidth);

I'm not sure what is going on here or why it is crashing but any assistance would be greatly appreciated. If more info is needed or if this should be placed within its on topic please let me know. Just seemed that most of the SPT2 discussion goes on in here.

Thanks,
Jonathan Jones

<edit> Added logs from D3D and OpenGL </edit>
Files Here
Image Image
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by HexiDave »

A lot of the OpenGL compatibility may be missing from the SVN copy, but I think you're at the spot where older graphics cards fail a test to use non-Power-of-Two textures and it resizes. However, due to some odd-ball issue, I think it just explodes. I had started adding ETM's light-mapper code (for CPU-side where GPU fails), but it got lost in a sea of project tests and ideas.

I will say this, though: SPT is going through an overhaul over the next months - and this time I'll have help. I won't say who or when, but it will get done even if SPT is just used as a starting point.

SPT2 was just like SPT1 - a good idea with good intentions, but a failure to get it all done. I had too many things I wanted to test at the same time I needed things done and it just collapsed. The final straw was my .NET editor not functioning at all on Linux (misread Mono's functionality there) and it was a real bummer. I'm working on a wxWidgets-based shader/material editor that will provide me functionality I need to make SPT properly user-friendly (testing materials was such a hassle!). We'll also get some real documentation going, along with a code clean-up.

I fully intend to make sure that if I can't work on the upgrades that the other party(s) will be able to. I'm getting a little sick of bringing a project to a good point and abandoning it because some stupid issue came up and ruined the work-load.
trnrez
Greenskin
Posts: 127
Joined: Mon Jan 19, 2009 5:34 pm
Location: Murfreesboro, TN
Contact:

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by trnrez »

HexiDave wrote:A lot of the OpenGL compatibility may be missing from the SVN copy, but I think you're at the spot where older graphics cards fail a test to use non-Power-of-Two textures and it resizes. However, due to some odd-ball issue, I think it just explodes. I had started adding ETM's light-mapper code (for CPU-side where GPU fails), but it got lost in a sea of project tests and ideas.
[SOLVED - this part]
I commented out the light stuff but I still hit an error inside of getDefualtMaterialScheme(). If I comment out the code making calls to this function the everthing loads up but the terrain is untextured. I haven't used materials before but from the log I think the issue is here:
16:17:06: Parsing script ScatteredOgre.material
16:17:06: Compiler error: unknown error in ScatteredOgre.material(1): base object named "BasicObject" not found in script definition
16:17:06: Parsing script SkySphere.material
16:17:06: Parsing script SPT2_Highlands.material
16:17:06: Compiler error: unknown error in SPT2_Highlands.material(1): base object named "SPT2_Low" not found in script definition

This fix is weird but http://www.ogre3d.org/forums/viewtopic. ... definition led me to the answer.
in SPT2_Highlands.material add "import * from "SPT2_Mat.material" and in ScatteredOgre.material add "import * from "BasicObject.material".

Anyone know how I can get those materials to load properly? or what the error means? Sorry for my lack of knowledge on this.
[/SOLVED]

[SOLVED - IEBKAC Turn the light on :oops: ]
The terrain is rendering with a pure black texture now. From the log it appears to be loading the proper images for the terrain. Any ideas on what that is?

Log:
16:54:00: WARNING: Texture instance 'SPT_Ext_Tex' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
16:54:00: Texture: Highlands_Coverage.jpg: Loading 1 faces(PF_R8G8B8,2048x2048x1) with 5 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,2048x2048x1.
16:54:00: Texture: Highlands_Splat.dds: Loading 1 faces(PF_DXT5,2048x2048x1) with 11 custom mipmaps from Image. Internal format is PF_DXT5,2048x2048x1.
16:54:00: Texture: herbe_3.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 5 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
16:54:00: Texture: herbe_5.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 5 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
16:54:00: Texture: sand_025.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 5 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
16:54:00: Texture: detail_splat1.png: Loading 1 faces(PF_R8G8B8,512x512x1) with 5 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
16:54:00: Texture: Detail3.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 5 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
16:54:00: WARNING: Texture instance 'SPT_Ext_Tex' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
[/SOLVED]

Thanks,
Jonathan Jones
Last edited by trnrez on Sat Jan 31, 2009 12:14 am, edited 1 time in total.
Image Image
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by HexiDave »

I'm guessing the new method of using base materials (using "import * from blah.material" at the top of material files) isn't on the SVN copy.

Edit: Heh, you got your edit in before my post.

Do you have the directional light pointing downwards in the scene? There's a lot of funky issues with the materials I created because I was trying so many shader tests out at the time.
trnrez
Greenskin
Posts: 127
Joined: Mon Jan 19, 2009 5:34 pm
Location: Murfreesboro, TN
Contact:

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by trnrez »

HexiDave wrote:I'm guessing the new method of using base materials (using "import * from blah.material" at the top of material files) isn't on the SVN copy.

Edit: Heh, you got your edit in before my post.

Do you have the directional light pointing downwards in the scene? There's a lot of funky issues with the materials I created because I was trying so many shader tests out at the time.
Ha yea I had the light commented out :oops:. The only way I can get it to run is under D3D with the light on but with it on the world texture is all sorts of messed up. When I move the texture does this weird splitting and swimming thing. Hard to explain so I attached a few images.

first image
second image

Oh and thanks for all this help! This is why I love the OGRE community.
Image Image
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by jacmoe »

I got that error too. :)
So I rolled my own terrain shader.
Interested in hearing what the problem is..
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by HexiDave »

Oh GOD. I don't even know with that one. Probably Cg trying to stuff textures where they don't belong (which was the reason I had made so many different shaders - couldn't figure out why things looked wrong, and it was just Cg trying to use the wrong textures).

To shed some light on what I was talking about earlier, I saw this in your log file: "Non-power-of-two textures: yes (limited)". There's certain restrictions in that case, but the card should have worked with that one (The shader didn't break those limitations).

I'm guessing that it's the same issue that made me stop working on SPT: too many things were impossible to separate without obscene amounts of effort, namely light-mapping and atmospheric scattering on the terrain. I couldn't find a reasonable method to switch them on and off inside the running engine without creating separate materials/shaders for each thing.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by sinbad »

HexiDave wrote:I couldn't find a reasonable method to switch them on and off inside the running engine without creating separate materials/shaders for each thing.
There's actually nothing wrong with doing that - in a commercial project I worked on we used code-level material generators and ubershaders which would build new variants of materials depending on the options selected. OgreSpeedTree does something very similar actually - so when you request that fog is enabled for example, it generates a new shader compiled with different options and wraps it in a new material - a simple hierarchical naming scheme means I can re-use that next time so switching back and forth is fast.
User avatar
HexiDave
OGRE Expert User
OGRE Expert User
Posts: 1538
Joined: Sat Jan 14, 2006 8:00 pm
x 1

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by HexiDave »

Ya, that's what ended up happening - I wrote some 600 line long terrain shader with a bunch of different options. The main issue was how things were finally attached to materials since doing any sort of low/medium/high settings would have completely locked the engine up that I was working with.
ender
Halfling
Posts: 99
Joined: Sat May 24, 2008 6:46 am

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by ender »

Hi all,

I've been reading a lot through this thread, haven't finished all 33 pages yet :(, and would like to know where this project is located. It looks as if it's been stopped, but I'm having such problems with other paged terrain systems, I'd like to give this a try on my linux box.

All I'm really looking for is almost endless terrain, or ... just as big as I can get at a minimum as opposed to my single plane that comes with the Ogre samples.

I was sorry to read that it got scratched due to the complexity, but ... if it works w/ 1.6+ and just gives me lots of paged tiles w/ a way to make heightmaps (even if it's manually done which I currently to w/ gimp), that'd be great.

Where is the source tree for this located?
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by jacmoe »

/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by dark_sylinc »

HexiDave wrote:Oh GOD. I don't even know with that one. Probably Cg trying to stuff textures where they don't belong (which was the reason I had made so many different shaders - couldn't figure out why things looked wrong, and it was just Cg trying to use the wrong textures).
Yeah I've had the same problem when I compiled SPT on my own.

Hexi: The shader on SVN is not up to date, and doesn't have fixes for PS 2.0 (SPT_Low is broken)
It's not just Cg using the wrong textures, you're using more textures and stuff that PS 2.0 allows, though Cg somehow manages to compile...
Using SPT_Medium with PS 3.0 works like a charm.

Until HexiDave checks in his most recent version, I suggest to stick with the PS 3.0 version (SPT_Medium)
User avatar
mikeInside
Kobold
Posts: 37
Joined: Thu Apr 26, 2007 5:46 pm
Location: Sydney, Australia
Contact:

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by mikeInside »

HexiDave wrote:I will say this, though: SPT is going through an overhaul over the next months - and this time I'll have help. I won't say who or when, but it will get done even if SPT is just used as a starting point.
I've been following this topic since '07, definitely looking forward to checking out whatever you come up with :)
User avatar
MaxWave
Halfling
Posts: 43
Joined: Fri Mar 10, 2006 6:17 pm

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by MaxWave »

Where i can to download binary and does sources avaible?
trnrez
Greenskin
Posts: 127
Joined: Mon Jan 19, 2009 5:34 pm
Location: Murfreesboro, TN
Contact:

Re: Simple Paged Terrain [v2.00 Released! Page 21]

Post by trnrez »

MaxWave wrote:Where i can to download binary and does sources avaible?
sources are in ogreaddons (as jacmoe said a few posts up :) ):
http://sourceforge.net/projects/ogreaddons
Image Image
Post Reply