[SOLVED] world scale

Captain_Deathbeard

13-11-2007 00:23:51

I have a problem here. My game world is at a scale of 10units=1meter, 10x bigger than the demos.

so logically I should just have to multiply the values i put in:

grass = new PagedGeometry(ou.render.getCamera(), 500);
grass->addDetailLevel<GrassPage>(1500);
layer->setDensity(0.05f);


however, doing this results in a slide-show framerate, the performance plummets, even in the example apps.

Are there some constant numbers in there or something that might be causing this?


Also, it seems to take about a minute to load a page of grass, and my game dir is being filled with log files, which is probably the cause, named "GrassLDR695_lod0_prepshadow.log" and so on, theres about 700 of them. The examples dont make these logs, so is it an indication of an error or something?

cobra8472

13-11-2007 11:36:04

I'm a complete c++ noob (keep that in mind :))

I'm unsure what the second value in

grass = new PagedGeometry(ou.render.getCamera(), 500); is.

however,

grass->addDetailLevel<GrassPage>(1500);
layer->setDensity(0.05f)

if you multiply addDetailLevel with 10 - you will render grass 10 times as far as you did previously.

if you multiply setDensity with 10 - the density of the grass will be 10 times higher.

So, essentially, you're rendering 100x more grass than before. The framerate logically takes a plummet :)


EDIT: Ah, for a solution to the scale issue, you'll have to lower the density for higher rendering distance.

JohnJ

13-11-2007 15:20:06

Your page and LOD scales look correct (500 / 1500), but I think the low performance is due to the grass density, as cobra8472 said. Since density is measured in grasses-per-square-unit, a 10x world scale means the volume of a page increases at least 100x. If you divide your density value by 100, the performance should be as expected.

Captain_Deathbeard

13-11-2007 17:55:08

Ok, thats fixed the frame rate, thanks!

What about the second problem with all the log files slowing down the loading?

JohnJ

14-11-2007 00:11:19

What about the second problem with all the log files slowing down the loading?
I'm not exactly sure what the logs are for, but it's probably something Ogre uses when generating shadow data. Are you using stencil shadows on your grass?

Could you post the contents of one of the log files? If it's unimportant, I can probably stop them from being generated.

Captain_Deathbeard

14-11-2007 02:23:53

Yes you are right, when I turned off stencil shadows altogether it ran fine. I dont think there is a way to turn off shadows for grass only. I tried adding "receive_shadows off" to the material, but no effect.

I cant post the whole log because they are 2MB each

02:10:18: Edge Data
02:10:18: ---------
02:10:18: Triangle 0 = {indexSet=0, vertexSet=0, v0=0, v1=2, v2=1}
02:10:18: Triangle 1 = {indexSet=0, vertexSet=0, v0=1, v1=2, v2=3}
02:10:18: Triangle 2 = {indexSet=0, vertexSet=0, v0=4, v1=6, v2=5}
02:10:18: Triangle 3 = {indexSet=0, vertexSet=0, v0=5, v1=6, v2=7}
02:10:18: Triangle 4 = {indexSet=0, vertexSet=0, v0=8, v1=10, v2=9}
02:10:18: Triangle 5 = {indexSet=0, vertexSet=0, v0=9, v1=10, v2=11}

////and so on till triangle 8000, then :

02:10:20: Edge Group vertexSet=0
02:10:20: Edge 0 = {
tri0=0,
tri1=4294967295,
v0=0,
v1=2,
degenerate=true
}
02:10:20: Edge 1 = {
tri0=0,
tri1=1,
v0=2,
v1=1,
degenerate=false
}
02:10:20: Edge 2 = {
tri0=0,
tri1=4294967295,
v0=1,
v1=0,
degenerate=true
}

//and so on until about Edge 19,000


and it just keeps generating these files, seemingly forever. So if you do know how to turn them off it would be good, because it means debug mode and shadows will be unusable.

JohnJ

14-11-2007 15:56:05

It's probably some sort of debug logging for the calculation of stencil shadow data then. I'll see if I can find a way to turn it off.