3D Rad - Free 3D game maker - Forum

This forum is now archived!

This forum is locked, and is a read-only version. A new community-ran forum can be found at classdev.net

News:

The 3DRad community can be found at classdev.net.

Pages: [1] 2

Author Topic: Grid frustrum example project (50.000 imposters)  (Read 3789 times)

« on: April 06, 2010, 10:54:29 AM »
Usable for placing alot of objects (like imposters into your scene).

Example application for usage would be :

- Grassing large areas or vegetation in general.
- Make a forrest of thousands of tree's
- Create cities with thousands of buildings
- Clouds.
- Asteroid field (or saturn rings?)

Simply for whatever you need alot of :)

Project contains a 16x16 grid in the x,z plane.
It always checks the 256 grid nodes, ..but searches only the nodes in the frustrum.
If a grid node is found, it looks for imposters and then renders only those, excluding imposters not in frustrum.
This makes it very fast, instead of searching all 50000 imposters,
it seaches (256 num nodes)+(nodes in view*imposters registered in each), typically :

256+16*195 = 3376 checks which is alot less than 50000 checks :)

Have fun.

Project is 3dRad v6.45
« Last Edit: April 06, 2010, 11:04:12 AM by shadmar »
« Reply #1 on: April 06, 2010, 01:50:36 PM »
Incredible!
 
if Shadmar =< 60 kg then
 go to eat
 go to sleep
 let a fat girl cook for you
 ;)
 
too much for my old laptop but also another scripting lesson to explore
 
new forum search:
http://www.google.com/ site:www.3drad.com searchword  ( <-- copy )
3DRad is now in the same Brain-Area like my old C64 and Amiga Memories!
« Reply #2 on: April 06, 2010, 04:40:02 PM »
nice one Shad! really cool, thanks for shareing!
using 3Drad 7.22

system specs:
Windows 7 Home Premium 64-bit
Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz (4 CPUs), ~3.2Ghz
8 gig ram
Geforce GTX 650 1024 MB GDDR5
DirectX 11

PsychoWeasel9

« Reply #3 on: April 06, 2010, 06:26:45 PM »
 
Oh my god!  I'm less than sixty kilograms! 
If Shad=<100kg
 Eat some parsley, you fat loser!
Couldn't resist.  While Im at it
Quote
what is large, green, and will kill you if it falls from a tree?
A snooker table! ;D

MAP testing is making me punchy, sorry ::)
« Last Edit: April 06, 2010, 06:29:08 PM by PsychoWeasel9 »
« Reply #4 on: April 08, 2010, 07:50:24 AM »
Ohh man ever since I got this program I've wanted to add grass on the ground, but Imma noob, how would I do it?  ???
« Reply #5 on: April 08, 2010, 01:48:00 PM »
1. I would change the wheels with grass and maybe use Genes grass shader.
2. When you place imposters you might want to scan the terrain height and place them along the y of the terrain- use iObjectScan()

I can make a demo, if I find some time later this week, but it should't be too hard to do it if you know your way around scripting.
« Reply #6 on: April 08, 2010, 01:53:42 PM »
I'm a noob when it comes to coding (only know HTML/CSS) so I'll wait for the demo, no hurry :)

BTW I opened yours, and it was a blank 3Drad file =S
« Reply #7 on: April 08, 2010, 03:23:00 PM »
You need 3dRad v6.45 to run it. It will not work on lower versions.
« Reply #8 on: April 08, 2010, 03:37:59 PM »
Ohhh... so where can I get that.. because I downloaded this program last night from the site ;)
« Reply #9 on: April 08, 2010, 04:18:09 PM »
« Reply #10 on: April 24, 2010, 12:36:35 AM »
old post i know but it is way too much for my 150mb graphics card
I'm never here and if I am I will try and say something...
Sorry tramkp888 I kind of forgot you back in July
« Reply #11 on: April 24, 2010, 07:02:43 AM »
Jus adjust the impostercount in the script :)
« Reply #12 on: April 24, 2010, 08:31:10 AM »
good idea
I'm never here and if I am I will try and say something...
Sorry tramkp888 I kind of forgot you back in July
« Reply #13 on: June 26, 2010, 02:33:37 PM »
Shad, I just took a relook at this after your post on the Future Development Discussion and notice that it was necessary for you to make the imposter loop run on every 4th scan. If I deactivate the 'update' variable so that the loop runs on every scan then everything comes to a slow halt. So I guess this is OK if your imposters don't have to be updated on every scan, but if they do and there are many of them (as in my case) then there is a problem.
AKA: The 3D Raddict http://www.3draddict.com/
« Reply #14 on: June 26, 2010, 04:28:57 PM »
They don't need to be updated on every loop, if you set it to 0 it still runs but abit slower.
It's just hiding/showing so every 4th loop isn't really noticeable.
But the problem remains the same, I agree, the scripts does have a limit on how much you can process before fps drops. If I try to update 50000 imposters on every 4th loop my simulation almost halts, when put in grid I keep 60 fps.
Pages: [1] 2