lightgrid


(boddo) #1

in my map, a vary large map, some rooms/areas (that are small) appear not to have been added to the light grid, as when the player enters these areas, the player model goes dark. These areas them self are lit up with entitie lights and are quite bright.

there is no errors in the light phase of the compile.

I tried with ‘-fastgrid’ and it yielded no changes
I tried with ‘-cheapgrid’ and the lightgrid appeared darker throughout the maps entirety.

here is the compile’s lightphase if it is of any use;

699 light entities
— SetupBrushes —
4130 opaque brushes
— SetupDirt —
48 dirtmap vectors
— SetupSurfaceLightmaps —
27962 surfaces
1629 raw lightmaps
25750 surfaces vertex lit
2212 surfaces lightmapped
1767 planar surfaces lightmapped
24 non-planar surfaces lightmapped
248 patches lightmapped
246 planar patches lightmapped
— SetupTraceNodes —
786899 trace windings (198.12MB)
1374055 trace triangles (115.32MB)
450882 trace nodes (27.52MB)
223321 leaf nodes (13.63MB)
3 average windings per leaf node
32 max trace depth
— SetupGrid —
Grid size = { 240, 224, 288 }
Storing adjusted grid size
987168 grid points
— CreateLights —
Sun: textures/gjs3/SKY_001
1047 point lights
5 spotlights
1281 diffuse (area) lights
32 sun/sky lights
— SetupEnvelopes (fast) —
1715 total lights
650 culled lights
— TraceGrid —
0…1…2…3…4…5…6…7…8…9… (77)
226 x 112 x 39 = 987168 grid
33135950 grid points envelope culled
2463498 grid points bounds culled
— MapRawLightmap —
0…1…2…3…4…5…6…7…8…9… (8)
1630416 luxels
1093246 luxels mapped
33469 luxels occluded
— SetupEnvelopes (fast) —
1715 total lights
0 culled lights
— IlluminateRawLightmap —
0…1…2…3…4…5…6…7…8…9… (784)
1630416 luxels illuminated
— IlluminateVertexes —
0…1…2…3…4…5…6…7…8…9… (716)
395169 vertexes illuminated
449788 lights plane culled
1952689 lights envelope culled
0 lights bounds culled
43905135 lights cluster culled
— StoreSurfaceLightmaps —
Subsampling…collapsing…sorting…allocating…storing…projecting…done.
1204447 luxels used
1540096 luxels stored (78.21 percent efficiency)
148 solid surface lightmaps
197 identical surface lightmaps, using 52088 luxels
0 vertex forced surfaces
0 vertex approximated surfaces
94 BSP lightmaps
94 total lightmaps
505 unique lightmap/shader combinations
Writing C:/maps/testbuild.bsp
Storing lightgrid: 987168 points
Wrote 45.6 MB (47770912 bytes)
1638 seconds elapsed
Disconnecting
Connection closed.

any ideas or workarounds would be appreciated and if requested I’ll post a few screenshots.

thanks


(zenith-ply) #2

Fwiw I’ve found that patchwork (patch ceilings) can be linked to player model lighting problems, regardless of entity lights present. If this is the case, I would recommend lights made out of patchwork textured with regular light textures (instead of brushwork textured with regular light textures/shaders). I speak out of this from experience with player model lighting and it seemed to do the trick.


(boddo) #3

thanks
…testing…compiling…testing…

I tried with light shaders applied to brushes, then to patches instead as you suggested, but did not help.

The areas in question dont really have much too them.
Is there a limit to the size of the lightgrid? maybe im exceeding it?

just outside these rooms, the lighting is fine.
heres a couple screenshots attached:


(obsidian) #4

It’s possible to exceed the maximum lightgrid boundaries, but that doesn’t usually happen unless your map is insanely large. You can try scaling the lightgrid to larger blocks (worldspawn), or limit the lightgrid area with the lightgrid shader.


(ACROBAT) #5

Is the command just _lightgrid or something obsidian?

Also this is probably a stupid question…but is there anyway that vertex lighting influences the lightgrid? Or any other obscure shader command that would weigh in on it?


(boddo) #6

If I use a shader to define the region for the lightgrid, could I do it in pieces? or does it have to be 1 large bounding box?

The map is comprised of a number of areas, some outside the core map, that can only be reached via teleporters. So would I encapsulate each area individually, with a lightgrid-shader brush?

also, how would I specify the regions via worldspawn?

If the lightgrid is just 1 large region, might moving all the seperate areas in the map closer together help?

thanks


(obsidian) #7

gridsize X Y Z, defaults being (IIRC) 64 64 128. They need to be in power of 2 values, so 256 256 256 or whatever. This just changes the “resolution” of the lightgrid.

Vertex lighting won’t affect the lightgrid, just light entities and shader lights and raytrace bounces.

The Q3Map2 lightgrid shader needs to be a single bounding box. The lightgrid takes the maximum bounding box of your entire map and splits it up into little chunks.

If you have a high ceiling with sky in it that the player or entities can’t reach anyway (think large open terrain maps), use the lightgrid shader brush to isolate that area off. Moving your chunks of rooms together will obviously help.

Grid size = { 240, 224, 288 }

226 x 112 x 39 = 987168 grid
33135950 grid points envelope culled
2463498 grid points bounds culled

That’s an odd grid size, possibly the problem. Like I said above, they should be in powers of 2. It’s also a lot of culled grid points, probably related to the odd grid size. Try manually setting the grid size and see if that helps.


(boddo) #8

i set gridsize to 256 128 64 in worldspawn, and it fixed my problems.
:slight_smile:
now i can get this map done with finally!

many thanks obsidian

!


(obsidian) #9

That’s a pretty weird rectangular lightgrid still. Might look odd on player models in places. You usually want the X and Y grids to be the same and the Z to be either the same or larger (since you don’t travel along the Z-axis as often).

But regardless, I’m glad it solved the problem.


(boddo) #10

Yeah, that makes sense. originally I just figured I would use the next power of 2 numbers that is right above the size of the lightgrid “226 x 112 x 39 = 987168 grid” so i went with 256, 128, 64.

I ended up doubling that to 512,256,128 but I should probably have done 512,512,256.
The lightgrid could be better, but I think its fine for the game (JK2).
I suppose you want the lighgrid aspect dimensions ratio to be somewhat similar to your maps aspect, so there’s no stretching of the lightgrid across 1 axis, more then another…

For the JK3 compile, I’m using 512 512 256 and its seems to all be clean and smooth now.

Cheers! Thanks!


(lal87hr781) #11

prada purseprada ukprada hand bagsmiu miumiu miu handbags


(yuanfenya) #12

Do you think it’s the light that’s attracting them? Mike and his pregnant wife live on a farm in a rural area in the west of England. No running water, no electricity, etc. One night, Mikes’ wife is begins to deliver the baby. The local doctor is there in attendance. "What d’ya want me to do, Doctor? " “Hold the lantern, Mike. Here it comes!” the doctor delivers the child and holds it up for the proud father to see. “Mike, you’re the proud father of a fine strapping boy.” “Saints be praised, I…” Before Mike can finish the Doctor interrupts, “Wait a minute. Hold the lantern, Mike.” Soon the doctor delivers the next child. “You’ve a full set now, Mike. A beautiful baby daughter.” “Thanks be to…” Again the Doctor cuts in, “Hold the lantern, Mike, Hold the lantern!” Soon the Doctor delivers a third child. The doctor holds up the baby for Mike’s inspection. “Doctor,” asks Mike, "Do you think it’s the light that’s attracting them?"Growth and change are the law of all life. Yesterday’s answers are inadequate for today’s problems --just as the solutions of today will not fill the needs of tomorrow. (Franklin Roosevelt, Averican president)More Games,joke,Guild Wars gold and famous. Click http://www.ygscn.net You will get more.