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.

Work in Progress / Dark Imposters plugin DBPro/GDK

Author
Message
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 17th Apr 2011 17:17 Edited at: 15th Jul 2011 22:51
Dark Imposters


Dark Imposters is now on sale on the TGC store.


Buy now or try the demo HERE!





What are imposters?
Imposters are 2D planes textured with an image of the object, they are activated at a given distance and regenerate automatically when angle error becomes too large, meaning they are a good representation of your objects at all times from any angle.

This will speed your game up alot, allowing for more detail in your environments.

Here comes the science
Using DirectX Dark Imposters can render multiple objects to one texture, this is very efficient as the render target only changes once. The imposter billboards are then rendered as one object from this texture making it very fast.

You supply the texture size and how many imposters you want like this:

IMP MAKE GROUP 1, 1024, 1024, 16, 16

This will create a texture 1024 x 1024 with a possible 256 imposters(16*16) at a resoltion of 64 x 64.

You then add the objects:

IMP GROUP ADD OBJECT 1, 1

Adds object with ID 1 to group with ID 1

Thats it, just update in your loop and your game will run faster.

KNOWN ISSUES:
There are currently no known issues.


UPDATES:
15 July 2011 - v1.1 is available for download.
Quote: "
New commands:
-IMP GET MAX TEXTURE WIDTH
-IMP GET MAX TEXTURE HEIGHT
-IMP IS IMPOSTER

Fixes:
-Fixed bug that could cause extreme distant objects to not
render to texture properly.
-Improved z-sorting for fading imposters, now sorts in small
amounts each frame rather than doing a full sort at given
time intervals.
-IMP IMPOSTER GET ACTIVE was wrongly returning whether the object was
currently an object or an imposter, now it returns whether
the imposter has been removed from the scene, as possible
using IMP SET ACTIVE.
-Fixed bug which prevented last object added to a group from
being added to object/imposter map. This affexted IMP IMPOSTER GET ACTIVE
and IMP IS IMPOSTER
-Fixed fade bug, when fading was used the object/imposter map was invalidated.
(would access wrong imposters)

Documentation:
-Added culling example
-Improved examples, camera movement etc, they now take into account
that some hardware requires textures to be split up evenly.

DarkGDK:
-Added VS10 lib
"





CREDITS:
Credits to everyone who has helped me on these forums over the last year or so, some that come to mind:
Kaedroho, IanM, Diggsey, Techlord

Quel
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 17th Apr 2011 17:52
Why the video doesn't show the regeneration when you start looking behind the planes?

-In.Dev.X: A unique heavy story based shoot'em ~6%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 17th Apr 2011 18:52
Quote: "Why the video doesn't show the regeneration when you start looking behind the planes?"


The next video will show the regeneration, that video just demonstates what is happening to your objects

_Pauli_
AGK Developer
14
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 17th Apr 2011 21:05
Good work.
Are imposters something like point sprites?
I once had a particle system using point sprites and shaders, the performance increase was huge! There is a good DBPro sample around the forums, can't remember the author though...

Quel
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 17th Apr 2011 21:07
I only realized at 100% how is all this working now, a pretty nice alternative to prerendered billboards or LOD!

I'm very fed up with all the plugin releases on top of an otherwise almost empty product we know as DBPro, but still i'm happy to see such a thing to appear.

-In.Dev.X: A unique heavy story based shoot'em ~6%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
Duffer
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: chair
Posted: 17th Apr 2011 21:09
This looks really useful for distant environment objects?

a long time dabbler with DBC and DBPro with no actual talent but lots of enthusiasm...
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 17th Apr 2011 22:41 Edited at: 17th Apr 2011 22:41
Wow Matty, you are going all out for the TGC Community. Very impressive!!!

Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 17th Apr 2011 23:53
This is awesome and very useful!

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 18th Apr 2011 16:06 Edited at: 18th Apr 2011 16:19
Thanks for the positive responses everyone

Quote: "Are imposters something like point sprites?"

I use billboards, it seems point sprites are faster but quite limited, thats probably why you would need a shader to use point sprites for imposters, they are more common for particle systems I think.

I will put together a new video soon and perhaps an exe so you can test it out.

EDIT: Can anyone help me with my sig, its not working, this is what I have:

I want it centred also if possible.

