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.

DarkBASIC Professional Discussion / Light Mapper Preview - [Image Heavy]

Author
Message
Paul Johnston
TGC Developer
17
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 15th Jun 2006 19:33 Edited at: 15th Jun 2006 19:34
I've been working on some light mapping commands for DBPro that will be released as the DarkLIGHTS expansion pack (working title).

Here are some of the main features:
-Three types of light Directional, Point and Spot Lights
-Variable attenuation point lights, both quadratic and linear attenuation are avaible.
-Curved surfaces are smoothed correctly.
-Realistic shadows and variable shadow blurring.
-Transparent objects that modify the colour of the light ray as it passes through it.
-Uses very fast ray casting to achieve quick build times
-Start the light mapping as a thread so you can display its status whilst it works.

Below are some screenshots of the light mapper in action, the first is a simple scene with 3 lights and 4 objects, all casting shadows.

The second shows the transparent logo from DarkAI blocking some light on its way to the floor.

The final 4 are using the DarkAI level (about 75000 polygons) with 50 randomly placed high range lights taking just under 5 mins.

I'll post the help file when I have all the command descriptions done.

Attachments

Login to view attachments
French gui
16
Years of Service
User Offline
Joined: 11th May 2004
Location: France
Posted: 15th Jun 2006 19:52
Simply beautiful!!!

Chris Franklin
15
Years of Service
User Offline
Joined: 2nd Aug 2005
Location: UK
Posted: 15th Jun 2006 19:53
Great!

Stunt man 2 http://forum.thegamecreators.com/?m=forum_view&t=79827&b=8&p=0
WHITEKNUCKLE IS BACK! Check the wip boards for more info
BatVink
Moderator
17
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Jun 2006 19:58
But I bet you can't put a fruit pastille in your mouth without chewing it

Nice looking scenery



JerBil
16
Years of Service
User Offline
Joined: 8th May 2004
Location: Somewhere along the Z axis...
Posted: 15th Jun 2006 20:13
Very nice. How long till release?

-JerBil

Ad Astra Per Asper
Omikron
16
Years of Service
User Offline
Joined: 12th Mar 2004
Location: UK
Posted: 15th Jun 2006 20:20 Edited at: 15th Jun 2006 20:22
Realtime lightmapping in DBPro? Now we're really in business!

I'm assuming this is all done on the fly. So if you were to rotate a light around an object, the mapping would be recalculated for each frame?

Probably an obvious answer to that one, but I'd rather know than assume

... and, as above, how far along is this project. When can we expect some tiny video snippets of it in action?


Sorry for the myriad of questions, as you can tell i'm rather excited about all this.

Paul Johnston
TGC Developer
17
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 15th Jun 2006 20:37
Quote: "How long till release?"


I'd rather not try to estimate.

Quote: "So if you were to rotate a light around an object, the mapping would be recalculated for each frame?"


Light mapping is a one time process, it is used to represent static lights in the scene which then becomes an extra texture on the objects. Real time shadows are still a very expensive process so this pre-calculates shadows that aren't going to move Notice it took about 5 mins to calculate some of the scenes.
CuCuMBeR
17
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 15th Jun 2006 20:42
is this also going to cost? are you going to suprise us?
Omikron
16
Years of Service
User Offline
Joined: 12th Mar 2004
Location: UK
Posted: 15th Jun 2006 20:47
Quote: "Light mapping is a one time process, it is used to represent static lights in the scene which then becomes an extra texture on the objects. Real time shadows are still a very expensive process so this pre-calculates shadows that aren't going to move Notice it took about 5 mins to calculate some of the scenes."


I suppose I was being a little unreasonable

One more before I leave you alone: Will this lightmapping plugin work on imported .x, .3ds & .dbo format objects?

Habatar
16
Years of Service
User Offline
Joined: 9th Aug 2004
Location: Madrid (Spain)
Posted: 15th Jun 2006 20:52 Edited at: 15th Jun 2006 20:55
Looks very great. This is a surprise.

But I dont understand how works and the features. I am not an expert in lights.

One Question: You need to calculate the lights each time you load the level? Aprox 5 minutes is much time to wait for the player.
MikeS
Retired Moderator
17
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 15th Jun 2006 20:56 Edited at: 15th Jun 2006 22:32
Very cool, I'll definitly be getting this. Been waiting a long time for an easy way to do this.

Can you post the commands list, or at least a few basic ones?



A book? I hate book. Book is stupid.
(Formerly Yellow)
Paul Johnston
TGC Developer
17
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 16th Jun 2006 00:51
Quote: "Will this lightmapping plugin work on imported .x, .3ds & .dbo format objects?"


