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 / Another Dark Lights question this time only theory

Author
Message
MateiSoft Romania
4
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 21st Sep 2015 00:18
I am placing the objects and after recalculating the light maps. The objects have assigned light maps with different image names with the project's name.

Alex Matei CEO
www.alexmatei.com
Green Gandalf
13
Years of Service
User Offline
Joined: 3rd Jan 2005
Location: Cornwall UK
Posted: 21st Sep 2015 00:43
Quote: "The objects have assigned light maps with different image names with the project's name."


Have you checked that the correct light maps have been assigned?

I'll do a quick test of my own to see what happens when I recalculate the lightmaps and report back.



Powered by Free Banners
MateiSoft Romania
4
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 21st Sep 2015 00:46
I don't know how to check on every object if it has the correct light maps as the light maps are created automatically.

Alex Matei CEO
www.alexmatei.com
Green Gandalf
13
Years of Service
User Offline
Joined: 3rd Jan 2005
Location: Cornwall UK
Posted: 21st Sep 2015 01:20
Yes, it is awkward and you have to do it manually.

I've done a bit of testing by adding additional objects and recalculating the light maps and everything works as it should. It's more messy to delete an object because you need to reset and rebuild the collision data and I haven't tested that yet.



Powered by Free Banners
MateiSoft Romania
4
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 21st Sep 2015 01:43
The collision data and other settings are initilizing every time i render my scene. Is that supposed to be an ok method?

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 21st Sep 2015 14:05
Quote: "Do you just calculate the light maps at the end - or do you recalculate the lightmaps each time you add an object?"


This is the way it works...imagine adding a crate some where...if we calculate the lightmaps for the last objet, what happen with the shadows that it project on other objets?

Something different is if we have for example two rooms separated by a corridor...in such a case we could split the scene in two and render them separately, of course we need different path for lightmaps...something like
lightmaps_room1
lightmaps_room2
At the end we will have to load two objets, and we won't see any difference.

Cheers.

I'm not a grumpy grandpa
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 21st Sep 2015 14:08
Quote: "Do you just calculate the light maps at the end - or do you recalculate the lightmaps each time you add an object?"


This is the way it works...imagine adding a crate some where...if we calculate the lightmaps for the last objet, what happen with the shadows that it project on other objects?

Something different is if we have for example two rooms separated by a corridor...in such a case we could split the scene in two and render them separately, of course we need different path for lightmaps...something like
lightmaps_room1
lightmaps_room2
At the end we will have to load two objects, and we won't see any difference.

Cheers.

I'm not a grumpy grandpa
MateiSoft Romania
4
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 21st Sep 2015 17:57
I understand, well i retried to see when specifically the object destruction appears and it appears after i am placing the second light to another room after creating the first room, placing the first light and render the scene with one light and one room, after placing the second room and placing the second light, before rendering again, it breaks the first rendered object.

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 22nd Sep 2015 00:12
What I meant about spliting scene, is that we have somehow to make two different objects from the main scene to avoid big levels...so we are going to have two three or more objects that will make the whole scene. Then one by one, we have to render lightmaps...but in the scene can't be more objects than the one we need to get lights. that is the same when you make lots of test and then you decide to join them all in one big level.

I'm not a grumpy grandpa
Green Gandalf
13
Years of Service
User Offline
Joined: 3rd Jan 2005
Location: Cornwall UK
Posted: 22nd Sep 2015 13:11
Quote: "I understand, well i retried to see when specifically the object destruction appears and it appears after i am placing the second light to another room after creating the first room, placing the first light and render the scene with one light and one room, after placing the second room and placing the second light, before rendering again, it breaks the first rendered object."


I can't check this for a week or so as I am visiting family. If you still need help with this when I return I'll do some more testing to see if I can replicate the problem. As I understand it, the lightmaps should be simply recalculated - but I could be wrong. Have you tried resetting the light maps and resetting all the collision objects and lights when you add a new light?



