Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Weed problem

Author
Message
AlexZinn
15
Years of Service
User Offline
Joined: 17th Feb 2009
Location:
Posted: 20th Feb 2009 23:05
Hey all,

I am trying to add weed to my fps game.. its a piece of weed not animated but there is a problem... i tryed :


it showed it but there was a serious fps problem.. from 60 to 10...
i tried full map with weed and the game stucked and never showed it... it stucked my pc



Someone know a way to do it withought stuck?
code master
20
Years of Service
User Offline
Joined: 4th Dec 2003
Location: Illinois
Posted: 20th Feb 2009 23:40
Well I hate to be johnny raincloud...
But weed in general IS known for slowing your game down.

On a more serious note, How many polys is your weed? If it's anything really big, this could greatly affect the speed of your game. Where did you get it? What application was it made in?



AlexZinn
15
Years of Service
User Offline
Joined: 17th Feb 2009
Location:
Posted: 20th Feb 2009 23:53
yeah...i know that slow the game.. i am asking a way that will not slow that much i am new this so i asking if there is other way..
the weed taken from here - http://3dp2.0catch.com/weed05.html

the true its that i didnt exept it to slow that much.. i will try to find a more simple one.. or maybe you can post a simpler one? a fps withought grass looks rare

and the aplication its nothing special

its a skybox.. some fences... and a bezerker haha + collision

withought grass there is not any problems with fps... ah.. and i have a gun and a crosshair not fire or AI :p
Swamp donkey
16
Years of Service
User Offline
Joined: 29th Dec 2007
Location: Gothasoft
Posted: 21st Feb 2009 00:57 Edited at: 21st Feb 2009 20:58
Oh, wasn't expecting this from the topic.. http://www.thegardenhelper.com/weeds.html ... but nvm.

Grass systems are the vain of all outdoor engines. A careful balance of fill rate, object count, variable processing all come into play. If one of them is off then the entire system will crawl like a 9 month old baby.

As I too am currently working on a large scale outdoor grass system in GDK this thread may become the perfect outlet to share and compare notes.

Looking at your code, I see your copying mesh, all fine - but try instancing it instead just for starters. Am I seeing this correct? your only copying 57 grass objects? Seriously that shouldnt slowdown your system to much being such a small count. Hmm whats your poly count and resolution of the weed texture? Depending on how far you want to take this the absolute best way to setup your system would be to make a grid that expands over your entire map. Each section of the grid would hold the grass properties for that grid-point. This way you can save on countless distance checks to each of the grass objects. Now if you really wanted to go 'top-shelf' with it, constructing a method in which you actually build the grass billboards into a solid single object is the way to go. You could have 1000's of grass entities and only occupy 1 Object slot in the object pool. This is the method I'm currently struggling with in my own system but I know in the end it'll be well worth it.

EDIT: just had a look at the website you posted the texture from - 3D BOTANICAL MODELS. If your using those models in your application than we have found your problem. Those mesh plants are anywhere from 50,000k to 1,000,000 polys. WAY to expensive for grass entites. You'll want to use a 4 poly billboard / quad and alpha texture a grass skin to it.

3D BOTANICAL MODELS models are ment for still-life rendering inside max or whatever, not for real-time usage.

Treeparty DbPro / DarkGDK
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 21st Feb 2009 07:32
[plug]I made a free and open-source foliage library for GDK HERE which handles many things including scrolling fields of grass that never end, you could use that or just the media or whatever.[/plug]

Swamp donkey
16
Years of Service
User Offline
Joined: 29th Dec 2007
Location: Gothasoft
Posted: 21st Feb 2009 09:26 Edited at: 21st Feb 2009 13:32
Wow Dark Coder, that's nice! is that shadow mapping i see on the terrain? If so that's impressing. Will have a look at this, thanks.

Edit: Ahh nvm, after running the demo I see its real-time shadowing.. Thought you had wrote to a texture layer. None the less that's a nice demo.

Treeparty DbPro / DarkGDK
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 21st Feb 2009 17:56
Quote: "Wow Dark Coder, that's nice!"


Thanks.

Quote: "is that shadow mapping i see on the terrain?"


Yes.

Quote: "after running the demo I see its real-time shadowing.."


Yes, aka shadow mapping. Unless you're thinking of lightmapping? But lightmaps wouldn't look good for a scene with swaying trees and the lightmap size required for such a scene would be gigantic.

Swamp donkey
16
Years of Service
User Offline
Joined: 29th Dec 2007
Location: Gothasoft
Posted: 21st Feb 2009 18:18 Edited at: 21st Feb 2009 18:19
Quote: "But lightmaps wouldn't look good for a scene with swaying trees and the lightmap size required for such a scene would be gigantic."

Indeed they wouldn't. My particular scene is going to have static foliage and won't be as near the size your map is so I was hoping to apply just blob shadowing underneath the larger foliage objects for ambience and speed factor. So yes it would be a light-mapping.

I'm curious, using memblocks could I achieve drawing to a texture layer then just apply it to my terrain? I've been researching this for a few days now but haven't found anything concrete suggesting that I can.

Treeparty DbPro / DarkGDK
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 21st Feb 2009 19:12
Quote: "I'm curious, using memblocks could I achieve drawing to a texture layer then just apply it to my terrain?"


Yes, if you're not using shaders you'd want to use the 'multiply' blending mode, and if you are then you'd want to just multiply the output by this image.

Swamp donkey
16
Years of Service
User Offline
Joined: 29th Dec 2007
Location: Gothasoft
Posted: 21st Feb 2009 19:31 Edited at: 21st Feb 2009 19:31
Thanks for the info, I think I'm getting close to having it work.. Keep getting some unexplained errors when attempting to apply the texture layer to terrain however.. It's something I'm doing wrong, think I'll try and change the order of creation or even perhaps use a solid mesh for my terrain.. Hmmm

Treeparty DbPro / DarkGDK
AlexZinn
15
Years of Service
User Offline
Joined: 17th Feb 2009
Location:
Posted: 22nd Feb 2009 07:10
i tryed it and it didnt work to me.. i couldnt ever make the exe dmo work... so i tryed this

dbLoadImage("data\\map\\grass_T.BMP",2);
dbLoadObject("data\\map\\map1\\map1.x",1);
dbPositionObject(1,0,0,0);
dbPositionCamera (488,600,253);
dbScaleObject (1, 200, 100, 200 );
dbSetObjectCollisionToPolygons (1);

but it looks pretty cheap.. there is any way to make all the texture look more invisible? nbt only borders?

Login to post a reply

Server time is: 2024-09-30 19:18:18
Your offset time is: 2024-09-30 19:18:18