Paging Landscape v2 : Help, User Thread

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
tonyhnz
Greenskin
Posts: 101
Joined: Fri Feb 25, 2005 3:54 am
Location: Florida

Post by tonyhnz »

tuan kuranes wrote: Now you can submit Vertex and Index buffer to you collision/physic engine.
(and yes, pages and tiles are overlapping.)
I have got it working - here are necessary PagingLandScapeRenderable changes ...

Code: Select all

_OgrePagingLandScapeExport const uint PagingLandScapeRenderable::getVertexCount()
	{
		return  mOpt->TileSize * mOpt->TileSize  ;
	}

_OgrePagingLandScapeExport void PagingLandScapeRenderable::getRawVertexData(Vector3* pVerts)
	{
		// pVerts should be pre-allocated to tilesize*tilesize
		// using getVertexCount()
		const uint tilesize = mOpt->TileSize ;

		Vector3 *vert = pVerts;
		for (uint i=0; i<tilesize; ++i)
			for (uint j=0; j<tilesize; ++j)
				*vert++ =  _getvertex(i, j); 
	}
  

_OgrePagingLandScapeExport IndexData* PagingLandScapeRenderable::getRawIndexData(const int renderlevel)
	{
		return PagingLandScapeIndexBuffer::getSingleton().getRawIndexes( renderlevel);
	}

Vector3 PagingLandScapeRenderable::_getvertex(const int x, const int z) const
	{
		const uint tilesize = mOpt->TileSize - 1;
		Vector3 vertex;
			
		vertex.x = ((mInfo->tileX *  tilesize) + x )* mOpt->scale.x;
		vertex.y =  mHeightfield[((mInfo->tileX * tilesize) +  x) +
					((mInfo->tileZ * tilesize) +  z) * mOpt->PageSize ];
		vertex.z =  ((mInfo->tileZ * tilesize) +  z)* mOpt->scale.z;

		return vertex;
	} 
And PagingLandScapeIndexBuffer changes ..

Code: Select all

IndexData *PagingLandScapeIndexBuffer::getRawIndexes(int renderLevel)
{
    // no stitching is done
	// used to expose terrain vertex data

	if (renderLevel >= static_cast <int> (mNumIndexes))
		renderLevel = static_cast <int> (mNumIndexes)-1;

	if (renderLevel < 0)
		renderLevel =0 ;

	const uint stitchFlags = 0;

	assert (mLevelIndex.size() > (uint)renderLevel);

	IndexMap::iterator ii = mLevelIndex[ renderLevel ]->find( stitchFlags );
	if ( ii == mLevelIndex[ renderLevel ]->end())
	{
		// Create
		IndexData* indexData = generateTriListIndexes(	false,
											false,
											false,
											false,
											renderLevel,
											0);
		mLevelIndex[ renderLevel ]->insert(
			IndexMap::value_type(stitchFlags, indexData));
		
		return indexData;
	}
	else
	{
		return  ii->second;
	}
} 
Thanks for all your assistance with this.
tonyhnz
Greenskin
Posts: 101
Joined: Fri Feb 25, 2005 3:54 am
Location: Florida

Post by tonyhnz »

Image showing the collision debug lines.

Image
fishmates
Gnoblar
Posts: 8
Joined: Mon Jul 11, 2005 4:52 pm

Post by fishmates »

* Ogre::PagingLandScapeData2D_HeightField
* Ogre::PagingLandScapeData2D_HeightFieldBlendNeighbor
* Ogre::PagingLandScapeData2D_HeightFieldN
* Ogre::PagingLandScapeData2D_HeightFieldNTC
* Ogre::PagingLandScapeData2D_HeightFieldRaw
* Ogre::PagingLandScapeData2D_HeightFieldRawTC
* Ogre::PagingLandScapeData2D_HeightFieldTC
* Ogre::PagingLandScapeData2D_Spline

@tuan kuranes: I didn't find any helpful documents about the classes above. Can you tell me the specific meanings of each class? What are the differences among them? How should I use them?
Thanks a lot!
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

