Support PVKII!
Home
» Latest News
» Archives
» PVKII Team
» Join the team
PVK II
» About
» Classes
» Maps
» Game Modes
» Player Guide
» FAQ
» In-Game Media
» Server Stats
Downloads
» Game Files
» Wallpapers
» Music
» Videos
» Custom Maps
Community
» Dev Journal
» Forums
» Steam Group
» Moddb Page
» Contact
Join Us on IRC!
» Quakenet
» Gamesurge
You are running v3.0.1 of IPB News
Archives

Post 2.3 Shader Enhancements
By: CrackaPolly
On: Sun, 31 Jan 2010

Been a long time since the last dev journal so here is something relating to post-2.3 work.

Part of our current plans for things to be done after 2.3 is to overhaul the visual. This is going to include improving some of the maps where there are areas lacking in detail as well as in model detail. I've been doing some work with the shader sdk to improve some of the shaders we use.

Firstly, originally in one the new maps for 2.3 we wanted to use a video on some geometry to perform a much more visually pleasing job of drawing a rapidly changing texture. So to facilitate this I wrote a new special entity prop_dynamic_video to allow a mapper to specify a BIK video to use as the texture of a model. While in the end we did not use this in the map, the code will remain and made it into the 2.3 patch. Basically a few things need to be taken to care when putting a video onto a model. The UV mapping of the default texture needs to fit perfectly the necessary rect that the video takes up in a way that the video is contiguous. Although it is theoretically possible to do a more complicated UV map and author the original video with all the frames keeping in mind the UV map. In this picture the reason for the green checkboard is because this model was not authored with video on it in mind and explains why the UV map needs to fit only the subrect of a whole texture that the video will be best fit to in a 2 exponential sides only textures. (Also the BIK will output the audio into the world making syncing of audio to video not an issue, and it will loop)



With post-2.3 I have been looking at some improvements to the character shading. In particular I have worked on implementing an improved model for rendering specular highlights. The lighting model it uses is known as the Cook-Torrance model with a Beckman Distribution for the roughness factor into the main model. I believe Orange Box is using the Blinn-Phong model. Here gives an explanation of the different lighting models http://en.wikipedia.org/wiki/Specular_highlight.

The benefits of using this lighting model is that it better approximates the specularity much better than Phong shading. The best case situations of this model are with metals and plastics, but it works great across many applications. In implementing it I also kept the support for the rim lighting term they have in Orange Box, as well as Base Texture tinting of the specularity which is useful for better simulating gold and things of that nature. I replaced the rim mask with a lightwarp mask because rim mask is unused and having a lightwarp mask is important to allowing better skin rendering approximation when you have skin and other parts of the model on the same texture which many of the player models do.

In this new lighting model there are two main parameters which affect how the specularity will look.

a. Roughness - This is a measure of how rough the material is. To keep consistent with phong for easy transfer of phong exponent texture I have this setup where black is extremely rough texel and white is extremely smooth texel.
b. Reflectance at normal incidence - This is sort of like a phong boost, but it works in a different way. As the direction of the light approaches the normal of the surface of the model it will be brighter. As this value goes up you will see overall a brighter specularity, but not at an equal distribution, light that is hitting the model close to its normal will be much brighter than light that is perpendicular to the surface normal. I represent black as 0 reflectance value and white as a 10.0 reflectance value.

The main method of using these new parameters is through a texture I call the RTNL Texture. Which just stands for Roughness/Texture Tint Mask/Reflectance at Normal/Lightwarp Mask corresponding to the RGBA channels of a texture. Here are some examples of the comparing the new lighting between no specular, and phong specularity:


With the heavy knight there is a drastic difference mainly because metal is one of the best case scenarios for this lighting model. Some things that are not easily seen in a picture are that with this new lighting it helps to make the texture look more gritty because I used a non-uniform roughness across the armor so that as light passes around the model you will see parts that take longer to fully specular in comparison to other parts. (Kinda hard to explain, but on the helmet you can sorta see that dirtiness in the specular) Also this comparison is missing a comparison of the chain mail part which is why it is constant in all 3 images.


With the archer you can see his face is rendered in a much more realistic fashion, other areas of the specularity are generally much more subtle because the roughness in this case is pretty low, but overall is brighter and in motion the specular results are much more divergent.


With the captain we can see the skin is also render much more realistically. Also his buttons and other gold objects produce much better specularity and use a tint mask to look more like gold.


With the parrot I used a special lightwarp texture to better simulate the depth of the feathers, essentially it is a high density stair stepped effect. He is also getting specularity which makes him match the lighting of the scene much more properly.

I've also done some work on another refract shader which takes into account the object geometry rather than relying on a normal map to refract with. This is useful for bottles or ice statues where the geometry needs to be refracting and there is no normal map so to speak.

Comments(20)


You Look Like You've Seen A Ghost
By: CrackaPolly
On: Tue, 17 Feb 2009

Been a while since any dev journal so here is a new one. This is about the expression system that will be in 2.3

The system works by monitoring the player state by measuring things such as health, time since combat, if they were hit recently, etc. and generates a player state similar in ways to how an AI works. This state is then used to chose a particular facial animation to apply as the base facial layer. Next the game also has an additional layer for very quick facial scenes such as when you are hit, or when you pickup food, etc. Finally on top of that are the vocal scenes. These scenes are to be authored with mainly mouth movements with only minor expressions baked into them since our system will already be supplying the majority of the facial animation already. This will make the characters feel more alive as they duel and enter all sorts of mayhem.

Here are some samples:












Comments(58)



 
Mod of the Year Awards




Gamers
Fire
Jurassic Park
Thawktech.com