Jump to content

vertexlighting on static props in source - help!


Pericolos0

Recommended Posts

So I hear that source now supports proper per-vertexlighting with self shadowing in static props, like unreal basically. Has anyone been able to get this to work? I can't find any answers on it, yet i know it has to work, i've seen it in episode 2. I'm trying to create some rock models and get them to light properly, but they just seem to take light from their origin point, like in old versions of source. enabling or disabling "disablevertexlighting" and "disableselfshadowing" doesnt seem to make any difference. Anyone have any clues?

Link to comment
Share on other sites

Put,

-staticproppolys -staticproplighting

in the $light_exe path of expert compile mode. Those values in the prop_static don't have any affect unless these two lines are ran in the compile. Also, make sure they go before -game. Should do it.

Why this isn't done by default yet is strange.

Link to comment
Share on other sites

thanks, but it doesn't seem to make much difference though :(. Is it possible that it just doesnt work with a light_environment? It seems to be working with a point light entitiy i placed, but im not sure..

heres a pic of my current situation:

test10001.jpg

you can see i placed an orange light entity in the shadow area, it seems to be lighting the rocks and rockets nicely, but the environment light doesnt have any effect on the props self shadowing..

All these models have pretty high tesselation so they should have nice vertexlighting.

Link to comment
Share on other sites

As I understand it there's an ambient cube generated every unit or so in the map (1x1x1 envmap with a color on each side for directional lighting) that is a combination of the sum of all the light sources at that point in space. The model is lit according to the closest ambient cube to the pivot of the model.

-StaticPropLighting should override the pivot lighting method and make all the models per-vertex lit (you should see an extra phase for it in VRAD if it worked).

-StaticPropPolys is supposed to get rad to use the model itself for shadows rather than the bounding box, render time go way up when you use this.

valve wiki descriptions here

http://developer.valvesoftware.com/wiki/Vrad

Link to comment
Share on other sites

I got it to work now. I turned off the normal map in the material file, and it worked properly. Seems like the source engine is still really really ancient. Unless there is a special material setting that makes normal maps work with vertex lighting, I'm going to have to use my oldskool texturing skills to make these rocks look cool ;o. But I guess normal maps+static lighting will always be a problem, it's still a big issue in unreal3 aswell..

Thanks erratic and spicytanuki =)! If anyone more info on this or tips, would be appreciated very much! Does it work with lodsteps?

Link to comment
Share on other sites

yeah sure

without normalmaps:

test10002.jpg

with:

test10003.jpg

you can see in the first picture the lighting is correct, with shadows in the rock creases and rock casting shadow on rock.

In the second picture, backfaces are lit, and the meshes just take their lighting info from their origin point.

It looks kinda nice in the first pic, just a shame theres no normal maps.. source is really showing its age. I think i have some tricks up my sleeve though to make the rocks look kinda "nextgen" =)

Link to comment
Share on other sites

That was an interesting find, I personally never use normal maps in Source just due to the lack of compression on them and that they just dont look that good in the engine either.

I think you can get good looking results now with the added phong shading, but it only really works in certain situations and with certain materials, like metal. And it needs to be on a prop without shadows ofcourse :(. And yeah the lack of compression is a pain, 4mb(!) for a 1024*1024 nm. There has to be a way to compress them better in source.

Link to comment
Share on other sites

afaik the normalmapping selfshadowing only works on dynamic light sources, such as the flashlight. there are no "real" normalmaps used in ep2 but normal-holding textures with directional ambient occlusion to render out the perspective shadow drawing implied by one or more dynamical lightsources. kinda strange the standard lightning doesn't work out in this case though but I'm sure there's a workaround for this as well. On the texture size problem: you can easily compress the textures, as mino mentioned, with the standard compression methods of vtex.exe.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...