Post by tuan kuranes »

added a Wiki section called Data Source Loading Modes
SiX
Gnoblar
Posts: 13
Joined: Sat Jan 24, 2004 1:04 am

PLSM2 and Shadows

Post by SiX »

Hi all,

I've searched the forum and looked in the wikki but I didn't find an answer to the following problem:
I'm using PLSM2 and shadows in my scene. I get different results depending which shadow type I use in the scene. Take a look at the following screenshots:

Scene with SHADOWTYPE_STENCIL_MODULATIVE -
Looks fine:
http://www.lucidworks.net/screenshot_1.jpg

Scene with SHADOWTYPE_STENCIL_ADDITIVE -
Terrain turns black:
http://www.lucidworks.net/screenshot_2.jpg

Scene with SHADOWTYPE_TEXTURE_MODULATIVE -
Compared to the previous shots taken from the same position,
parts of the horizon are missing:
http://www.lucidworks.net/screenshot_3.jpg

Moving around the scene lets you see the chunks of missing terrain better:
http://www.lucidworks.net/screenshot_4.jpg
http://www.lucidworks.net/screenshot_5.jpg

Is there any way to use texture shadows without half the terrain going missing? :)
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

Post by tuan kuranes »

Could depend on the Texture Mode used, and vertex compression.

All shader based Texture Mode surely doesn't take shadows in account.
We should follow Ogre manual to add missing paramters to shadow (we're supposed to reserve some texcoord I believe.)
SiX
Gnoblar
Posts: 13
Joined: Sat Jan 24, 2004 1:04 am

Post by SiX »

Could depend on the Texture Mode used, and vertex compression.

All shader based Texture Mode surely doesn't take shadows in account.
We should follow Ogre manual to add missing paramters to shadow
(we're supposed to reserve some texcoord I believe.)
I'm using splatting2, vertex compression off.

What missing parameters?
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

Post by tuan kuranes »

No lod Morphing ?
anything that implies vertex shader as explained in this page of the Ogre manual (scroll at the end.)
Last edited by tuan kuranes on Sat Aug 20, 2005 1:28 pm, edited 1 time in total.
edwynn
Kobold
Posts: 39
Joined: Tue Aug 09, 2005 3:09 am

Need all the correct paths

Post by edwynn »

HEY!

can someone post a complete directory listing of which media files are supposed to be in which directory/sub-directory??

the problem is that everything encapsulated in the script file, and the script file DOES NOT tell me exactly which media file is for which sub-directory.

right now, i got a blue sky and white plane when running PLSM2 demo app.

thx!
SiX
Gnoblar
Posts: 13
Joined: Sat Jan 24, 2004 1:04 am

Post by SiX »

No lod Morphing ?
anything that implies vertex shader as explained in this page of the Ogre manual (scroll at the end.)
Not using lod morphing either...that link just takes me back to this post :)

Do I need to worry about texture shadows that much? I mean, are stencil shadows widely supported these days?
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

Post by tuan kuranes »

@SiX : sorry. link corrected. But may come from somewhere else if no shader involved. Does Image texturemode give you same results ?
If stencil shadow is more cpu intensive so if your game isn't too cpu intensive, it's a good choice.

@edwynn: which script ? did you get the example data as listed in the WIKI page devoted to plsm2 ?
edwynn
Kobold
Posts: 39
Joined: Tue Aug 09, 2005 3:09 am

Post by edwynn »

are u referring to the binary demo?

It doesnt run! It complains of 4 missing folders. Create those folders, then put wat inside?

How would i know what and which, cfg or material file is supposed to be in which sub-directory?

Right now all i see is a blue sky if i just run the binary demo.
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

Post by tuan kuranes »

nope, it's a separate download, look again there for the 4 maps data source download.
edwynn
Kobold
Posts: 39
Joined: Tue Aug 09, 2005 3:09 am

Post by edwynn »

ok i got the 4 maps data put into the datasrc subdirectory. But i am still seeing a blue sky screen. Whats going on? what abt the rest of the paths?
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

Post by tuan kuranes »

got to run mapsplitter now, as pointed by wiki howto
edwynn
Kobold
Posts: 39
Joined: Tue Aug 09, 2005 3:09 am

Post by edwynn »

ok great now i get to see something at last but only under OpenGL. D3D9 gave a crash immediately. how do i resolve this?
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

Post by tuan kuranes »

Debug the crash, read ogre.log, etc, to find where it happens?
BlooDragoN
Kobold
Posts: 37
Joined: Wed Dec 22, 2004 7:57 pm

Post by BlooDragoN »

Hi,
I've succefully compiled PLSM2(plugin,mapsplitter and demo) with C::B + MingW(Importing VC 7.1 project(no much work))..
The demo runs fine disbling vetrex compression..I wonder if there's a way to use vetrex compression with my video card(RADEON 9000 MOBILITY)..
2nd question: To make the demo run i had to delete DecompressSplatShader and DecompressSplat (both .program and .cg) because of an error in cgProgramManager.dll it says (from Ogre.log):
-----------------------------------
Details:
-----------------------------------
Error #: 9
Function: CgProgram::loadFromSource
Description: Unable to compile Cg program DecompressSplatcg/FP: CG ERROR : The compile returned an error.
(81) : warning C7011: implicit cast from "float[4]" to "out float[2]"
(110) : fatal error C9999: oglfp2x backend can't compile shader to a single pass.
Problem: Not enough temporary registers
.
File: ..\src\OgreCgProgramManagerDll.cpp
Line: 60
Stack unwinding: <<beginning of stack>>
Any Ideas??
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

Post by tuan kuranes »

@BlooDragoN :
1) what'ts the vertex shader version on radeon moblity 9000 (check ogre.log report).

2) what CG version ? it's intended to be used with nvidia cg 1.4 toolkit (desinstall old, install new, recompile plugin_cg then retry. with new CG, it even can lower vertex shader version requirements. so may resolve 1) too.

And please send the CB project files, it can help others.
BlooDragoN
Kobold
Posts: 37
Joined: Wed Dec 22, 2004 7:57 pm

Post by BlooDragoN »

1) Max vertex program is vs_1_1.. Max fragment program is ps_1_4..

2) CG version 1.1.303.400 (cg.dll) but I only have binary files..never heard of CG toolkit..

I've sent you 2 email (I' too stupid :oops: :oops: ) containing C::B project because I can't upload anything..
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

Post by tuan kuranes »

plsm2 cvs head needs cg_toolkit 1.4.

download at http://developer.nvidia.com/object/cg_toolkit.html , install, recompile Ogre plugin_cg, then retry with new CG, it should work.

Thanks for the c::b projects !
BlooDragoN
Kobold
Posts: 37
Joined: Wed Dec 22, 2004 7:57 pm

Post by BlooDragoN »

OK...but where I can find GCC version of CG ToolKit??I've dowloaded standard version but there isn't lib(I need libCG.a) and header was different in number by those included in Dependencies..
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

Post by tuan kuranes »

Don't have a clue.
How did you compile plugin_cgmanager before ?
Find who made the C::B dependency pack, to find how he got it.
BlooDragoN
Kobold
Posts: 37
Joined: Wed Dec 22, 2004 7:57 pm

Post by BlooDragoN »

I've compiled it with deps linked in wiki..No clue about original deps's poster..
Wolf
Kobold
Posts: 28
Joined: Fri Jan 14, 2005 3:16 pm
Location: Switzerland

Post by Wolf »

Hi, I'm trying to use the PLSM but I can't found any tutorial or manual about how to use it (I added the plugin in my plugins lists, used the ST_EXTERIOR_REAL_FAR scene manager etc..).

I read the wiki but there isn't any indications about how to use the mapsplitter tool there's just a description of one cfg file.

Is there a tutorial or an article somewhere ?

Thanks