Terrain

Everything about development and the OpenMW source code.
Post Reply
User avatar
raevol
Posts: 3088
Joined: 07 Aug 2011, 01:12
Location: Caldera

Re: Terrain

Post by raevol » 02 Feb 2012, 23:00

We're cheering for you Yacoby!

Yacoby
Posts: 119
Joined: 30 Sep 2011, 09:42

Re: Terrain

Post by Yacoby » 04 Feb 2012, 13:13

Zini wrote:Got a random crash while walking around in the Seyda Neen area:
openmw: /home/marc/Tools/ogre-1-7-1/OgreMain/src/OgreRenderQueueSortingGrouping.cpp:386: void Ogre::QueuedRenderableCollection::addRenderable(Ogre::Pass*, Ogre::Renderable*): Assertion `retPair.second && "Error inserting new pass entry into PassGroupRenderableMap"' failed.
This happens when there is already something in the map with the same hash. I don't think it matters but as it gives an assertion in debug mode I will try and see what the problem is.

(The problem is documented in this thread: http://www.ogre3d.org/forums/viewtopic.php?f=5&t=68748)

Yacoby
Posts: 119
Joined: 30 Sep 2011, 09:42

Re: Terrain

Post by Yacoby » 06 Feb 2012, 18:55

Yacoby wrote:
Zini wrote:Got a random crash while walking around in the Seyda Neen area:
openmw: /home/marc/Tools/ogre-1-7-1/OgreMain/src/OgreRenderQueueSortingGrouping.cpp:386: void Ogre::QueuedRenderableCollection::addRenderable(Ogre::Pass*, Ogre::Renderable*): Assertion `retPair.second && "Error inserting new pass entry into PassGroupRenderableMap"' failed.
This happens when there is already something in the map with the same hash. I don't think it matters but as it gives an assertion in debug mode I will try and see what the problem is.

(The problem is documented in this thread: http://www.ogre3d.org/forums/viewtopic.php?f=5&t=68748)
I am struggling to reproduce this bug using Ogre 1.8RC1 (Which is good). Hence this probably won't be fixed until the release of Ogre 1.8

User avatar
Greendogo
Posts: 1452
Joined: 26 Aug 2011, 02:04

Re: Terrain

Post by Greendogo » 17 Feb 2012, 15:28

Yacoby, there was an answer to your question at the Terrain Paging Improvements thread over at the Ogre forums. FYI.
I'm posting this here because if anyone else would find that thread at all interesting besides Yacoby, here it is

Yacoby
Posts: 119
Joined: 30 Sep 2011, 09:42

Re: Terrain

Post by Yacoby » 18 Feb 2012, 12:46

Cheers. I was just musing on how to create infinite view distance (because sometimes lectures are that boring)

Sorry about the lack of progress in recent weeks. I busy trying to get coursework done. I can get some stuff done this week.

User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Terrain

Post by Zini » 18 Feb 2012, 12:52

No hurry. Since we won't be able to release the terrain without OGRE 1.8, it will take some time anyway.

User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Terrain

Post by scrawl » 26 Feb 2012, 13:43

I checked the terrain branch and this I've noticed the terrain material/shader has a lot of unnecessary clutter.

- normal mapping & parallax mapping (nothing in MW has that)
- specular mapping
- composite map

the first problem is that this slows down the performance and the second problem is that each layer needs 2.25 [1xdiffuseSpec, 1xnormalHeight, 0.25 blendmap) texture units (thats a max of 7 layers). If we remove the normalHeight one each layer would only need 1.25 texture units (thats 12 layers)

this means we have to make our own material generator for the terrain, the good thing is we can just derive it from TerrainMaterialGeneratorA and only change the methods that are different.

I will take that task after I'm finished with weather (hopefully today).

User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Terrain

Post by scrawl » 26 Feb 2012, 14:18

we also have to add the terrain as a bullet collision shape.

Yacoby
Posts: 119
Joined: 30 Sep 2011, 09:42

Re: Terrain

Post by Yacoby » 26 Feb 2012, 14:25

Why is composite map unnecessary? Seems like a sane way to take load off the GPU for more distant land. I think they are generated in another thread as well so are effectively free (or at least fairly cheap).

normal mapping, parallax mapping, specular mapping etc can be disabled (although for some I get black terrain if I disable normal mapping and parallax mapping, but not if only disable one of them?). I think this means that we can squeeze out closer to the max of 16.

I would be more interested in being able to support more passes. At present Material Generator A will just ignore layers that it can't support which is annoying.


Also, the issue with the terrain is that it doesn't support Vertex Colours, I am currently experimenting to see if I can generate them using a transparent mesh and RTT and overlay a texture (hacky I know). Any ideas if that would work? (I am just unsure about the transparent mesh, wondering if that would also make the vertex colours transparent?) Or any better ideas?

User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Terrain

Post by scrawl » 26 Feb 2012, 14:42

Yacoby wrote:Why is composite map unnecessary? Seems like a sane way to take load off the GPU for more distant land. I think they are generated in another thread as well so are effectively free (or at least fairly cheap).
I doubt there is a performance gain if the high-lod material doesn't have fancy effects. I don't know if its generated in a thread. If so, you are right that there is no reason to disable it.
normal mapping, parallax mapping, specular mapping etc can be disabled (although for some I get black terrain if I disable normal mapping and parallax mapping, but not if only disable one of them?).
That's not entirely true. You can disable them, but the default material generator will still add the texture units for them (thats why you get this black terrain)
I think this means that we can squeeze out closer to the max of 16.
not without modifying the generator.
Also, the issue with the terrain is that it doesn't support Vertex Colours, I am currently experimenting to see if I can generate them using a transparent mesh and RTT and overlay a texture (hacky I know). Any ideas if that would work? (I am just unsure about the transparent mesh, wondering if that would also make the vertex colours transparent?) Or any better ideas?
Overlaying a texture looks like the only way.

But if you already have an array of the vertex colours, I would rather just blit to the texture memory (which is way faster than a RTT)

Edit: Have a look at ogre sample for dynamic textures (Samples/DynTex/include/DynTex.h)

Post Reply