3rd Party Models/Media Chat / Physically Based Shader Project

Author
Message
uzi idiot
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 3rd Apr 2017 10:46 Edited at: 10th Apr 2017 18:41
Planned Features/Progress Report
Weapon Shader (WIP to establish all essential features before branching off to other shaders)
Character Shader
Static Shader
Entity Shader
Terrain Shader
Bug fixes
Expanded Dynamic Lighting (fix dynamic lighting problems, allowing up to 3 dynamic lights + muzzleflash)
Specular + Reflection
GGX Specular response (use physically based specular response for static and dynamic lights)
Approximated GGX Cubemap response (Use mip mapping and filtering to emulate the GGX response)
Diffuse
Lambert Diffuse (Use basic normalized dot(N,L) for low settings)
Oren-Nayar Diffuse (Use a microfacet based diffuse response, useful for rough hardsurface (Rock/Plastic)
Disney-Burley Diffuse (Use a subsurface based diffuse response, useful for rough softsurface (Cloth/Fabric)
Ambient
Emulated Ambient Bounce and Skylighting (Use SurfColor, AmbiColor, SkyColor and FloorColor to emulate bounce lighting)
Cubemapped Ambient Lighting (Use the cubemap for ambient lighting)
Matching BRDFs for lit and ambient lighting (Make lighting and materials consistent when lit and in shadow)
Extras
Sub Surface Scattering Effects (Use modified lambert shading and mipmapped normals to emulate light scattering)
Controls and Defines for enabling and disabling settings and features (use #define to control features for compatibility and performance)
Physically consistent settings and effects (Reduce the need for artist controlled lighting response)


Hi there,

Some of you might remember me from the FPSC forums a few years back. I've returned there a year ago and developed some PBR based shaders for the (now free) software, with extra features supported by the Black Ice Mod. I'm nearing my completion of them and thinking about bringing them over to Game Guru to help introduce modern graphics techniques to the engine and help teach it's users current gen practices for content creation, such as understanding reflections as a scale of roughness-smoothness.


My goal is to produce a series of shaders consistent with one another that follow basic Physically Based Rendering principles while fixing general problems with the default shaders.
These principles include Energy Conservation (As specular reflection increases, diffuse reflection decreases), Fresnel (Everything becomes 100% reflective at glancing angles), and Microsurface (a reflection's blurriness is defined by how rough or smooth the surface is)
Recommended Reading:
https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/
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/



These shaders however may give you 'less control' over the lighting response using the graphics sliders and settings. However this is because such control is not physically accurate. Settings such as 'Global Specular' will become completely redundant. Control of lighting is dependant entirely on the textures and the lighting that they receive, the shaders should always react the same.

However one advantage of Game Guru's shaders I noticed was the use of '#define' to change settings in shaders to reduce the amount of shaders necessary.
I will uses this system to allow for a wide range of settings to support a range of assets, from stock assets without PBR textures to custom assets with PBR specific textures.
I will also use this system to support a range of texture authoring methods and workflows, such as supporting both f0 specularity and metalness workflows. For further detail read here
It will also allow you to optimise your assets better as you enable or disable specular, normal mapping or cube mapping individually.



Currently I am experimenting with introducing the techniques into the stock "weapon_bone.fx" shader to understand how GG interacts with its shaders and have no real presentable progress so far, however the state of the FPSC shaders can be followed and seen at:
https://forum.thegamecreators.com/thread/219208
https://forum.thegamecreators.com/thread/217263

If something compiles on the first try. Something is terribly wrong.
granada
Forum Support
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 3rd Apr 2017 11:20
That's realy interesting ,and very cool to look at.we are getting spoiled here at gg at the moment,will defenatly be keeping a eye on this.thank you for working on this.

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
Errant AI
Forum Support
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location: [REDACTED]
Posted: 3rd Apr 2017 12:21
Nice! I'm very interested in anything that helps standardize GG's asset input with other engines. It might help incentivise artists who do stuff for Unreal, etc. to port to GG while helping GG artists prepare for expanding their own reach. Personally speaking, I use p3d.in (poor man's marmoset) to previs models and textures and it can be frustrating when remixing maps for GG and watching material fidelity go down the drain as a result. So, I'm really excited to see what you can bring to us.

Quote: "These shaders however may give you 'less control' over the lighting response using the graphics sliders and settings. However this is because such control is not physically accurate. Settings such as 'Global Specular' will become completely redundant. Control of lighting is dependant entirely on the textures and the lighting that they receive, the shaders should always react the same."


This feature has always confused me a bit. I always felt like I had to max it out to get of full range of spec out of most entities but doing so also would blow out spec effect on terrain and grass which (surprise, surprise) didn't support discrete spec maps and instead used some sort of arbitrary internal spec generation. I'm not entirely sure what the slider is meant to accomplish other than making some things look wet.
Gigabyte P67A-UD4-B3, Intel Core i7 2600K (passmark 8555), 16GB Corsair DDR3, EVGA GTX 970 SC (passmark 8637), Win10 Pro 64-bit, Primary monitor @ 1920x1080, secondary monitor @ 1280x1024
synchromesh
Forum Support
10
Years of Service
User Offline
Joined: 24th Jan 2014
Location:
Posted: 3rd Apr 2017 13:48
The fpsc work looks brilliant ....
Cant wait to see what you come up with in GG
The only person ever to get all his work done by "Friday" was Robinson Crusoe..
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 3rd Apr 2017 13:50
Will be a great asset for Game Guru. Cant wait to test them out when they are complete.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

uzi idiot
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 4th Apr 2017 02:56
Progress
Weapon shader seems to be taking shape, but it looks very strange to me. The specular looks a bit flat to me.
Ambient lighting also goes to black when too bright for some reason. I am having trouble getting the Burley BRDF to work with ambient so maybe that's the issue. (as I was uploading the video I found out it is.)

If something compiles on the first try. Something is terribly wrong.
Errant AI
Forum Support
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location: [REDACTED]
Posted: 4th Apr 2017 05:55 Edited at: 4th Apr 2017 05:56
The default lighting sliders are a bit iffy. Here's what I generally have been running...
https://puu.sh/v8H5C/ee748527e6.jpg
I've found these to show show weapon shader pretty well. Others will have setting they prefer.

Sent you a PM... may or may not be helpful.
Gigabyte P67A-UD4-B3, Intel Core i7 2600K (passmark 8555), 16GB Corsair DDR3, EVGA GTX 970 SC (passmark 8637), Win10 Pro 64-bit, Primary monitor @ 1920x1080, secondary monitor @ 1280x1024
uzi idiot
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 6th Apr 2017 01:15
Errant AI had been very generous to lend me his M92fs model to test out the shaders. Very cool so far!



If something compiles on the first try. Something is terribly wrong.
Errant AI
Forum Support
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location: [REDACTED]
Posted: 6th Apr 2017 01:57
Cool Can you explain to me which channels do what and how I need to go about AO (I had been baking it in)?
Gigabyte P67A-UD4-B3, Intel Core i7 2600K (passmark 8555), 16GB Corsair DDR3, EVGA GTX 970 SC (passmark 8637), Win10 Pro 64-bit, Primary monitor @ 1920x1080, secondary monitor @ 1280x1024
uzi idiot
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 6th Apr 2017 02:45
The S texture is used for a lot of things so the channels each serve a purpose if their feature is enabled. Ideal I want people to imagine it as an all round "surface" texture rather than a "specular" texture to detach it from last-gen terminologies and so that people understand it's purpose.
My idea was to have each channel define a property of the surface's materials.
Red channel is smoothness/gloss. However I will allow a setting that switches it to work with roughness instead, more like Unreal Engine 4.
Green channel is Ambient Occlusion. While GG supports AO anyway I kept this from my FPSC version.
Blue channel is Sub Surface Scattering. This is to control the strength of the SSS effect that can help make skin look more smooth.
Alpha channel is Metalness. I normally have this inverted so that textures are easier to view, but that's optional. I also plan on having it be the direct specular texture for the specular workflow option.

Here's a thumbnail showing how the M9's S texture's channels look.

Top is red. Middle is green. Bottom is blue.


The N texture is the normal map as always but I use the alpha for illumination.
However, like metalness I usually have this inverted so viewing the texture is easier.
I would have had the blue channel be ambient occlusion to make it a general lighting texture had I not already put it in the S texture.
If something compiles on the first try. Something is terribly wrong.
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 6th Apr 2017 04:11
Very cool. Cant to wait to try them out.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

uzi idiot
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 10th Apr 2017 15:57 Edited at: 10th Apr 2017 18:43
Progress!

I fixed some of the artifacting after finding the line
in DICE's papers on their PBR techniques for Frostbite. http://www.frostbite.com/2014/11/moving-frostbite-to-pbr/
I have no idea how it works, but it does. DICE, how do they do it?

I'm also adding their method for Reflection Occlusion using AO.
If something compiles on the first try. Something is terribly wrong.
Wolf
Forum Support
17
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 10th Apr 2017 19:19
okay. How do I get my dirty paws on early experimental stuff? Where do I sign up?
Errant AI
Forum Support
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location: [REDACTED]
Posted: 10th Apr 2017 20:22 Edited at: 10th Apr 2017 20:22
Was that the artifact causing the painted look?

Seems to be coming along nicely. I'm going to have to mess with trying to get some textures more deliberately targeted for this.

Eventually going to have to bite the bullet for a PS upgrade and Quixel, etc. when I get serious about targeting PBR :S

Do you think you'll be able to get effects like self-shadowing with this shader?
Gigabyte P67A-UD4-B3, Intel Core i7 2600K (passmark 8555), 16GB Corsair DDR3, EVGA GTX 970 SC (passmark 8637), Win10 Pro 64-bit, Primary monitor @ 1920x1080, secondary monitor @ 1280x1024
uzi idiot
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 11th Apr 2017 04:14
@Wolf
I'm hoping to soon start releasing the shaders in a kind of 'open beta' to encourage people to make content with them and unstanding how they work.
I'm just working on getting bugs sorted out and adding settings for people to mess around with.

@Errant
The artifacting was causing the white pixels on the fingers, but I don't understand why.
I really have no idea how to do shadowing or anything. I'd wait until the stock shaders get a feature like that before trying to add it.
If something compiles on the first try. Something is terribly wrong.
TazMan
GameGuru TGC Backer
13
Years of Service
User Offline
Joined: 20th Jan 2011
Location: Worldwide Web
Posted: 14th Apr 2017 12:00
This is something I have been waiting for, you can do a lot with _S, _N, _D and _I but if we had decent PBR in GG then we can make everything look so good. I know it is going to take a while to get everything done but it will be worth waiting for. Thanks for all the hard work.
HP Pavilion Laptop - AMD A8-4555M APU with Radeon(tm) HD Graphics - 1.6GHz, 8GB Memory, Windows 10 Home, 64-bit Operating System.

I've got something to say - It's better to burn out than fade away.
uzi idiot
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 15th Apr 2017 22:48
Progress!

Dynamic lighting is now fully supported.
However GG seems to lack muzzle flash lighting for some reason.



I think all I really need to do is fix up some of the ambient lighting errors and then start open beta.
If something compiles on the first try. Something is terribly wrong.
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 16th Apr 2017 05:16
I like it. Great start.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Preben
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 18th Apr 2017 16:10
"uzi idiot": This is some pretty interesting stuff , not sure why i did not see this thread before now


This is done to make sure the value is never zero , you must do something later that depends on non zero values ? funny how you can spot a coder, Lee would ALWAYS use a max() instead of this , and i would always use a clamp

Errant AI: self-shadowing is not currently possible , mainly because if we place the gun in the depth buffer it would cast a "funny" shadow on terrain/objects. a floating gun and hands , would look scary , i added a fast dither 5 shadow for the gun in this shader , this could be improved pretty simple as it currently use cascade 1 , "uzi idiot" try to change to cascade 0 and see if Lee is setting this in this shader , if so it will give a mush better shadow on the gun and without a fps drop, gun is always very close so perhaps cascade 1 is not really needed ? never tested this.

If we should have self-shadowing the gun and hands should be added to a "fake" player object , so the hole object "the player" dropped shadows, or a special depth buffer should be added only for the gun object.

Looking forward to check out the shaders
best regards Preben Eriksen,
uzi idiot
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 16th May 2017 06:53
PBR Public Beta 0.1


http://www.mediafire.com/file/59ta737z935octm/Public_Beta_0.1.zip


This is a little testing package for everyone to try out. I think it works fine but I'd love to hear feedback.

It features a retextured stock Uzi along with the weapon shader that it uses (and a few others that I haven't touched yet)
I've also included a PSD file so you can see how I did the retexturing, reducing lighting in the albedo and making the roughness and SSS texture

Hopefully it works fine for everyone
If something compiles on the first try. Something is terribly wrong.
granada
Forum Support
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 16th May 2017 09:19 Edited at: 16th May 2017 09:19
Will download when I get home,many thanks
For your work on this so far.looks great .

Dave
Windows 10 Pro
GeForce GTX 1050 Ti
AMD FX (tm)-9590 Eight-core Processor
31.96 GB RAM
1920x1080,60 Hz
PM
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 16th May 2017 14:12
Thanks. Will check it out.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

Ertlov
GameGuru BOTB Developer
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: Australia
Posted: 16th May 2017 15:38
very cool - but the cubemap can't be opened in gimp, it keeps saying "header error"
AMD FX 8Core @ 4GHZ - 16 GB DDR4 - 2xRadeon7950 - Windows 7 Ultimate
uzi idiot
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 16th May 2017 15:40
Yeah GIMP probably can't handle 32 dds files.

My new install of photoshop can't either for some reason. It used to work fine.
If something compiles on the first try. Something is terribly wrong.
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 16th May 2017 15:43
Yup, i'm getting the same.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
uzi idiot
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 16th May 2017 15:57
It should be viewable in the DirectX Texture Tool from Nvidia
If something compiles on the first try. Something is terribly wrong.
uzi idiot
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 14th Jun 2017 08:03
Has anyone made some cool stuff with the shader yet? I want to see how people are using it so far.
If something compiles on the first try. Something is terribly wrong.
Pirate Myke
Forum Support
14
Years of Service
User Offline
Joined: 31st May 2010
Location: El Dorado, California
Posted: 14th Jun 2017 16:07
Thought this was just the weapon shader. I could probably make something quick up to test them out.
Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz, 2400 Mhz, 4 Core(s), 4 Logical Processor(s), 8gb RAM, Nvidia gtx660, Windows 7 Pro 64bit, Screen resolution 1680 x 1050.

uzi idiot
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 14th Jun 2017 17:06
It is just the weapon shader. The rest are just the original shaders.
If something compiles on the first try. Something is terribly wrong.
Errant AI
Forum Support
18
Years of Service
User Offline
Joined: 24th Aug 2006
Location: [REDACTED]
Posted: 24th Jun 2017 00:21
@Uzi Idiot

I have a new weapon that I want to try with this over the weekend. Any chance you can send me the maps you used on the 92FS? I have the maps from the early test but not the later version.
Gigabyte P67A-UD4-B3, Intel Core i7 2600K (passmark 8555), 16GB Corsair DDR3, EVGA GTX 970 SC (passmark 8637), Win10 Pro 64-bit, Primary monitor @ 1920x1080, secondary monitor @ 1280x1024
World Class Multimedia
16
Years of Service
User Offline
Joined: 15th Aug 2008
Playing: Game Development
Posted: 24th Jun 2017 03:00
PBR in GG would be AMAZING.

Mike
YOU DREAM IT - WE CREATE IT!

www.world-class-multimedia.com

For world-class virtual instruments - www.supersynths.com
uzi idiot
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 26th Jun 2017 13:15
I'm actually wondering if a specular workflow would really be worth adding.
It would mean that the S texture would have to work by different rule (rgb being specular colour and alpha being roughness) which I think makes learning how to use the shaders a little inconvenient.
Also I wanted the shaders to be based on UE4 so that assets could be passed back and forth.
If something compiles on the first try. Something is terribly wrong.
Wolf
Forum Support
17
Years of Service
User Offline
Joined: 8th Nov 2007
Location: Luxemburg
Posted: 26th Jun 2017 13:33
Hey Uzi!

Just throwing this out there:

I understand that these PBR shaders are rather finicky to get working and probably take a lot of time but I'd like you to consider releasing an effect shader pack. Back in FPSC I misused a lot of shader effects for energy/water and light effects. Sadly all of these turn out black in GG. Just a pack of ray, fur and glowy shaders if you know what I mean. We could do a lot with these level design wise.
I'd understand if this would be too tacky for ya though.



-Wolf
uzi idiot
14
Years of Service
User Offline
Joined: 27th Dec 2009
Location: Who Knows?
Posted: 18th Jul 2017 15:25
How do I get in contact with the guys at TGC these days?

I really have no idea how the shadows in GG work and I need help.
If something compiles on the first try. Something is terribly wrong.
Belidos
3D Media Maker
8
Years of Service
User Offline
Joined: 23rd Nov 2015
Playing: The Game
Posted: 18th Jul 2017 16:00
Just send Lee an email at lee@thegamecreators.com he should be able to help you out.

Primary Desktop:
i7 7700,k NV1070 8GB, 16GB 3200mhz memory, 1x 2TB Hybrid, Win10.

Secondary Desktop:
i5 4760k, NV960 2GB, 16GB 2333mhz memory, 1x 2TB Hybrid, Win10.

Laptop:
i3, Intel 4000 series graphics, 6GB memory, 1x 500gb HDD, Win8.1.
Preben
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 19th Jul 2017 10:18 Edited at: 19th Jul 2017 10:56
Quote: "I really have no idea how the shadows in GG work and I need help."

Hi uzi , i worked with Lee on the shadows in the current release , mainly i made the shaders and Lee all the rest , so if its about the shaders just give me a PM and i will try to help you.

EDIT: forgot , i made a //#define DEBUGSHADOW ( in settings.fx ), you can enable this to see the different cascade shadow levels
best regards Preben Eriksen,

Login to post a reply

Server time is: 2024-11-21 21:13:27
Your offset time is: 2024-11-21 21:13:27