HLMS_DS Demo
Posted: Sat Apr 23, 2016 9:35 pm
The JSON update:
Windows (Should run right out of the box):
https://www.dropbox.com/s/5l4fu0kf6yjdr ... s.zip?dl=0
Linux (Should run right out of the box):
https://www.dropbox.com/s/a4ta426a3yde4 ... x.zip?dl=0
Source:
https://github.com/White-waluigi/HLMS_DS
Gallery:
http://imgur.com/a/pVATq
Its almost been a year hasn't it? Well I barley had time to work on it, it has been a stressfull time. I will try to update a lot more frequent from now on, I promise. But I did implement quite a bit I think:
-JSON Materials:
The main feature I think. Users are able to create a list of all necessary ressources for the material they wish to create. All textures, Parameters, Settings, etc. Then they can combine them in a piece of shadercode to create a completely new effect. In the Demo you will find some basic water, a glowing statue and creepy mask that can only bee seen through a mirror.
-Shadow improvements
-Lots of bug fixes
-bigger Demo world to show off the Directional PSSM Shadows
-Fully dynamic Datablocks
Next I'll probably work on Screen Space Reflection, imporving JSON materials, fancier Demo, optimization and the ability to create custom light materials, so users can create all kinds of crazy lighting effects. Also some decent documentation.
Also I have uploaded the Source code to github now, so people can look at the progress or lack thereof in real time. If anybody is interested, I can make the code build able with CMAKE, so others can experiment with the code.
I'm looking forward to your feedback!
***********************February 10.th 2017******************************************************
After way too long, here's the newest version of my Deferred Shading HLMS along with a new Demo.
Here's the Windows version:
https://mega.nz/#!eZ42XLYC!IUqhgMF-n3nK ... wXcqreaCjA
Here's the Linux Version +Source
https://mega.nz/#!SUpV2DYY!C33-W0U7BLbc ... JoGDPsjoLc
Screenshots
http://imgur.com/a/1slfR
implemented features
- Dynamic materials
- Light geometry based Deferred Shading
- Normal, Specular, Alpha, Diffuse and Glowmaps
- Custom shader code for Materials
- Dithering Transparency
- Debug Views
- Shadows (not finished)
- Configurable Textureunits (partial)
- Animated Textureunits (partial)
- Antialiasing (FXAA that doesn't suck)
- Reflectivity (Spheremaps for now)
Missing features
- Custom Material Templates
- SSAO
- Rendering other HLMS Materials afterwards (rebuilding the depth Buffer)
- Full Vertex Shader (its pretty basic right now)
- More Lighting Techniques
- Light Materials
- Unreal Style Material Propertys with custom shader code
- DX support
Shadows:
Simple filtered depth shadows. Uses HLMS standard SHadow System.Most of my time went into this, since it was a bit of a pain to figure out how to make it work.
There are a few Problems that I have with Shadows right now. I can't figure out how to make it work with Alpha Textures, since HLMS-Shadowcasters don't have any UVs and I can only use 1 Material for every shadowcaster. Also I coldn't make native depth textures work like in HLMS-PBS, but I'l figure that one out in time. And the filtering is broken on Intel GPUs, and I have no Idea why.
FXAA
Simple FXAA post processing, nothing special really, looks good enough. I'm thinking of linking it to Ogres FSAA, so if that one isn't 0, the FXAA gets enabled, since FSAA with DS is a pain in the ass.
Texture Units
If extended the Texture Unit with some basic animation features, like translating the Texture Matrix, rendering animations with multiple Textures.
You can also choose which UV the Texture gets mapped to.
Reflectivity
Basic Spheremap that gets mixed with the diffuse component.
Things that are planned for the immediate future
More advanced Lighting
The current lighting is basicly the same I used for my old Deferred Shading project, It really needs to be updated, I'll probably steal a lot of code from HLMS_PBS
Ligth Materials
It becomes clear that the Lights need to be more configurable, to allow for things like Volumetric Lighting, Sunrays, Gobol lighting, HDR, Shadow Bias, Shadow Filtering, Shadow depth etc...
I'll probably implement it as soon as I figured out how to make JSON Materials work. I'll probably use getUserAny for this
JSON Materials
I think JSON is the best format to use for the Materials and Later, material templates. Probably the next thing I'll work on
And the rest of the implemnted section
Known Bugs:
-Crash on Exit
-Shadows broken on Intel Cards
-won't run on <16.04 because of boost 1.58
-Petter Panning on a lot of objects in the Demo
If you have any ideas, questions or Bugs, please report them in this thread
**********************23 Apr 2016*********************************************
Heres the Demo for my HLMS implmentation of Deferred Shading. I know it took forever (I wanted to be this far back in November), mainly because I kept running into Problems and starting from scratch twice.
But I think I added some interesting concepts for dynamic and expandable Materials, which Im going to explain further down in this thread.
Also my HLMS still needs a lot of work, this is just a little Demo of how far I got.
implemented features
- Dynamic materials
- Light geometry based Deferred Shading
- Normal, Specualr, Alpha, Diffuse and Glowmaps
- Custom shader code for Materials
- Dithering Transparency
- Debug Views
Missing features
- Shadows
- Custom Material Templates
- Configurable Textureunits
- Animated Textureunits
- Antialiasing
- SSAO
- Rendering other HLMS Materials afterwards (rebuilding the depth Buffer)
- Full Vertex Shader (its pretty basic right now)
- More Lighting Techniques
- Reflectivity (SSR and/or Cubemaps)
- Unreal Style Material Propertys with custom shader code
-DX support
I might add more stuff here later
Here are some Screenshots:
http://imgur.com/a/MJUaz
Heres the Download Links (Please report Bugs, they are debug builds for the moment, I have a nasty reallease bug atm, also, crash on exit, Linux versions includes full source)
Windows:
https://mega.nz/#!SwQkzJjT!BAkglgoStTfm ... C6w6u6HrZE
Linux+Source:
https://mega.nz/#!6g5SzDJD!l3P8DxmuRgq7 ... HK5X1rAoZE
Heres some Info on the Stuff thats already here:
Light geometry based Deferred Shading
Everytime a lght geds added, LightManager will create a CustomRenderable called a DSLight. This DS Ligth will have have a Mesh that stretches over any area that the corresponding Light could reach. This custom renderable will receive a standard DS Datablock with the LightDatablock Template . Within this, it will put all the propertys needed to render the Light as Vec4 Params.
HLMS will also bind the GBUffer-Texture to them.
Currently thers a little Problem when the User adjusts the Light Range or deletes a Light at runtime.
Since I have no way to detect if a Light was modified or removed, I can't alter its settings.
Also, later I'd like to add the Gbuffer-Texture as an AutoParamTextureUnit, same with the Shadowmaps, to make Custom Light Materials possible.
So Users can also implement custom Templates for Custom Ligths without changing the acutal HLMS_DS source code.
dynamic Materials
Since they are dynamic, they can't use the const buffer pool, so they are just Const Buffers. They are composed of a number of TextureUnits, AutoParams, Property Params, Vec4 Params and PieceParams. These are defined in the Datablock the Users sends the HLMS. For each on theres a corresponding type in the Materialtemplate. Materialtemplates are either a C++ Class or a DatablockTeamplate (later is not implmented yet). Theres a Lightdatablock template and a GBufferdatablock Template. They add the types they support in a function called initializeParamTypes(). For the Gbuffertemplate these are i.e diffuse, glow, glowmap, diffusemap etc. and for Lighttemplates these are Lightpos, LightDiffuse, LigthSPecualr, SpotLightAngle etc. These Types are then read as Values from the Datablock data and Send to the GBuffer, if the Material is dirty.
Vec4Params are Parameters which are compromised of 4 or less float values i.e diffuse, TextureParams are Textures i.e NormalMap, PropertyParams are Propertys i.e IS_AMBIENT_LIGHT and PieceParams are Pieces i.e custom_post_material.
This way, its much easier to add more Parameters to Materials without having to edit much code.
Later these Materials should be extendable using some form of css textfile.
A User could create Unreal Style Materials where he would define all the Needed textures, all the settable propertys, automatic paramters (time for example) and the necassary shader code that would modify the material properties to create a new Material within Deferred Shading, inside a file and another user could load it by setting a template paramter in a standard DS Datablock.
Dithering Transparency
Ugly as hell way to create Transparency. Later I'd like to make sure users can use other HLMS to create Forwarded Alpha Materials so it actually looks decent. Once I was done I was really dissapointed by the Visual quality of dithering. I could be kinda usefull to phase in distant objects as you move closer to them, Far Cry 3 style, create 0-1 alpha Materials (leaves) or maybe to create a cheap teleporter effect.
Debug Views
You use f6 and f7 to switch between different Debug Modes for the Renderer.
Heres some Info on Stuff I wan't to add
Shadows
The way I wan't to add shadows (and other automatic or intern textures) is a little bit special. I'd like to create AutoParamTextureUnits for that. These are TextureUnits which are automaitcly added and updated, simsilar with the existing Vec4AutoParams. So that other Materialtemplates could easily include or exclude them for whatever reason.
So Screen Space Refection Materials for instance could bind a SSRAutoParamTextureUnit, which includes a rendered version of last frames fully rendered scene and use it to create a reflection effect on the ground.
Currently I'm not entirely sure how to implement this, but I have a rough idea, is definitly the next thing on my list.
Configurable Textureunits
The current Problem I have with texture Units (and Datablocks in general), is that you can only have one property and one Value. For TextureUnits in particular, this removes a ton of features from the 1.0 version of Ogre, i.e animations, Filtering, texture_coordingates, etc. . I had to awkwardly use nested one-line Datablocks to create AutoParams.
I think I would be a good idea to allow a datablock like that:
datablock a{
param {
paramb valb
paramc valc
paramd vald
}
}
So that those things could be added back into the HLMS. It might also prove usefull for Datablock Templates.
AA and SSAO
Will probably need to be a postprocessing anti aliasing at the end of the Compositor chain. Hardware AA in DS is not a good idea.
I'll probably extend this thread later, because I forgot a million things.
Please post, bugs, suggestions and whatever crazy ideas you might have
Also please excuse the shitty models, I made almost all of them and I'm not an artist
Windows (Should run right out of the box):
https://www.dropbox.com/s/5l4fu0kf6yjdr ... s.zip?dl=0
Linux (Should run right out of the box):
https://www.dropbox.com/s/a4ta426a3yde4 ... x.zip?dl=0
Source:
https://github.com/White-waluigi/HLMS_DS
Gallery:
http://imgur.com/a/pVATq
Its almost been a year hasn't it? Well I barley had time to work on it, it has been a stressfull time. I will try to update a lot more frequent from now on, I promise. But I did implement quite a bit I think:
-JSON Materials:
The main feature I think. Users are able to create a list of all necessary ressources for the material they wish to create. All textures, Parameters, Settings, etc. Then they can combine them in a piece of shadercode to create a completely new effect. In the Demo you will find some basic water, a glowing statue and creepy mask that can only bee seen through a mirror.
-Shadow improvements
-Lots of bug fixes
-bigger Demo world to show off the Directional PSSM Shadows
-Fully dynamic Datablocks
Next I'll probably work on Screen Space Reflection, imporving JSON materials, fancier Demo, optimization and the ability to create custom light materials, so users can create all kinds of crazy lighting effects. Also some decent documentation.
Also I have uploaded the Source code to github now, so people can look at the progress or lack thereof in real time. If anybody is interested, I can make the code build able with CMAKE, so others can experiment with the code.
I'm looking forward to your feedback!
***********************February 10.th 2017******************************************************
After way too long, here's the newest version of my Deferred Shading HLMS along with a new Demo.
Here's the Windows version:
https://mega.nz/#!eZ42XLYC!IUqhgMF-n3nK ... wXcqreaCjA
Here's the Linux Version +Source
https://mega.nz/#!SUpV2DYY!C33-W0U7BLbc ... JoGDPsjoLc
Screenshots
http://imgur.com/a/1slfR
implemented features
- Dynamic materials
- Light geometry based Deferred Shading
- Normal, Specular, Alpha, Diffuse and Glowmaps
- Custom shader code for Materials
- Dithering Transparency
- Debug Views
- Shadows (not finished)
- Configurable Textureunits (partial)
- Animated Textureunits (partial)
- Antialiasing (FXAA that doesn't suck)
- Reflectivity (Spheremaps for now)
Missing features
- Custom Material Templates
- SSAO
- Rendering other HLMS Materials afterwards (rebuilding the depth Buffer)
- Full Vertex Shader (its pretty basic right now)
- More Lighting Techniques
- Light Materials
- Unreal Style Material Propertys with custom shader code
- DX support
Shadows:
Simple filtered depth shadows. Uses HLMS standard SHadow System.Most of my time went into this, since it was a bit of a pain to figure out how to make it work.
There are a few Problems that I have with Shadows right now. I can't figure out how to make it work with Alpha Textures, since HLMS-Shadowcasters don't have any UVs and I can only use 1 Material for every shadowcaster. Also I coldn't make native depth textures work like in HLMS-PBS, but I'l figure that one out in time. And the filtering is broken on Intel GPUs, and I have no Idea why.
FXAA
Simple FXAA post processing, nothing special really, looks good enough. I'm thinking of linking it to Ogres FSAA, so if that one isn't 0, the FXAA gets enabled, since FSAA with DS is a pain in the ass.
Texture Units
If extended the Texture Unit with some basic animation features, like translating the Texture Matrix, rendering animations with multiple Textures.
You can also choose which UV the Texture gets mapped to.
Reflectivity
Basic Spheremap that gets mixed with the diffuse component.
Things that are planned for the immediate future
More advanced Lighting
The current lighting is basicly the same I used for my old Deferred Shading project, It really needs to be updated, I'll probably steal a lot of code from HLMS_PBS
Ligth Materials
It becomes clear that the Lights need to be more configurable, to allow for things like Volumetric Lighting, Sunrays, Gobol lighting, HDR, Shadow Bias, Shadow Filtering, Shadow depth etc...
I'll probably implement it as soon as I figured out how to make JSON Materials work. I'll probably use getUserAny for this
JSON Materials
I think JSON is the best format to use for the Materials and Later, material templates. Probably the next thing I'll work on
And the rest of the implemnted section
Known Bugs:
-Crash on Exit
-Shadows broken on Intel Cards
-won't run on <16.04 because of boost 1.58
-Petter Panning on a lot of objects in the Demo
If you have any ideas, questions or Bugs, please report them in this thread
**********************23 Apr 2016*********************************************
Heres the Demo for my HLMS implmentation of Deferred Shading. I know it took forever (I wanted to be this far back in November), mainly because I kept running into Problems and starting from scratch twice.
But I think I added some interesting concepts for dynamic and expandable Materials, which Im going to explain further down in this thread.
Also my HLMS still needs a lot of work, this is just a little Demo of how far I got.
implemented features
- Dynamic materials
- Light geometry based Deferred Shading
- Normal, Specualr, Alpha, Diffuse and Glowmaps
- Custom shader code for Materials
- Dithering Transparency
- Debug Views
Missing features
- Shadows
- Custom Material Templates
- Configurable Textureunits
- Animated Textureunits
- Antialiasing
- SSAO
- Rendering other HLMS Materials afterwards (rebuilding the depth Buffer)
- Full Vertex Shader (its pretty basic right now)
- More Lighting Techniques
- Reflectivity (SSR and/or Cubemaps)
- Unreal Style Material Propertys with custom shader code
-DX support
I might add more stuff here later
Here are some Screenshots:
http://imgur.com/a/MJUaz
Heres the Download Links (Please report Bugs, they are debug builds for the moment, I have a nasty reallease bug atm, also, crash on exit, Linux versions includes full source)
Windows:
https://mega.nz/#!SwQkzJjT!BAkglgoStTfm ... C6w6u6HrZE
Linux+Source:
https://mega.nz/#!6g5SzDJD!l3P8DxmuRgq7 ... HK5X1rAoZE
Heres some Info on the Stuff thats already here:
Light geometry based Deferred Shading
Everytime a lght geds added, LightManager will create a CustomRenderable called a DSLight. This DS Ligth will have have a Mesh that stretches over any area that the corresponding Light could reach. This custom renderable will receive a standard DS Datablock with the LightDatablock Template . Within this, it will put all the propertys needed to render the Light as Vec4 Params.
HLMS will also bind the GBUffer-Texture to them.
Currently thers a little Problem when the User adjusts the Light Range or deletes a Light at runtime.
Since I have no way to detect if a Light was modified or removed, I can't alter its settings.
Also, later I'd like to add the Gbuffer-Texture as an AutoParamTextureUnit, same with the Shadowmaps, to make Custom Light Materials possible.
So Users can also implement custom Templates for Custom Ligths without changing the acutal HLMS_DS source code.
dynamic Materials
Since they are dynamic, they can't use the const buffer pool, so they are just Const Buffers. They are composed of a number of TextureUnits, AutoParams, Property Params, Vec4 Params and PieceParams. These are defined in the Datablock the Users sends the HLMS. For each on theres a corresponding type in the Materialtemplate. Materialtemplates are either a C++ Class or a DatablockTeamplate (later is not implmented yet). Theres a Lightdatablock template and a GBufferdatablock Template. They add the types they support in a function called initializeParamTypes(). For the Gbuffertemplate these are i.e diffuse, glow, glowmap, diffusemap etc. and for Lighttemplates these are Lightpos, LightDiffuse, LigthSPecualr, SpotLightAngle etc. These Types are then read as Values from the Datablock data and Send to the GBuffer, if the Material is dirty.
Vec4Params are Parameters which are compromised of 4 or less float values i.e diffuse, TextureParams are Textures i.e NormalMap, PropertyParams are Propertys i.e IS_AMBIENT_LIGHT and PieceParams are Pieces i.e custom_post_material.
This way, its much easier to add more Parameters to Materials without having to edit much code.
Later these Materials should be extendable using some form of css textfile.
A User could create Unreal Style Materials where he would define all the Needed textures, all the settable propertys, automatic paramters (time for example) and the necassary shader code that would modify the material properties to create a new Material within Deferred Shading, inside a file and another user could load it by setting a template paramter in a standard DS Datablock.
Dithering Transparency
Ugly as hell way to create Transparency. Later I'd like to make sure users can use other HLMS to create Forwarded Alpha Materials so it actually looks decent. Once I was done I was really dissapointed by the Visual quality of dithering. I could be kinda usefull to phase in distant objects as you move closer to them, Far Cry 3 style, create 0-1 alpha Materials (leaves) or maybe to create a cheap teleporter effect.
Debug Views
You use f6 and f7 to switch between different Debug Modes for the Renderer.
Heres some Info on Stuff I wan't to add
Shadows
The way I wan't to add shadows (and other automatic or intern textures) is a little bit special. I'd like to create AutoParamTextureUnits for that. These are TextureUnits which are automaitcly added and updated, simsilar with the existing Vec4AutoParams. So that other Materialtemplates could easily include or exclude them for whatever reason.
So Screen Space Refection Materials for instance could bind a SSRAutoParamTextureUnit, which includes a rendered version of last frames fully rendered scene and use it to create a reflection effect on the ground.
Currently I'm not entirely sure how to implement this, but I have a rough idea, is definitly the next thing on my list.
Configurable Textureunits
The current Problem I have with texture Units (and Datablocks in general), is that you can only have one property and one Value. For TextureUnits in particular, this removes a ton of features from the 1.0 version of Ogre, i.e animations, Filtering, texture_coordingates, etc. . I had to awkwardly use nested one-line Datablocks to create AutoParams.
I think I would be a good idea to allow a datablock like that:
datablock a{
param {
paramb valb
paramc valc
paramd vald
}
}
So that those things could be added back into the HLMS. It might also prove usefull for Datablock Templates.
AA and SSAO
Will probably need to be a postprocessing anti aliasing at the end of the Compositor chain. Hardware AA in DS is not a good idea.
I'll probably extend this thread later, because I forgot a million things.
Please post, bugs, suggestions and whatever crazy ideas you might have
Also please excuse the shitty models, I made almost all of them and I'm not an artist