Powered by Free Banners
MateiSoft Romania
4
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 22nd Sep 2015 14:43
Hello Green Gandalf,

Yes, i will still have need for help on this since i am totally blocked. Yes, i am resetting the lightmaps and collision, i am using these three commands:



Well, Chafari, the only way that the user can create levels in my engine is by placing numerous objects, renders the objects, again placing objects, again addling lights and so on...

Alex Matei CEO
www.alexmatei.com
Green Gandalf
13
Years of Service
User Offline
Joined: 3rd Jan 2005
Location: Cornwall UK
Posted: 22nd Sep 2015 18:20
Quote: "Yes, i will still have need for help on this since i am totally blocked. Yes, i am resetting the lightmaps and collision, i am using these three commands:"


Have you added all the collision objects and lights as well? If you haven't then the earlier objects will use the wrong images for their lightmaps. (Not sure - unable to test at present.)



Powered by Free Banners
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 23rd Sep 2015 14:17
Hi there
@Green Gandalf
@Mateisoft

Reading carefully your last comments, I made some more test about saving lightmaps. I have to say that some time ago I made lots of test with GAMEFX commmands ,where you save lights( no shadows ). I found out how to get it to work spliting levels . Here you could set path to folder "lightmapsavepath$="lightmaps" .
I realize then that in Darklights, we can not set path...it always save in "Lightmaps" and we can only set the name of the texture we want to aply to the object . With GameFx we just make object static, and then finally we add all static objects to light map pool to get the final Dbo "Universo" or the name that we set .

That is why I point you out about saving in differents folder ...sorry for my confusion . What I have made with Darklights, is lots of test without saving Dbo to see the result of the lightmaps . Now I realize that when we save with Darklights, all objects should be joined to get just a single Dbo.
We can make or load object into scene , give texture and use ("LM add collision to object 1" "LM add light map object 1" while we are testing, and when ready,use a function to joing them all into an only Dbo . In the case that we want different parts of the scene (spliting), what we have to take care about, is seting light map name "lightmaps" with a different name .

Cheers.

I'm not a grumpy grandpa
Green Gandalf
13
Years of Service
User Offline
Joined: 3rd Jan 2005
Location: Cornwall UK
Posted: 23rd Sep 2015 19:15
@Chafari I'm not sure about that.

In my tests you can save individual lightmapped objects. The only awkward bit is finding which lightmap image relates to your object when you need to apply the lightmap manually in code. Unfortunately I can't check this for a few days yet but hope to look at this when I return home.



Powered by Free Banners
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 24th Sep 2015 02:11
Quote: "In my tests you can save individual lightmapped objects."

"Yes,we can". About the images, we can give it different names but any way it loads automatically with the Dbo .What I never found out, is the way to apply ligtmaps manually in code

I'm not a grumpy grandpa
Green Gandalf
13
Years of Service
User Offline
Joined: 3rd Jan 2005
Location: Cornwall UK
Posted: 24th Sep 2015 13:30
Quote: "What I never found out, is the way to apply ligtmaps manually in code"






Powered by Free Banners
MateiSoft Romania
4
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 24th Sep 2015 13:42
well, the objects in my editor are saved through numbers as names so i can apply in a for loop the textures of those objects that have lightmaps, i set the name of the lightmaps as my current map project name in the editor so i think it will join correctly.

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 24th Sep 2015 16:44
Quote: "this is obviously impractical for large numbers of objects and/or limbs"

That is what I meant...it shoud be great Dbpro recognize automatically the corret image to apply.I suppose that can be done with a function an limb texture name
We can do what Mateisoft suggest ...what I did right now, created a folder with different name put three images into it and load them giving the new path and save again to Dbo and work ok.
We will have to some tricks as Darklights always save in lightmaps folder.

Cheers.

I'm not a grumpy grandpa
MateiSoft Romania
4
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 24th Sep 2015 17:56
Indeed Chafari. An interesting thing a managed to find, i do really think now that the whole destruction of the object's polygons appeared when i used csg substract and after that adding a light. I tested out this problem and i managed to find it. But there is a big problem because i don't really want to eliminate CSG from my editor, is too helpful!

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 24th Sep 2015 18:30
When solving the way to manage lightmaps in just a few limbs(about five to test)...the big problem came when I try to blend images to the limbs or objects...lightmaps doesn't work .

About the csg ,I fond a way to make the miracle with boolean and works like a charm...now I'm wiht my family at phone...I will show the function later on if I can...it works spliting the boolean object completly into triangles....using memblock and vertexdata, giving new UV to each triangle and join them all in a single object as libs ...it looks more hard than it is, for me that like challenges and reinvent the wheel..works perfect

Cheers.

I'm not a grumpy grandpa
MateiSoft Romania
4
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 24th Sep 2015 18:34
Ok Chafari, i can't wait to see that example!

Alex Matei CEO
www.alexmatei.com
Green Gandalf
13
Years of Service
User Offline
Joined: 3rd Jan 2005
Location: Cornwall UK
Posted: 24th Sep 2015 19:48
Quote: "works perfect"


Sounds good.

Quote: "Ok Chafari, i can't wait to see that example!"


Same here.



Powered by Free Banners
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Sep 2015 03:18
Sorry for the delay .
Some time ago, I made a level editor and decided to add lights only with darkbasic pro commands without using external programs (reinventing the wheel) . Soon I realized that GAMEFX commands fail in most cases and even not crashing, lights didn't appear properly. I made lots of try and error, and finally I made a triangle editor, where we could place vertex and triangles in the place that we want . Using this method, I could get nice lights and this way never crash of fail, but it was somehow a bit hard unless you like fight. It was in March 2014 I think, when casually I saw a Mobiius comment about a better method to split objects with memblock and Vertexdata...from then on, it was much easier to make levels, as I just need to make normal objects and split it at the end.

Here I attach a rar file containing the normal boolean method, that in Darkbasic never fail to me, and the one that split object into triangles. I hope this can help someone somehow .

Here is the trick


I'm not a grumpy grandpa

Attachments

Login to view attachments
Green Gandalf
13
Years of Service
User Offline
Joined: 3rd Jan 2005
Location: Cornwall UK
Posted: 25th Sep 2015 11:49
Quote: "Here is the trick"


That's interesting. So, are you saying welded objects cause problems for certain GAMEFX commands?

I'll look at this in detail when I return home next week.



Powered by Free Banners
MateiSoft Romania
4
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 25th Sep 2015 14:27
Sadly none of those examples worked for me and one of them has been detected as malware

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Sep 2015 14:29
Quote: "So, are you saying welded objects cause problems for certain GAMEFX commands?"

Gamefx commans doesn't render more than one light in boolean objects, so if we have complex objects, we have to split objets in some way.
In Darklights boolean works ok but we have to take care the order we create the object. If we make objects with a function , the last step is adding collision and lights....that means that we can not make a boolean once the object is ready for render.

I'm not a grumpy grandpa
chafari
Valued Member
12
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 25th Sep 2015 21:16 Edited at: 25th Sep 2015 21:53
Quote: "Sadly none of those examples worked for me and one of them has been detected as malware "


Sorry I didn't see this post. That is queer...only dba examples can't be malware....any way just tested for virus here and all is correct ... perhaps is a false positive for your antivirus.

Also it is odd that these examples do not work for you.
what version of darkbssic are you using?


Edit
In order you don't have to download any file, try this snippent with your own images .

Boolean objects in Darklights.


Making a boolean and spliting object


Report something back . What is the mesage error that you have there.

Cheers.

I'm not a grumpy grandpa

Login to post a reply

Server time is: 2018-08-15 06:23:11
Your offset time is: 2018-08-15 06:23:11