Yes, anything that can be an object in DBPro can be light mapped.

Quote: "You need to calculate the lights each time you load the level?"


No, you can save the object as a .dbo using the normal SAVE OBJECT command once it has been lightmapped. You can then load this in any other darkbasic application.

Quote: "Can you post the commands list, or at least a few basic ones?"


Here are a few of the commands:
LM ADD COLLISION OBJECT <Obj Num>
LM ADD TRANSPARENT COLLISION OBJECT <Obj Num>, <Type>
LM ADD LIGHT MAP OBJECT <Obj Num>
LM ADD POINT LIGHT <PosX>, <PosY>, <PosZ>, <Radius>, <Red>, <Green>, <Blue>
LM ADD DIRECTIONAL LIGHT <DirX>, <DirY>, <DirZ>, <Red>, <Green>, <Blue>
LM SET AMBIENT LIGHT <Red>, <Green>, <Blue>
LM BUILD LIGHT MAPS <Texture Size>, <Quality>, <Blur Radius>
return float = LM GET PERCENT( )
return string = LM GET STATUS( )
Habatar
16
Years of Service
User Offline
Joined: 9th Aug 2004
Location: Madrid (Spain)
Posted: 16th Jun 2006 01:26
Thanks Paul.
MikeS
Retired Moderator
17
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 16th Jun 2006 03:39
Thanks Paul, it's looking good.



A book? I hate book. Book is stupid.
(Formerly Yellow)
Cash Curtis II
15
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 16th Jun 2006 04:09 Edited at: 16th Jun 2006 04:10
Simply amazing. Your relentless expertise sickens me.


Is including lightmapping functionality in a distributable modelling app acceptable with this plugin?



Come see the WIP!
Richard Davey
Retired Moderator
18
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 16th Jun 2006 04:35
Quote: "Is including lightmapping functionality in a distributable modelling app acceptable with this plugin?"


The current thinking on this is 'yes'. This is after-all not something you'd use "in-game", but more something you'd add into your own game building tools and in-house apps. Yes it's a niche product but it's all part of a wider scheme, and there are bound to be a few people out there that will find this useful.

Bite my shiny metal ass
Cash Curtis II
15
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 16th Jun 2006 04:58
Quote: "The current thinking on this is 'yes'."

That would be awesome. Consider it bought.

Hey, not directly on topic, but relevant I think, since this deals directly with DBP modeling. I'd sure love to see a 'fix object scale' command.


Come see the WIP!
Pulsar Coder
16
Years of Service
User Offline
Joined: 3rd Jan 2004
Location:
Posted: 16th Jun 2006 05:59
Quote: "No, you can save the object as a .dbo using the normal SAVE OBJECT command once it has been lightmapped. You can then load this in any other darkbasic application."


Regarding the 75000-polygons map, five minutes or so took the calculations, but how long does it normally take to load and render that pre-lightmapped scene in a DBP application?

~Pulsar Coder
Cash Curtis II
15
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 16th Jun 2006 06:03 Edited at: 16th Jun 2006 06:04
Ultra fast. I didn't notice any difference between a lightmapped .dbo and a plain white bread .x file (of about that same size). Not that there wasn't, but if there was then it was a matter of seconds.


Come see the WIP!
Pulsar Coder
16
Years of Service
User Offline
Joined: 3rd Jan 2004
Location:
Posted: 16th Jun 2006 06:15
Great.

I'll be definitly getting this.

~Pulsar Coder
Baggers
16
Years of Service
User Offline
Joined: 31st May 2004
Location: Yonder over dem dere hills
Posted: 16th Jun 2006 08:47
Shocking....in the best way. Excelent work Paul, I'm actually considering buying some on the plugins for DBP now....now the money problem !

M.I.A is pending
dark coder
17
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 16th Jun 2006 19:32
well this looks nice, however its almost identical to evolved`s lightmapping fuctions which are all open source and made in dbp and seem fairly fast to me, so what does this have that evolved`s one doesnt?

Hallowed are the ori.
Richard Davey
Retired Moderator
18
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 16th Jun 2006 19:42
Quote: "so what does this have that evolved`s one doesnt?"