[href = http://forum.thegamecreators.com/?m=forum_view&t=184148&b=8][/href]
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 18th Apr 2011 18:27
Wow, that would be perfect for the project I'm currently working on.

_Pauli_
AGK Developer
14
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 18th Apr 2011 20:38
Quote: "Can anyone help me with my sig"


This is your signature centered (works just like in normal posts):



Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 18th Apr 2011 21:48
Thanks Pauli, although I can't get the link to work, and I can't try different things as I would have to keep posting to test it out

_Pauli_
AGK Developer
14
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 18th Apr 2011 22:17
Hmm, then try this:



That's exactly the code of my signature, but with your link and image.
I think it's basically the same but without spaces and non-capitalized img label.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 18th Apr 2011 22:34 Edited at: 18th Apr 2011 22:39
Thanks Pauli, I wont know if it worked until I post this ha ha.

EDIT: Yay it worked, probably the spaces I had in, thanks again.

I am currently working on multiple cameras for the imposters, I need to include the option to share imposters between camaras or have an imposter for each camera view.

The first way will be faster and you can use it if the cameras are always going to be close together, maybe a biplane game where one flies and one guns etc.

The second will be for the more standard split screen stuff.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 19th Apr 2011 01:31
I have all image display options set to OFF. Images hinder forum page downloading and 90% of the images in sigs tend to be annoying.

Matty, I just realized that you have enough Systems in the works to integrate them all into one Game Engine App? Is that your end goal?

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 19th Apr 2011 01:53
Quote: "Matty, I just realized that you have enough Systems in the works to integrate them all into one Game Engine App? Is that your end goal?"


Not exactly, I have an idea for a project and need to render outdoor scenes as fast as possible. Having the physics in place and with the release of blitz terrain I'm most of the way there, having imposters was the next piece of the puzzle.

But like you say, everyone creates an engine of some sort when developing any game.

Travis Gatlin
14
Years of Service
User Offline
Joined: 14th May 2009
Location: Oxford, Alabama
Posted: 21st Apr 2011 01:59
Nice dude, combined with all the other Framerate savers, this will add the(near)finishing touch to an otherwise graphically Inefficient game.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 21st Apr 2011 16:09 Edited at: 21st Apr 2011 16:10
OGRE has a Impostering Library. Just one of several justifications for the S3GP migration.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 21st Apr 2011 16:53
Quote: "Nice dude, combined with all the other Framerate savers, this will add the(near)finishing touch to an otherwise graphically Inefficient game."


Thanks, should have more info and videos soon.

Quote: "OGRE has a Impostering Library. Just one of several justifications for the S3GP migration."


Yeah, its a pretty essential thing to have for any outdoor scenes.

I am still considering OGRE for my next project, do you have anything in mind for terrain for S3GP? Would save me some searching

Although GDK is my first choice, I have alot of tools for it, I'm hoping with Blitz Terrain and Dark Imposters I will be ok.

JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 21st Apr 2011 17:13
Will this only work for static objects, or could it be applied to any type of an object, animated, AI controlled, etc?

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 21st Apr 2011 18:23
Quote: "Will this only work for static objects, or could it be applied to any type of an object, animated, AI controlled, etc?"


Dynamic objects should not be a problem, I plan on implementing that in the next few days.

I will also be looking to get it working with animated objects, although the animation will only be updated each time the imposter is regenerated, so there is a balance between keeping the animation roughly in sync while not regenerating every frame which would work out slower than just using the real object

I can't see Physics/ai controlled objects being an issue either.

I have just tested it with lighting, fog, and transparency and its working pretty good.

I am just about to add culling too, each group will only be drawn and regenerated if they are on screen, this will be pretty important for large worlds.

Daniel wright 2311
User Banned
Posted: 21st Apr 2011 23:14
Can you use any shape imposter or is it just a plane set with a texture set to defuse? I want to know becouse it would be cool to set a video on the imposters to make them life like.

my signature keeps being erased by a mod So this is my new signature.
Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 22nd Apr 2011 14:39
Quote: "Can you use any shape imposter or is it just a plane set with a texture set to defuse?"


If you could you would have a LOD system. This is somehow a LOD system, but concentrates on projecting the model onto a plane.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 22nd Apr 2011 16:02
Quote: " I want to know becouse it would be cool to set a video on the imposters to make them life like."


The imposters are there to optimise your game world without the player noticing too much, thats the ultimate purpose. If you do too much with them it might then become more efficient to use the real objects instead.

JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 23rd Apr 2011 02:08
The first thing I thought of when I saw this was epic asteroid fields.

Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 23rd Apr 2011 10:40 Edited at: 23rd Apr 2011 10:42
Quote: "The first thing I thought of when I saw this was epic asteroid fields."


I can absolutly imagine that that would be freaking amazing, epic! OMG!

Edit: Does the project on plane occurs when camera reached a certain distance? Or are all of the objects "planes"? Or does it change, like: Within 500 units it would show the normal object, else it would be a projection on plane...?

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 23rd Apr 2011 14:37
Quote: "Does the project on plane occurs when camera reached a certain distance? Or are all of the objects "planes"? Or does it change, like: Within 500 units it would show the normal object, else it would be a projection on plane...?"


You set the distance you want the imposters to become active, they then fade in while the object fades out. At a certain minimum distance you can't tell its actually happening, this distance depends on other variables, size of your objects, resolution of the imposters, max angle error etc.

Quote: "The first thing I thought of when I saw this was epic asteroid fields."


This is the type of situation where this system really shines, as you get further back they need less and less regeneration saving you tons of CPU.

Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 23rd Apr 2011 16:22
Great work matty! Really great work!

The Slayer
Forum Vice President
14
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 24th Apr 2011 19:13
Another plugin that will come in handy. Good job, matty. Keep up the good work.

Cheers

SLAYER RULES! YEAH, MAN!!
Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 25th Apr 2011 17:34 Edited at: 25th Apr 2011 17:37
@matty: I am wondering how have you done the projections? Or is that the secret ? Would love to know the techniques behind this amazing plugin. Thanks mate!

EDIT: NVM, read the sentence in your post .

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 25th Apr 2011 21:02
Top post updated with demo attached.

I was inspired by Josh to try this out on an asteroid field, worked out pretty good I think.

If anyone tries it, let me know what fps you get with/without imposters, thanks.

The asteroids are free media with GDK so I hope its OK to use them, if anyone thinks not then let me know.

Oneka
19
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 25th Apr 2011 22:50
Hmm, from what I used of it, it looks good, one problem I noticed what the artifacts of the imposters, some of them have a whiteline and it detracts from everything, and they kinda seem to pop alittle bit.

Good work on it so far, this is a eye catcher for GDK/DBP!


Making dreams possible, one line at a time...
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 26th Apr 2011 00:14
Quote: "I am still considering OGRE for my next project, do you have anything in mind for terrain for S3GP? Would save me some searching"
Terrain plugin allows you to render geo-mipmapped terrains & Paging Scene Manager.

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 26th Apr 2011 15:50 Edited at: 26th Apr 2011 16:31
Thanks for links Techlord.

Quote: "one problem I noticed what the artifacts of the imposters, some of them have a whiteline and it detracts from everything, and they kinda seem to pop alittle bit."


I too have noticed certain imposters using a small part of another imposters texture, strangly though for me, not on this demo, if it is the same thing as what I have seen then that will be fixed soon.

Any popup can easily be fixed by setting the imposter creation distance back a bit, although it would mean drawing more real objects.

EDIT: I have just noticed that if the transparency mode is changed on an object then it can create white outlines around the objects as they change. This demo does not do this on my machine but perhaps it needs a different mode to work on all computers. If it is that then its not a problem with the plugin its just the 'set object transparency' command settings which is set by the user. I had it set to 3 for this demo.

Oneka
19
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 26th Apr 2011 17:00
Try mode 6, that it what I normally use, but it works good from what I saw of it


Making dreams possible, one line at a time...
Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 26th Apr 2011 18:31
Looks amazing! It really does, i get 103 FPS on 1024x768 1600 en 225 FPS on 1024x768 400!!!

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 26th Apr 2011 23:56
Wow... just wow...

Amazing work as usual matty!

JLMoondog
Moderator
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 27th Apr 2011 07:53 Edited at: 27th Apr 2011 07:58
Now this is where this plugin really shines:
Running this on my very crappy notebook I get 4 fps with it turned off and 80fps with it turned on. I also didn't experience any artifacts.

Brilliant! You already have a buyer once this comes out.

Edit:
On my powerhouse:
24fps turned off, 485fps turned on

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 27th Apr 2011 10:29 Edited at: 27th Apr 2011 10:32
Quote: "Brilliant! You already have a buyer once this comes out."

Make that 2...

EDIT:
You realise I'll have to make another zombie game when this comes out. Damn you.

Imagine a hundred / thousand zombies coming at you, nice! Probably have to use clones or something as well but it could be amazing. A bloodfest.

OldPMan
TGC Store Seller
15
Years of Service
User Offline
Joined: 10th Aug 2008
Location:
Posted: 27th Apr 2011 11:22
WoW WoW
I've tried. Good job. Many people can help.

.....already beside.....
Red Eye
15
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 27th Apr 2011 12:31 Edited at: 27th Apr 2011 12:38
You got a buyer! (most likely!)

Keep it up!

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 27th Apr 2011 13:57
Did I mention how the name Dark Impostors is?

Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 27th Apr 2011 19:15
Thanks for all the positive feedback everyone

The asteroid example is perfect to show off this plugin because you have lots of high poly objects very far away. I should have a landscape demo soon showing lots of trees etc, the differece in fps in this demo is not as huge but still a great improvement, especially at distance.

I have added the ability to use a lower poly model for your imposters(when it renders to the texture), meaning if you already have LOD set up on a model you can benefit again by using it for the imposter, giving another little speed boost.

Another thing I have not mentioned yet is that you should be able to quickly create 2D sprite sheets of 3D animated models from any camera angle with ease. I have not tested this yet but if you tried saving the texture on the asteroid demo you will see how it should work.

Demon000
16
Years of Service
User Offline
Joined: 21st Aug 2007
Location:
Posted: 3rd May 2011 20:53
Great work! Looking forward to your landscape demo!
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 7th May 2011 21:13
Quote: "Great work! Looking forward to your landscape demo!"

Thanks, putting demos/video together now

I have all but finished this plugin, just need to do some testing and make some demos.

Quote: "Imagine a hundred / thousand zombies coming at you, nice! Probably have to use clones or something as well but it could be amazing. A bloodfest."


That would be cool, and now it is possible, dynamic objects can now be imposters. Animated objects also work but need to be instanced objects which is not really a bad thing, hundreds of zombies with their own animation data would be pretty slow, a few different zombies instanced hundreds of times should be fine

It supports multiple cameras too, culling is now easily achieved also.

The asteroid demo was done with cloned objects meaning I ran out of memory after around 1600, with instanced objects I have had 40,000 asteroids

revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 8th May 2011 19:47
Sweet, am I to assume that this would work with the Enhanced Animations plugin and shaders as well?
What about a system like evolved's advanced lighting (where the same object needs to be rendered more than once, each time with a different effect technique. Those renders then are used to create the final result on a screen quad).
Will there be a way to specify which camera to grab the render from (I assume not, since it directly uses DX9), or will there be a way to manually control when an object's imposter is re-rendered (so we can define which shader technique to use)?
Stab in the Dark software
Valued Member
21
Years of Service
User Offline
Joined: 12th Dec 2002
Playing: Badges, I don't need no stinkin badges
Posted: 9th May 2011 05:43
Great Work you have got one more customer.


[img][/img]


Custom,intel 3.0GHz Hyper Threaded,4GB RAM,ATI X1500 256mb,
WindowsXP DBpro v7.5 Synergy
The coffee is lovely dark and deep,and I have code to write before I sleep.
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 9th May 2011 17:26
Quote: "am I to assume that this would work with the Enhanced Animations plugin and shaders as well? "


I can't think of any reason why enhanced animations would not work. If for any reason it does not then this is something I would immediately address as I have heard nothing but good things about that plugin.

At the moment it does not support shaders, it is something I may look into. I think certain fx will not be noticable as imposters are always at a distance, also, rendering the object to texture as fast as possible may be better in some circumstances, as long as the imposter is far away enough for the player not to notice.

Bluespark
13
Years of Service
User Offline
Joined: 18th Mar 2011
Location:
Posted: 15th May 2011 08:23
Hi matty halewood,

I noticed that Dark Explorer doesn't seem to work with your demo executable. May I ask how I can make my programs like such as well?
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 15th May 2011 12:59
Quote: "I noticed that Dark Explorer doesn't seem to work with your demo executable."


What is Dark Explorer? What is the problem, error message etc?

Quote: "May I ask how I can make my programs like such as well?"


Not sure what you mean, do you want to make games, or do you want to know how to make an executable file for your game?

Login to post a reply

Server time is: 2024-04-18 14:18:40
Your offset time is: 2024-04-18 14:18:40