Hey all, I saw this very interesting shader option for rim lighting: http://developer.valvesoftware.com/wiki/$rimlight It would be greatly appreciated if someone felt like trying it out and making some comparison shots to see what it gives. Perhaps it'd be best to use Empires 2.31 (non-Steam) for this because the current Steam version has some issues with custom files at the moment.
i doubt that it would add something you notice in a real game. distances are too big for such a gimmick ...
Fucking, that is the shit I wanted from Modern Warfare 2 to make players clearer, I had no idea what it was. Also, I just saw "rim" and "make it a sticky".
Yeah, I like listening to Valve's commentary for their games. Such subtle mechanics, like rim shots lighting, can accomplish huge things, these guys are amazing. http://www.youtube.com/watch?v=7OZcc4n_Y2U 0:24, Valve TF2 Team talks about color and other visual things that affect gameplay. "rim lighting" was specifically mentioned at ~1:20, but I suggest listening to the entire visual part from 0:24. Hell, the entire series is pretty awesome, but that specific part is relevant. PROTIP: These are where the gayben jokes came from.
I think that's kinda built into phong, or at least the same sort of effect is often achieved with phong, you'd need to set up some world models for phong first, as far as I know none of them are, leastways not that I can tell.
rimlight with exponent 10, just looks perfect. Demented, did you notice anything special while the gun animations were playing?
well i guess you would have to restrict this lighting to the outlines of an object only. As it looks rather stupid, reflecting light where it shouldnt get to if you realize that you could actually keep the values like in the standard rim light picture, as it is some eyecandy that wouldnt have to be used that subtle
It was only playing the (perfectly still) idle animation and looked exactly like the screenshots. The rimlighting is an extension of the phong highlight, so whatever applies to the phong will have a corresponding effect to the rim light.
well you see it on the gun model, now do that on a tank 20m away from you that moves at full speed. you might not even notice the difference ... it might appear a bit brighter colored as a whole, worth the extra processing?
"rim lighting" is just another pass of phong with different exponent. What Demented did was adding another phong with strength so high that whole "dark metal" material turned into christmas tree exposing low res textures. Here's shader code: (if you don't understand you're not the target) Code: void SpecularAndRimTerms( const float3 vWorldNormal, const float3 vLightDir, const float fSpecularExponent, const float3 vEyeDir, const bool bDoAmbientOcclusion, const float fAmbientOcclusion, const bool bDoSpecularWarp, in sampler specularWarpSampler, const float fFresnel, const float3 color, const bool bDoRimLighting, const float fRimExponent, // Outputs out float3 specularLighting, out float3 rimLighting ) { rimLighting = float3(0.0f, 0.0f, 0.0f); float3 vReflect = reflect( -vEyeDir, vWorldNormal ); // Reflect view through normal float LdotR = saturate(dot( vReflect, vLightDir )); // L.R (use half-angle instead?) specularLighting = pow( LdotR, fSpecularExponent ); // Raise to specular exponent // Optionally warp as function of scalar specular and fresnel if ( bDoSpecularWarp ) specularLighting *= tex2D( specularWarpSampler, float2(specularLighting.x, fFresnel) ); // Sample at { (L.R)^k, fresnel } specularLighting *= saturate(dot( vWorldNormal, vLightDir )); // Mask with N.L specularLighting *= color; // Modulate with light color if ( bDoAmbientOcclusion ) // Optionally modulate with ambient occlusion specularLighting *= fAmbientOcclusion; if ( bDoRimLighting ) // Optionally do rim lighting { rimLighting = pow( LdotR, fRimExponent ); // Raise to rim exponent rimLighting *= saturate(dot( vWorldNormal, vLightDir )); // Mask with N.L rimLighting *= color; // Modulate with light color } }