Speed (seeing as DBPro itself doesn't have to calculate all the math), and threading. It will also come with a scene mapper tool. But even so, not one of our products doesn't have an 'alternative' available somewhere (Dark Physics / Newton, Dark AI / IanMs A* library, etc)

The choice is yours to decide what does, and doesn't, fit your needs. This is just a preview of our lightmapping system. It won't be for everyone.

Bite my shiny metal ass
Pulsar Coder
16
Years of Service
User Offline
Joined: 3rd Jan 2004
Location:
Posted: 16th Jun 2006 21:22
Quote: "It won't be for everyone."


Because of the needs and or the price?

~Pulsar Coder
Neptune
14
Years of Service
User Offline
Joined: 8th Jan 2006
Location: United Kingdom
Posted: 16th Jun 2006 22:25
Wow! Amazing. Just a thought, will you be integrating that into FPSC? No offence to Lee or anyone but the FPSC one is quite slow.

All these super new add-ons, DarkAI, DarkPhsyics, now this. What next?

Keep up the great work guys.
Richard Davey
Retired Moderator
18
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 17th Jun 2006 03:24
Quote: "Just a thought, will you be integrating that into FPSC?"


As you know, we do not like to speculate on what we may or may not do with existing products in the future - but this system was built with the objective of using it in a future build of FPSC, and all the internal test objects/levels have been exported from FPSC so far.

FPSC is not dead, it -will- be updated, it is still a very young product. For now our concentration is on creating tools for DBPro and DGDK, the very base on which FPSC is built. The enhancements will filter down.

Quote: "What next?"


Our 2006 roadmap is well defined, and there are many more DBPro/DGDK related enhancements and tools coming. Beyond that, Windows Vista is the future, and we shall not be ignoring that.

Bite my shiny metal ass
Neptune
14
Years of Service
User Offline
Joined: 8th Jan 2006
Location: United Kingdom
Posted: 17th Jun 2006 13:42
Thanks for that info Richard. Exciting stuff indeed.
Seeting
15
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Mindspace
Posted: 17th Jun 2006 15:31
Really nice!

Syntax Entertainment
David iz cool
14
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 17th Jun 2006 20:48
wow!! looks great!!
JulesD
15
Years of Service
User Offline
Joined: 7th Feb 2005
Location:
Posted: 17th Jun 2006 23:36
Will this work on more complex objects like trees? If so can we see some demos.
trogdor
17
Years of Service
User Offline
Joined: 15th Apr 2003
Location: Portsmouth, VA, USA
Posted: 18th Jun 2006 08:09
Looks great, I'm buying it just let me know when it comes out.

Just curious, how does it compare to gile[s]? is there a gui to visually place the lights in the scene?
David iz cool
14
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 18th Jun 2006 17:44
what is the hit on fps?
Syncaidius
15
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: United Kingdom
Posted: 18th Jun 2006 21:59
Consider a copy sold to me.

Working on 2 projects: A Free Map/World Editor and my RTS game
BatVink
Moderator
17
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 19th Jun 2006 13:41
Quote: "what is the hit on fps? "


There won't be any, it's a pre-process. The only hit will be if your graphics card can't handle an extra texture or two. But that will also mean it can't handle most of todays games.



Paul Johnston
TGC Developer
17
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 19th Jun 2006 22:32
Attached is the help file with the full command list, I might also add some topics about general light mapping use like representing area lights.

Any suggestions of topics you think might be useful to have in the help file?

Attachments

Login to view attachments
Habatar
16
Years of Service
User Offline
Joined: 9th Aug 2004
Location: Madrid (Spain)
Posted: 19th Jun 2006 22:36 Edited at: 19th Jun 2006 22:38
Taking a look to the help file. Thanks Paul

EDIT: When you open the help file. The title windows display DarkAI .
LeeBamber
TGC Lead Developer
20
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 20th Jun 2006 02:07
Can't stop tinkering sometimes Helping Paul with a little front-end work, and thought you might like to see what a lot of lights can do to an ordinary diffuse texture. I can't wait until we start placing lights on purpose!

"Small, smart, and running around the legs of dinosaurs to find enough food to survive, bedroom programmers aren't extinct after all "

Attachments

Login to view attachments
Cash Curtis II
15
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 20th Jun 2006 03:49
Paul, that help file won't display any of the topics for me.


Come see the WIP!
Codger
17
Years of Service
User Offline
Joined: 23rd Nov 2002
Location:
Posted: 20th Jun 2006 04:38
I see no save command.
Does this mean that the textures are not saved ?
If so am I correct in thinking "build" will take place prior to ever execution of the game?

System
PIV 2.8 MZ 512 Mem
FX 5600 256 mem
Richard Davey
Retired Moderator
18
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 20th Jun 2006 04:46
As was mentioned earlier in the thread - you simply use DBPros 'SAVE OBJECT' command to save out the light mapped version.

No-one in their right mind would light map their levels IN THE actual game!!! Not unless your scene was extremely small / dynamic. The delay would just be too much. Light mapping is something you do to your levels before you use them in your games - much like texturing an object in a 3D package before loading it into your game.

Yes you *could* light map a level prior to playing it, but I wouldn't recommend it.

Bite my shiny metal ass
Lost in Thought
16
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 20th Jun 2006 04:56
Why doesn't save object save blendmapping now? Is it something yall are adding for this?

Habatar
16
Years of Service
User Offline
Joined: 9th Aug 2004
Location: Madrid (Spain)
Posted: 20th Jun 2006 09:06
That image is very cool.
Juso
17
Years of Service
User Offline
Joined: 23rd Sep 2002
Location: Finland
Posted: 20th Jun 2006 15:11
Some of those pictures have very sharp shadows, are maps gigantic 2048 x 2048 or has TGC team invented something else?
Gunner
16
Years of Service
User Offline
Joined: 9th Apr 2004
Location:
Posted: 20th Jun 2006 23:11
This is great news!

May i suggest some lighting scheme that brings out the life in a texture like radiosity does?

A reoccuring pattern in games i've seen lately is that all the textures/lighting looks bland and lifeless!

Next gen engines have wicked lighting models implemented so i'm thinking while were doing it might as well go over the top

my 2 cents
Redmotion
17
Years of Service
User Offline
Joined: 16th Jan 2003
Location: Mmm mmm.. Marmite
Posted: 22nd Jun 2006 16:00
Well this looks kind of handy : if you need to add lightmapping into a DBPro-created custom level construction program but outside of that we already have 3d World Studio, Cartography Shop 4, Giles, and countless other lightmappers. Unless it's going to be really cheap why will people choose this over 3d World Studio or Giles? Just asking!

No comment.
Megaton Cat
17
Years of Service
User Offline
Joined: 24th Aug 2003
Location: Toronto, Canada
Posted: 22nd Jun 2006 16:20
This is looking damn good. Don't screw it up!

This definitely beats 3DWS and the now dead Gile[s].


It's like a Megaton Cat radar, 24 hours a day.
Richard Davey
Retired Moderator
18
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 22nd Jun 2006 17:06
Quote: "Unless it's going to be really cheap why will people choose this over 3d World Studio or Giles? Just asking!"


It's a fair question. Here are some suggestions:

(1) This was primarily built for FPSC/DS, but we figured that _some_ of you might find a use for it now in DBPro too, so there was no harm in preparing it as a very fast DBPro DLL for sale. (2) For small levels, you could lightmap in real-time in your game (i.e. before you start playing the level). Say you've got a nice random maze game with quite simple geometery / light requirements, this could map it gorgeously very quickly before each level. Because of the way it threads you could actually light map the 2nd level while the player is playing level 1. (3) You can build your own custom game building tools with it. Lots of people make 'game editors' for their games anyway, well now you can add full light mapping support directly into them too. So if you don't like the way giles or 3DWS works, you could write your own replacement editor, and use this for the light mapping component.

Just some ideas off the top of my head for you. Ultimately though, it is a move on our behalf to start bringing technologies like this into the TGC fold, and not relying on 3rd parties as much. Our ultimate aim is to have a single game building environment that allows for a variety of tasks (including modeling, light mapping, physics rigging, etc) all from one core application, and this is just one of the modules for that, with a lot more to come.

Cheers,

Rich

Bite my shiny metal ass
Gunner
16
Years of Service
User Offline
Joined: 9th Apr 2004
Location:
Posted: 22nd Jun 2006 17:29
I love it! No justification needed for me, it's an instant buy

Even with all the free tools out there, I always end up programing my own for each projects i do, this way the tool is perfect for my project.

I do re-use alot of my code but custom tools is where productivity lies!
LeeBamber
TGC Lead Developer
20
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 22nd Jun 2006 20:53
To add my two cents, another huge reason from my point of view is that it works IN and saves OUT in the DBO format. The native data you are going to need for your games. No messing about with converting your lightmapped results into DBPro, and you know that because Lee has been poking about inside the lightmapper and the DBO structure, it's going to be the most game friendly implementation of texture staging

"Small, smart, and running around the legs of dinosaurs to find enough food to survive, bedroom programmers aren't extinct after all "
Habatar
16
Years of Service
User Offline
Joined: 9th Aug 2004
Location: Madrid (Spain)
Posted: 22nd Jun 2006 21:01
Lee you are great! Also, your company are great

Login to post a reply

Server time is: 2020-09-18 22:23:16
Your offset time is: 2020-09-18 22:23:16