Need help: Terrain has a dark lightmap if lightmapMergable is used


(Mateos) #1

Good evening,

I tried several hours to find why I have such a result, but since I don’t have this issue on other maps using or not a PCX as a base, tweaking shaders/compilation doesn’t help, err, no idea :frowning:

Here is (half of) the map, with all the required materials and files to test and mess with:

There’s only a Spec spawn point, I removed all the other entities (excepted the script_multiplayer).

I have included some extra files regarding the lightmap only to remove all the yellow and red lines printed in the console.

You can directly load the PK3 in ET, included BSP and all, to see what I mean by dark lightmapping for the terrain :slight_smile: .map is inside the maps folder.

Thank you in advance,

Regards,

Mateos


(ailmanki) #2

Not sure if that is correct but I think lightmap megeable defines lightmaps to be merged together; most likely this is not what you want.


(Mateos) #3

I want the terrain in a single one yes, for a smooth lighting, like on all vanilla maps ^^’

In the released version I used the phong shading with q3map_nonPlanar as a temporary solution, but few locations where still edgy looking :confused:


(ailmanki) #4

Your right lightmap mergeable should do it.
Also its strange if it is lit correctly as soon as you remove the q3map_lightmapMergeable thingy…

Hm no idea, I only found this topic which seems to be a bit related, but nothing about to dark stuff.
http://forums.warchest.com/showthread.php/11680-dotproduct2-terrain-problem-(blending)-SOLVED

To bad I have no time to do experiments with it… :confused:


(Mateos) #5

The link should stay up for a long time, you can also keep it in a dark corner of your HDD until you can experiment :stuck_out_tongue:

Thank you!


(Mateos) #6

Double-bumpy-post for some news as I’ve done some more experimentation on this issue. And it got even weirder :stuck_out_tongue:

I first made a test map to see if the shaders was the issue, nope. Making different func_groups, using or not alpha pillars for the shading, with a construction in the middle to check shadowing, duplicate a triangle to check how Q3Map2 handles the merge in a single lightmap, nothing went wrong (the extra triangle was lit next to the rest on the lightmap).

So I went back to the copy/paste of the north part of the map, and put all the triangles into the worldspawn. All is black, so it’s not a func_group issue, or maybe something related since all the triangles with a lightmap_mergeable surface are in the same entity (worldspawn)…
If a part of the terrain is in a func_group, it is lit. But not correctly lit ^^’

The part behind the Allied Farm is a single func_group, as you can lit, but badly… Below the lightmap itself…

Will keep experiencing.

Edit: 4th pic added, with what you see at the upper left corner being in worldspawn (triangles leakinginside the skybox, to preserve original brushwork from Kommando… He used too much CSG). Shadowing a bit better, still on the left something strange.

Edit 2: 5th pic added, the top of the mountain is a func_group, and you can see the glitched shadow just on it. What’s going on @@


(Mateos) #7

*** NEWS ***
It seems q3map_shadeAngle fixes this issue, I don’t know why since I don’t use -shade during LIGHT process, but it works.

Another important info: func_group’s DO affect light stage. With q3map_lightmapMergable, you can clearly see on the output lightmaps that they’re arranged depending on if they’re part of the same “entity” or not (worldspawn or func_group). That’s how you’ll see below a lightmap with the road aside the rest of the terrain:

Edit: The lightmap after merging all func_group’s:

On the following screenshot, somehow lucky, I forgot to add a triangle to the func_group, easily noticeable:

And when adding it to the func_group:

I have grouped the brushes following a rule being:

  • Divided between north and south sides of the river.
  • Untouched original brushwork grouped.
  • Remade triangles at the mountains/hills top (because the map sky ceiling wasn’t flat) grouped.
  • New triangles added on top grouped.

And you can notice this fact, but I don’t have a screen for this ^^’

Thus I’ll have two sources, one with following the rule for a possible source release and one with everything merged for a final playable release.

Thank you for reading.


(stealth6) #8

Awesome news, nice that you found & shared the solution. Now we can all have nice looking terrain!