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
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 13th Sep 2015 02:38
Hello Community,

I am running in some problem that i think i am not the only person that had this problem.

When i am placing a few objects in the scene like 35 or so, and render a few lights, dark lights gives me a big c++ crash. Why a few objects in the scene bothers the plugin so much and crashes?

Thank You in advance!

Alex Matei CEO
www.alexmatei.com
wattywatts
14
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 13th Sep 2015 03:29
I only use the exe and never bothered with the code, but it might be worth it to try turning all those objects into one multi-limbed object. Other than that you could make sure the poly count isn't too high, as that's been the source of a lot of crashes for me.
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 13th Sep 2015 18:53
Hello,

I understand, but don't have any idea on how can i separate the objects into multiple limbs. A question i have right now: Does Dark Lights does not support the whole scene to have a high number of polygons or the individual objects themselves?

Thank You!

Alex Matei CEO
www.alexmatei.com
wattywatts
14
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 13th Sep 2015 19:02
I don't think it makes any difference; if you've got too many polys loaded at once dark lights will crash. I'm not sure what the actual number is anymore but I think I've been able to get away with a max of ~30k.
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 13th Sep 2015 19:16
Thats not good, i pasted in my scene around 100 objects from TGC that i assume that they are kind of low poly and still crash. It makes me think that Dark Lights is no good for usage...

Alex Matei CEO
www.alexmatei.com
wattywatts
14
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 13th Sep 2015 20:06
Well as someone pointed out to me you can separate your levels into sections and load them that way with their own lightmaps. Is this for a game or for your editor?
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 13th Sep 2015 20:21
Is for my Game Engine, yes

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th Sep 2015 20:58
Hi there.

Quote: "When i am placing a few objects in the scene like 35 or so, and render a few lights, dark lights gives me a big c++ crash"


Not sure what could be your problem . I made a quick test now with boxes then with spheres and it works like a charm . I have never done it , but ... as wattywatts pointed you out , you could split your level in more little levels

