Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Feature requests and bug reports
Serious bug with the CCB import option

j9907
Registered User
Quote
2018-10-01 02:36:12

I found a rather interesting (but very serious) bug with the CCB importer:

My project's levels have been split into sections and I'm carefully lighting them all up to the best of my ability and also to hide them at runtime when the player isn't near them (so it looks as good as possible + runs beautifully) and then I'm importing the sections and then getting to the gameplay aspect. However: it seems to sometimes completely mess up the lighting on the CCB you import. so if you import section 1 and then section 2, section 2 might look completely broken!


erik
Registered User
Quote
2018-10-01 07:58:34

Are you using static lightmaps? I think if you click the 'calculate' button again, then this is fixed.


j9907
Registered User
Quote
2018-10-05 10:35:24

Yes, I'm using static lightmaps. sadly that isn't an option since the level meshes are very large and I did this as a test, and I had to wait over a half hour to recalculate the lighting.


srfstudio
Registered User
Quote
2018-10-05 14:04:49

I'm not using CC native lightmapper & I could be a waaay off on this issue but...

When I calculated lightmaps for a 3d model with multiple textures, I've noticed that lightmaps (actual image files) are not shown in CC 'Texture' tab & that I can see them only through 'irrEdit - IrrLicht Properties' tab. Not only that but they are all stored internally with 'internal_lightmap1' path & name.

What may be happening is that, once you import one level into another level, the lightmaps paths, names & references become messed up.

I would suggest that you export lightmaps into accessible image files by running the level in WebGL mode. The images will be exported into 'copperlichtdata' folder and you can copy them into folder of you choosing. From that folder you can re-name & re-apply them onto your model in CC so that you can get a non-internal image path with unique image name in CC.

I could be way off but if you haven't tried it maybe it could solve the issues.


j9907
Registered User
Quote
2018-10-05 16:42:05

I'd love to know how to make nice shadows in Blender but the tutorial you linked in another topic was confusing and it messed up the textures on the level every time I did the lightmap pack option...


srfstudio
Registered User
Quote
2018-10-05 19:21:24

Sorry, if you are not familiar with Blender that video could've been a bit unpractical. I remember freaking out when I was starting with Blender, most of the things were not at all similar to other 3D programs.

I recorded a small clip that covers importing a model, creating a second UV, ligthmapping & exporting to B3D.

There are 3 things you may find confusing:
1. I deleted the Material of an imported model because I always do that for my models. I add materials later if necessary but for CC & B3D material data is not necessary. It also causes lightmapping to be baked (on top of textures) instead of just being a lights-data.

2. I exported the lightmapped model in FBX format first because that's a fast way to have textures exported to the destination folder. When exporting to B3D only geometry gets exported, not textures, so you have to assign them one by one in CC. This takes care of that.

3. I never really found the way to easily import FBX with second UV set in CC, that's way I'm using B3D. However, the FBX you export will have second set UVs & will be usable in Unity, Unreal, Sketcfab & a bunch of other engines/programs.

Hopefully this clip will help you, Blender is hard to learn, Cheers!
https://www.newgrounds.com/dump/...


j9907
Registered User
Quote
2018-10-06 05:15:51

Thanks, srfstudio for the video. That made sense and worked great. I'll have to tweak this a bit (the light intensity / color) but it worked nicely...

I know my way around Blender, actually. I just was so confused with the video you linked. haha


j9907
Registered User
Quote
2018-10-07 11:20:12

I hope this can be fixed by the next point release... I can't finish one of the levels due to this bug...


j9907
Registered User
Quote
2018-10-08 15:35:54

Hey, srfstudio. would you know how I could apply the lightmap image exported via the WebGL export option to the full model?


srfstudio
Registered User
Quote
2018-10-08 17:41:10

I'm not sure, that's not possible if the lightmap is not already assigned to the whole model. So far I've only seen lightmaps being automatically assigned to textures, one lightmap for one texture, but I may be wrong.

You could consolidate all textures of the model into one with CC Texture Packer and than do lightmapping. I suppose that should produce one lightmap for the entire model.

I don't know what would happen if you pack all textures after lightmapping. Maybe CC will also pack all lightmaps into single file.

In Blender you also can't do that if geometry is not joined into single object. If you want one lightmap for entire model you must join all objects & than do lightmapping. The reason for this is because diffuse uv's can overlap each other (texture-repeat option is taking care of that), so you can have multiple textures for one object, but uv's for lighmaps cannot overlap (lightmap is unique for each triangle/quad so you can't assign texture-repeat) .


j9907
Registered User
Quote
2018-10-08 21:36:41

Ah... shoot. Alright. Well, I have the lighting where I want it now, but it's just that this one level is taking nearly 400 MB of memory.


srfstudio
Registered User
Quote
2018-10-09 13:39:17

Wow that's a bit over the top for one level. Wait, 400mb is the CCB file or does the game takes up to 400mb of RAM while playing? If it's RAM that's great, if it's files than it's a problem. Unless your level is a sandbox type of game-level, in that case it's actually small amount :)


j9907
Registered User
Quote
2018-10-09 20:02:48

Actually, yes. That's just one level.. It's purely an indoors level with many 512x512 textures applied. Here's a picture of the scene metrics box for the level:

🔎︎



j9907
Registered User
Quote
2018-10-09 20:07:15

Also keep in mind this project is going to have a total of 30-34 levels if all goes to plan.


srfstudio
Registered User
Quote
2018-10-09 20:49:11

Yeah, you seem to gone a bit high with nodes & textures but metric is more-less o.k. Around 400 mb of memory usage when level is being played is totally fine. Even if it goes X2 or even X3 up it's still around 1.2 gb which is great. Most indie desktop & online games go over 1 gb in RAM.

I have a similar situation with my levels and my WebGL export is around 30/40 mb per level. I'm guessing your level export will be a bit higher but still under 50mb for WebGL & maybe around 60mb for Desktop? ...that is If you are using jpg or optimized png for textures.

I'm not sure how CopperCube handles loading? Does it loads entire game or only the level that's currently going to be active? If it loads everything than that's bad, you would have to make every level a separate 'game' to avoid big, unnecessary loading time & memory usage.

...I never looked into it since all my levels are going to be separate html files that are going to be loaded dynamically from 'master' app.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact