How to obtain the tree shadowing of core maps?


(Mateos) #1

Good evening,

Well, I’m in the process to optimize the Light phase for 1944 Nordwind 2.1; I finally fixed the red leak (The lighting was going through the different func_group’s around the surface light, so through an “entity”). I saved more than 100 seconds on selecting different light map sizes depending on surfaces:

  • Default: 256x256,
  • Terrain and related (Roads for instance): 512x512 (Like on Fuel Dump).
  • Surfaces with neat shadows (Shadows through the alpha channel of a fence, surface with a normal map): 1024x1024.

I have almost the same light-related Worldspawn variables values:

  • gridsize: 128 128 128
  • ambient 10 (Better than _minlight, which is non-recommended; FD and RL uses _minlight, Radar uses ambient)
  • _color 0.75 0.78 1.00
  • _minvertexlight 10 (For entities from what I read; same value as _minlight/ambient)
  • _mingridlight 40 (For Dynamic Lights from what I read)

Shader-wise, I’ve adapted the terrain and related surfaces shaders to Fuel Dump shaders. They’re the same.

And, still… pixelated shadows. So, the only thing left I see is -light arguments/levers used by SD.

[U]/![/U] Note that on Fuel Dump remakes such as Fuel Dump Mod, the shadowing is a bit pixelated as well!

I currently use the default -light -faster line of GtkRadiant (Just lowered 512 to 256 for lightmaps).

Does someone know if it('s the compilation levers which make the difference, if yes please share them, if not I go take a rope @@

Thanks in advance,

Mateos


(Mateos) #2

Hello,

I spent my afternoon testing several -light arguments on a little map with normal trees, and it seems -samples 2 smooth the shadowind; But on Nordwind 2 there’s still “holes” in the middle of shadows, but smoothed… So let’s say it’s fixed >.>

Now, I have a little problem with q3map_lightmapmergable: without, on some shadows, the edges of the terrain cut the lightmap and then the edge is visible and “split” the shadows; With, the shadow isn’t splitted (Since the whole terrain is stored in a single 512x512 lightmap), but the patches doesn’t like it…

Screenshot without:
http://www3.picturepush.com/photo/a/12207056/1024/Wolfenstein-Enemy-Territory-Mapping/2013-02-16-152638-supply-we.jpg

Screenshots with:
http://www5.picturepush.com/photo/a/12207058/1024/Wolfenstein-Enemy-Territory-Mapping/2013-02-16-161330-supply-we.jpg
http://www4.picturepush.com/photo/a/12207062/1024/Wolfenstein-Enemy-Territory-Mapping/2013-02-16-161339-supply-we.jpg
http://www5.picturepush.com/photo/a/12207063/1024/Wolfenstein-Enemy-Territory-Mapping/2013-02-16-161405-supply-we.jpg

(No no, you don’t recognize the map :P)

On second shot, what can be seen:

  • First tree has no shadow.
  • Tree on the right, has a cutted one, on the hill.
  • The shadow bordering the wall has a enlighten part between wall and shadow.
  • Inside… Only patched this time have a shadow. While in the first part of the map the terrain has a shadow cutted by a patch @@

With or without -patchshadows, same result, no idea what causes this… I prefer patches than brushwork, it’s done this way on Fuel Dump and it works there >.>

Edit: q3map_nonPlanar fixed it, I can used merged lightmapping now. Still, why/how does it work on Fuel Dump? o.o

Edit 2: Still, q3map_lightmapmergable generated enlighten parts in the middle of shadows, only if front and on a side of the Depot… I’ll edit and import lightmaps manually in BSP then, hope it will work ^^’


(Mateos) #3

[QUOTE=Mateos;428046]Edit: q3map_nonPlanar fixed it, I can used merged lightmapping now. Still, why/how does it work on Fuel Dump? o.o

Edit 2: Still, q3map_lightmapmergable generated enlighten parts in the middle of shadows, only if front and on a side of the Depot… I’ll edit and import lightmaps manually in BSP then, hope it will work ^^’[/QUOTE]

Triple-post in case it could help someone in the future: I was getting the Edit 2 issue because I textured a surface with the same shader as the terrain above it, so it was kind of applying a shadow to it, and in the trajectory behind this object it wasn’t doing the same… So I textured all the non-terrain surfaces with the base texture, and now shadowing is fine.

Next issue I had was the lightmap supposed to be applied in the tunnel under the Depot was leaking at the surface; Textured inside with the base texture again, fixed :slight_smile:

EDIT: I thought a bit more about it, and I’ve a better explanation. Both surfaces were forced to be stored on a single lightmap file, since it was written in the shader, and so the compiler had to deal with 2 superposed surfaces. Since the lightmapping adds shadowing and not the inverse, the upper part was lightmapped while the one “under” (According to the sun trajectory during calculation) could never have been lightmapped by the compiler… Logic :slight_smile:

So I’m finished with the lighting issues. Still not with tree shadowing on Nordwind 2 :slight_smile:

I’ve been reading the shader manual with lighting-related parameters, and q3map_lightmapSampleOffset seems to be good… Gonna give it a try.