Test this level with 900 lights and 15 spheres....it takes about two minutes to render the whole scene, but it doesn`t crash here.

laptop Acer Aspire
Windows Vista
4 GB DDR2



Cheers.

I'm not a grumpy grandpa
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 13th Sep 2015 21:23
Hello Chafari,

Good to see you back!

The example given does not work. It compiles, but the exe doesn't run sadly. As for splitting the levels i don't think thats really possible since i am building an engine .

Alex Matei CEO
www.alexmatei.com
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 13th Sep 2015 21:24
Forgot to post my specs:

Laptop Asus ZenBook
nVidia 840M 2GB VRAM
12GB RAM

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th Sep 2015 21:44
Hi again . So it doesn't work even wiht boxes?? I have had some problems with the texture resolution time ago ... check that. We can join several levels , in the case you decide make smaller one.

Cheers

I'm not a grumpy grandpa
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 13th Sep 2015 22:58
The example doesn't work from the example provided. Well, i can't really see how i can sepparate in multiple levels since the user is creating a level by constantly placing the elements in the scene, i can't put any restriction .

Here is my code for the lights, its a bit long so i trully apologise:



Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 13th Sep 2015 23:23
Well , when we talk about spliting the level, that means that the user will have to make more than one huge object. Like in all 3D editor, we start making for example an enemy .... a soldat ....and we don't make a compete regiment of them. In my 3DEditor we can make a good level and save it as dbo then we can joint lots of them.

I'm not a grumpy grandpa
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 14th Sep 2015 01:32
Well, if i am converting the .x into .dbo the objects will be much more optimized? Also Chafari, please a lot, tell me if the code is ok that i pasted a few posts ago.

Thank You very much!

Alex Matei CEO
www.alexmatei.com
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 14th Sep 2015 01:38
I also have one object that when i implement two instances of it, dark lights crashes so its not the matter of map size, i think its the matter of the objects polygon number...

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Sep 2015 03:01
@MateiSoft Romania
About you code, it looks very neat, but it is difficult to guess where it crash if it is your case .

Have you had problems with Darklights with just a few polygons ?

How long does you scene take to render ? . I made that example with spheres to force the program to test if it crash . Normaly it takes more than half a minute with not big level

I'm not a grumpy grandpa
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 14th Sep 2015 11:51
Well it takes about a minute to render. The idea is, that i have a door that i don't think it has too many polygons but if i am placing 2 instances of it, it absolutely crashes. I attached the door in this post.

With a few polygons i didn't had any problem.

Alex Matei CEO
www.alexmatei.com

Attachments

Login to view attachments
wattywatts
14
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 14th Sep 2015 14:27
I didn't know you could lightmap animated objects. Try this one, I exported your model through fragmotion, worth a shot.

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Sep 2015 14:32 Edited at: 14th Sep 2015 14:33
Chafari

Your code works fine here - even with 35 spheres.





Powered by Free Banners

Attachments

Login to view attachments
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 14th Sep 2015 14:48 Edited at: 14th Sep 2015 15:23
I see, i will try the new door that you sent it.

Green Gandalf, i see that it works, a few minutes ago i made a kind of big room like a hangar, a few crates from cubes, a new mini room inside the main room, and 2 lights that had: one 100 RANGE and second one 700 RANGE and still crashed... maybe its not the matter of running out of memory or something...

Alex Matei CEO
www.alexmatei.com
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 14th Sep 2015 15:48
I think i had found the problem but not sure here, please correct me if i am wrong, is it possible that the error occurred because of the lights having huge ranges?

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Sep 2015 17:07
@MateiSoft Romania....I will test your door when I get home. About the ligth range, what I guess, you are going to have too bright areas nearly white...but you can test it.

GG Thanks for testing...it was really one of your examples that I fix for this example...I hope you don't mind

Cheers.

I'm not a grumpy grandpa
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 14th Sep 2015 17:16
Yes i know that but i was just wondering if the error occurs because i am rising the range too much.

Alex Matei CEO
www.alexmatei.com
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 14th Sep 2015 17:21
@wattywatts your door works after re exporting.

Is this the software that you used? : http://www.fragmosoft.com/fragMOTION/

Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Sep 2015 17:27
Quote: "Yes i know that but i was just wondering if the error occurs because i am rising the range too much."


Not sure. When I modified Chafari's code to use a much larger range with 35 spheres the only problem was that it took a long time (15 minutes!) to compute the lightmaps. I'll do a bit more checking to see if I can reproduce the crash.

Perhaps there's a limit on the number of lightmap images that DBPro can use? My modified version of Chafari's code resulted in 36 different 512x512 images. Perhaps the problem lies there?

Quote: "Thanks for testing...it was really one of your examples that I fix for this example...I hope you don't mind"


Of course I do not mind - you saved me the trouble of finding it/writing a new version.




Powered by Free Banners
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Sep 2015 17:38 Edited at: 14th Sep 2015 17:45
Interesting. A bit of experimentation suggests that the number of lightmap images equals the number of objects (not sure about limbs yet). That means that you are creating and using a very large number of lightmap images if you have a large number of objects.

So that could be your problem. Have you checked to see how many lightmap images you get in your lightmaps folder when your code works?

I'll see if I can cast more light on this later.

Edit

The one image per object suggestion seems consistent with this statement from the Help file:

Quote: "Every object you added will be made up of at least one DarkBasic limb, each limb must fit entirely within a lightmap texture, if you chose a small texture size you may get a warning that some limbs could not fit within a texture, increasing the texture size may fix this."




Powered by Free Banners
wattywatts
14
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 14th Sep 2015 18:05
Quote: "Is this the software that you used? : http://www.fragmosoft.com/fragMOTION/"

Yeah. Your model had the same problems that others have had with models from the db classic era, for some reason they're all set to 4800 frames per second. I haven't looked at the model data but re exporting them seems to fix whatever's going on.
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 14th Sep 2015 20:46
I see, well it seems that if I am changing the quality to a lower one, the error disappears entirely. That makes me make in my editor 4 types of rendering quality for the user to choose, low, medium, high and very high. That's interesting though.

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 14th Sep 2015 20:51 Edited at: 14th Sep 2015 20:54
GG
Quote: " you saved me the trouble of finding it/writing a new version."



Quote: "Perhaps there's a limit on the number of lightmap images that DBPro can use?"


In such a case would be the number of lightmap images that Darklights can use.


Quote: "A bit of experimentation suggests that the number of lightmap images equals the number of objects"


Yes that makes sense , unless we joint all limb in one, but we loose details of the scene.

@MateiSoft Romania
I tested your door and it works perfect like the wattywatts . Nice door and animation, but too many limbs for a door in a game

What I have seen ...mmmm
in my example I added lights ...
lm build light maps 512, 0.2, 1
That means :
LM Build Light Maps Texture Size, Quality, Blur Radius

In your example above, you have ...
Quote: "//SET LIGHT MAPPER SETTINGS - QUALITY AND BUILD THE LIGHTS
LM Build Light Maps Thread 2024,4024,1024"


why do you need such a big texture 2024 , and a quality of 4024 ??
in my quality I have just 0.2 , and the texture size 512.

Any way I made a test, and it took 10 minutes .
Here's an example in 512,0.2,1 that has 15 doors and works ok, so if your Darklights keeps crashing, perhaps the problem could be somewhere else.



I'm not a grumpy grandpa

Attachments

Login to view attachments
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 14th Sep 2015 22:04
Well yes, the problem was because of the high numbers that I've entered in the build light map thread.

I thought so, that the door has too many limbs. I will try recreating it.

Alex Matei CEO
www.alexmatei.com
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 14th Sep 2015 22:05
I made the quality so damn high because the shadows looked very pixelated.

Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 14th Sep 2015 22:37
Quote: "I made the quality so damn high because the shadows looked very pixelated."


If you make the quality too high Dark Lights warns you and changes the value to a lower one. If that happens you should have a file called "Lightmap Quality Changed.txt" in the project's folder.



Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 15th Sep 2015 00:31
Definetly you are right regarding the file. Sadly, when i make the range high, it crashes but regarding the message for quality chaning, it always appears, i think there is not any way to prevent that message to appear?

Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 15th Sep 2015 00:59
Quote: "Definetly you are right regarding the file. Sadly, when i make the range high, it crashes but regarding the message for quality chaning, it always appears, i think there is not any way to prevent that message to appear?"


Just read what it says in the file. For example, Chafari's code has the line



which sets the quality to 0.2. I changed that to 0.4 and got the warning that it was too high for the plain object. The file also tells you what value Dark Lights changed it to. You could try values near that and see what happens. If your scene has objects with widely varying sizes it might be difficult to find a value which works for all objects.

In short: do some experimenting (and read the Dark Lights Help files which explain some of this ).

However, since Dark Lights seems to reduce the quality per object when necessary, your choice of an apparently very high quality is probably OK anyway.



Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 16th Sep 2015 16:38
Yes, i understood, that problem i finally know where it was.

However, please look at this, i rendered the lights and gave me this final render.

Alex Matei CEO
www.alexmatei.com

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Sep 2015 19:19
What is it supposed to look like?



Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 16th Sep 2015 20:25
Well sadly the light mapping process ruined the level's textures but it supposed to be a hangar much like de_nuke from counter strike 1.6(attach)

Alex Matei CEO
www.alexmatei.com

Attachments

Login to view attachments
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 16th Sep 2015 21:01
I can't see clearly the image but from time to time you talked about instances in your editors...I suppose you are not trying to lightmap a level made with intances walls or doors or any other object in the scene !! . Every object must be a new one or a clone, never an instace....could be that your case??

I'm not a grumpy grandpa
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 16th Sep 2015 21:05
Every time in my engine if you want to import a new object it uses the command load object, but, if you want to duplicate it, the command clone object is triggered.

Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 17th Sep 2015 00:12
Quote: "Well sadly the light mapping process ruined the level's textures but it supposed to be a hangar much like de_nuke from counter strike 1.6(attach)"


Those images don't tell me much. What are we supposed to be comparing?

It would be clearer if you post a side-by-side comparison of a particular part of the scene before and after light mapping. Common problems are caused by: using inappropriate colour values in the lights, inappropriate light ranges, or inappropriate ambient settings. Light mapping shouldn't affect the textures themselves, only the way they are lit.



Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 17th Sep 2015 01:47
I understand you perfectly although the level is completely ruined and broken, the whole interior of the level that was a cube forming a room, went plain from the initial cube, some objects disappeared. I must admit that I entered a very high value as range to more than 3 lights, maybe that was the problem... as you said.

Alex Matei CEO
www.alexmatei.com
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 18th Sep 2015 02:13 Edited at: 18th Sep 2015 02:18
Any thoughts?

It supposed to look like this: (i managed to re create the level in order for you guys to know what i am talking about)(attach)

EDIT: I rendered the scene a couple of times since i was adding light by light and changing it's values all the time.

Alex Matei CEO
www.alexmatei.com

Attachments

Login to view attachments
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 19th Sep 2015 18:20
bump

Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th Sep 2015 16:37
Quote: "Any thoughts?"


Yes.

That looks to me like you're applying the wrong light maps to the objects. How are you calculating the light maps when you add a new object to the level? Are you simply re-calculating the light map? If so, then perhaps the earlier images are being reused for the new parts of the light map. Also, how are you applying the light maps?



Powered by Free Banners
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 20th Sep 2015 17:36
I use a clever method by renaming the light map images by the name of the current project created in my editor. So its like "projex05.png". As for applying, i know that it will automatically apply the images to the objects.

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 20th Sep 2015 19:45 Edited at: 20th Sep 2015 19:53
Quote: "I use a clever method by renaming the light map images"


It looks like you like the end result . The image is very flat ...I barely can see the light mapping . isn't it better to put less lights and add more sinister shadows ? .... somthing like this:

No textures just lights...


I'm not a grumpy grandpa

Attachments

Login to view attachments
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 20th Sep 2015 20:21
Well it'll be ok but if a user of my engine wants a non horror scene? What can i do? )

Alex Matei CEO
www.alexmatei.com
chafari
Valued Member
17
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 20th Sep 2015 20:56
Oops!

I'm not a grumpy grandpa
MateiSoft Romania
10
Years of Service
User Offline
Joined: 16th Oct 2013
Location:
Posted: 20th Sep 2015 21:06
But thanks to you Chafari you reminded me that i have to implement ambient light customization.

Alex Matei CEO
www.alexmatei.com
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Sep 2015 00:02
Quote: "I use a clever method by renaming the light map images by the name of the current project created in my editor. So its like "projex05.png". As for applying, i know that it will automatically apply the images to the objects."


That doesn't really answer my question. Suppose you're creating a scene with 5 objects. Do you just calculate the light maps at the end - or do you recalculate the lightmaps each time you add an object? How do you deal with the case where a user wants to change the scene? Do you recalculate the lightmaps for everything or just for the newly added object?



Powered by Free Banners

Login to post a reply

Server time is: 2024-04-24 11:55:30
Your offset time is: 2024-04-24 11:55:30