VERSION 3 RELEASED
General fixes and corrections
Disney renormalisation of visability funtion to prevent reflections from becoming too bright or 'hot'
New HDR cubemaps included to experiment with. Recommend CubeMapGen settings updated.
VERSION 2 RELEASED
New example media: Doom Segments and FPSC X10 Raknos character
Now features muzzleflash and Black Ice Mod moving light support.
General fixes and corrections
Cubemaps provided are now correctly filtered. Recommend CubeMapGen settings updated.
[SHADERS DOWNLOAD] http://www.mediafire.com/download/d8cuz55sy82k5kk/Physically_Based_Shading_Shaders_V3.zip [DOWNLOAD]
[SHADERS AND MEDIA DOWNLOAD] http://www.mediafire.com/download/lzoruoo7j8704tl/Physically_Based_Shading_Shaders_and_Media_V3.zip[DOWNLOAD]
Credits:
Mark 'bond1' Blosser for the shader original code
TCG for Akio and Raknos characters along with the minigun weapon
id Software for chaingun sound effects
In recent years there has been a widespread adoption of a more regular and industry standard lighting and shading model. This has become known as physically based shading.
Recommended reading:
https://www.marmoset.co/toolbag/learn/pbr-theory
https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/
http://blog.selfshadow.com/publications/s2015-shading-course/
http://blog.selfshadow.com/publications/s2014-shading-course/
http://blog.selfshadow.com/publications/s2013-shading-course/
http://blog.selfshadow.com/publications/s2012-shading-course/
Physically Based Shading is a technical pipeline for rendering the is based upon real life physical properties.
Albedo,
Fresnel,
Roughness,
and Metalicness
By using energy conserving and physically based shading models these properties are used to create more life like renderings in a more reliable and useful way.
It captures the dramatic dynamics of the real world more reliably than traditional methods of shading.
Unfortunately FPSC does not have the requirements for a full PBR pipeline.
It lacks any kind of cubemap rendering, which is essential for capturing the reflections and ambient light in a scene.
It also lacks HDR render outputs to make full use of the dynamics and effects of PBR. This improves the dynamics offered by cubemaps.
However despite these drawbacks I felt like I should at least produce some shaders and content to demonstrate these techniques.
So here is a set of PBR inspired shaders for characters, props and segments.
All shaders are now gamma correct. This is essential for any kind of digital rendering to look accurate.
Every shader has full support for up to 4 dynamic lights, static entities and segments included.
Every shader uses a GGX specular response, a widely adopted specular BRDF favoured for its smooth falloff.
Every shader has the option to enable Oren Nayar diffuse lighting, a more physically accurate diffuse lighting solution. However this is noticeably more expensive.
The _sss_full shaders have extra features in the specular texture. Red is roughness, Green is ambient occlusion, Blue is subsurface scattering (only works with static lights currently) and Alpha is metalicness.
General notes
Specular is in gloss form (white is shiny, black is matte). Most PBR uses roughness (white is matte, black is shiny), however I favoured gloss to make the transition to PBR more simple.
[BONUS]
1)I have included a water shader that is more realistic. It removes the water colour changing the reflections, which is not physically accurate at all.
Reflections and refraction are better balanced with a more accurate fresnel.
2)Tonemapping and Colour Grading post process shader included.
https://forum.thegamecreators.com/thread/217274
The shaders and the textured needed are as follows:
character_norm_spec_alpha.fx:
This shader should be the main work horse for your characters.
Normalmapped with GGX specular
//"texture_D.dds" diffuse texture
//"texture_N.dds" normal map texture, alpha is illumination (inverted, black = bright)
//"texture_S.dds" gloss map texture, alpha is metalicness (black = metal)
character_norm_spec_cube_alpha_sss_full.fx
This is an entirely experimental shader. It uses cubemaps, which FPSC does not support outside of weapons, and the texturing might be confusing.
It does however work perfectly fine.
//"texture_D.dds" diffuse texture
//"texture_N.dds" normal map texture, alpha is illumination (inverted, black = bright)
//"texture_S.dds" gloss map texture and material texture, alpha is metalicness (black = metal), red is roughness, green is ambient occlusion and blue is sub surface scattering
//"texture_CUBE.dds" cubemap texture
character_norm_spec_illum_alpha.fx
This uses an _I texture for illumination instead of using the normal map's alpha
//"texture_D.dds" diffuse texture
//"texture_N.dds" normal map texture
//"texture_S.dds" (enities) gloss map texture, alpha is metalicness (black = metal)
//"texture_I.dds" (enities) illumination
character_norm_spec_shadow_2bone_alpha.fx
This is an optimised version of the other shadowed shader. It might produce deformation in models not rigged to only 2 bones.
//"texture_D.dds" diffuse texture
//"texture_N.dds" normal map texture, alpha is illumination (inverted, black = bright)
//"texture_S.dds" (enities) gloss map texture, alpha is metalicness (black = metal)
character_norm_spec_shadow_alpha.fx
This is for if you want planar shadows for your characters.
//"texture_D.dds" diffuse texture
//"texture_N.dds" normal map texture, alpha is illumination (inverted, black = bright)
//"texture_S.dds" (enities) gloss map texture, alpha is metalicness (black = metal)
prop_norm_alpha.fx
This shader has no specular, only diffuse. Might be useful for optimisation
//"texture_D.dds" diffuse texture
//"texture_N.dds" normal map texture, alpha is illumination (inverted, black = bright)
prop_norm_spec_alpha.fx
This should be your primary shader for dynamic entities and props.
//"texture_D.dds" diffuse texture
//"texture_N.dds" normal map texture, alpha is illumination (inverted, black = bright)
//"texture_S.dds" (enities) gloss map texture, alpha is metalicness (black = metal)
//"texture_R.dds" (weapons) gloss map texture, alpha is metalicness (black = metal)
prop_norm_spec_cube_alpha.fx
This should be your primary shader for weapons.
Weapons are the only thing in FPSC that seem to use cubemaps, however they only use the one in their folder.
I have included a general cubemap for use on weapons. Settings for CubemapGen are also included.
//"texture_D.dds" diffuse texture
//"texture_N.dds" normal map texture, alpha is illumination (inverted, black = bright)
//"texture_S.dds" (enities) gloss map texture, alpha is metalicness (black = metal)
//"texture_R.dds" (weapons) gloss map texture, alpha is metalicness (black = metal)
//"texture_CUBE.dds" cubemap texture
prop_norm_spec_cube_alpha_sss_full.fx
Another experiemental shader. However this one is for props, so can be used on weapons.
//"texture_D.dds" diffuse texture
//"texture_N.dds" normal map texture, alpha is illumination (inverted, black = bright)
//"texture_S.dds" (enities) gloss map texture and material texture, alpha is metalicness (black = metal), red is roughness, green is ambient occlusion and blue is sub surface scattering
//"texture_R.dds" (weapons) gloss map texture and material texture, alpha is metalicness (black = metal), red is roughness, green is ambient occlusion and blue is sub surface scattering
//"texture_CUBE.dds" cubemap texture
prop_spec_alpha.fx
Another optimised shader. Illumination is now stored in the specular texture.
Illumination is set to zero by default, edit the shader to enable it.
//"texture_D.dds" diffuse texture
//"texture_S.dds" (enities) gloss map texture, alpha is metalicness (black = metal), red is roughness and blue is illumination (disabled by default
//"texture_R.dds" (weapons) gloss map texture, alpha is metalicness (black = metal), red is roughness and blue is illumination (disabled by default
segment_norm_spec.fx
This is just Bond1's segment shader, but it uses the afore mentioned techniques.
//"texture_D.dds" diffuse texture
//"texture_I.dd" specular texture
//"texture_N.dds" normal map texture
static_norm_spec.fx
Also just Bond1's static shader updated.
Textuing for this one is confusing. I'm sure his original thread has a guide for it.
//"texture_D.dds" diffuse texture
//"texture_N.dds" normal map texture, specular mask in alpha channel
//IMPORTANT NOTE: Because of an oddity with FPSC,also requires a DUPLICATE "texture_N.dds" texture renamed "texture_I.dds". All textures must be located in texturebank folder
If something compiles on the first try. Something is terribly wrong.