Commit graph

20 commits

Author SHA1 Message Date
AzaezelX 070a9845a2 preliminary glowmap+glowmul feature augmentation math 2019-10-30 18:29:11 -05:00
AzaezelX bfccfca0ce more conversionwork from specular entries to pbrconfig ones, adds backend glowmul and glowmap var tracking, as well as pbrconfigmap composite slip-in for the glowmap (sans shaderfeatures just yet). seems to have busted forward lit application though... 2019-10-22 15:11:39 -05:00
AzaezelX 65cbf49c4a backend specularMap to PBRConfigMap alts.
left:
     addField( "specularMap", TypeImageFilename, Offset(mPBRConfigMapFilename, Material), MAX_STAGES,
scripthook till last since that *will* break all current materials.
2019-10-16 15:51:02 -05:00
AzaezelX 022b87cac2 from user Ewyncat: adds invcameratrans, cameratoscrren, and screentocamera postfx and shader matrix interfaces.
also a bit of backend work to normalize those later once we've proof-of-concepted the calcs
2019-09-06 14:25:17 -05:00
Areloch ebe2c2dead Add vector light support to forward materials. 2019-07-22 00:16:58 -05:00
Jeff Raab 38b0d0f1fe Updates names of probe forward shader consts to be consistent with shadergen, allowing proper data throughput 2019-07-16 09:34:31 -05:00
Areloch e87dc787ee Corrected probe init'ing so they don't fight for the cubemap idx order
Also correct deleting behavior so it updates indicies when a probe is removed
Updated forward lighting to utilize the same math as deferred
2019-06-30 23:04:16 -05:00
AzaezelX 01f6938746 nomenclature shift for clarity: bunch of stuff tagged as probe that refferenced things properly tied conceptually to the reflection refrence box. 2019-06-28 10:21:50 -05:00
Areloch af77444ec9 Merge branch 'MatInstanceViewer' of https://github.com/Areloch/Torque3D into Preview4_0
Fixed up forward IBL
Reimplemented old forward light shader code as a baseline so it can be updated to new PBR math
2019-06-27 00:36:56 -05:00
Areloch 4e557aec83 Added fetch for BRDF texture for forward rendering use, re-enabled brdf logic in the lighting shader and got the probe arrays properly sampling into forward as well.
TODO: core::rendering pref on the BRDF texture instead of hardcode path, add best-pick logic for forward probes and double-check ogl forward is playing nice.
2019-05-02 00:05:12 -05:00
Areloch c025760422 Majority of forward work. Some state/register count issues and further testing required.
Also requires proper binding of forward probe values, as well as scoring probes for forward selection.
2019-04-07 23:57:05 -05:00
Areloch afb5a589c3 Cleanup/consolidation of shader logic. moved the common methods over to lighting.hlsl
Did all the setup work to feed data for forward probestuffs, just have to rewrite the shaderFeature to replicate the regular probe array logic.
2019-04-03 00:13:58 -05:00
Areloch f110158654 Probe Array WIP 2019-01-07 20:34:19 -06:00
Tim Barnes 9a39afa0eb reflection probe updates 2018-10-28 20:42:26 +10:00
Areloch b19a4b22c8 Implementation of reflection and skylight probes.
Moves lighting math to the diffuse/specular two-channel logic.
2018-09-16 22:15:07 -05:00
Areloch b4a1d18f42 Core implementation of Physical Based Rendering. 2018-09-15 20:19:57 -05:00
Areloch 25686ed4be Implementation of sRGB image support. Overhauls the linearization setup to utilize the sRGB image types, as well as refactors the use of ColorF and ColorI to be properly internally consistent. ColorIs are used only for front-facing/editing/UI settings, and ColorFs, now renamed to LinearColorF to reduce confusion of purpose, are used for color info in the engine itself. This avoids confusing and expensive conversions back and forth between types and avoids botches with linearity. Majority work done by @rextimmy 2017-06-23 11:36:20 -05:00
Azaezel 196b214eae engine:
defines and alters a series of material features for deferred shading in order to define a fully fleshed out multiple render target gbuffer patterned after the general principles outlined http://www.catalinzima.com/xna/tutorials/deferred-rendering-in-xna/creating-the-g-buffer/ (though I cannot stress enough *not* using the identical layout)

script:
removes dead material features (ie: those that never functioned to begin with)

shader:
bool getFlag(float flags, int num) definition for retreiving data from the 3rd (matinfo) gbuffer slot's red channel (more on that shortly)

purpose:
_A)_ Small primer on how material features function:
When a https://github.com/GarageGames/Torque3D/search?utf8=%E2%9C%93&q=_determineFeatures call is executed, certain conditions trigger a given .addFeature(MFT_SOMEFEATURE) call based upon material definition entries, be it a value, a texture reference, or even the presence or lack thereof for another feature. In general terms, the first to be executed is ProcessedShaderMaterial::_determineFeatures followed by ProcessedPrePassMaterial::_determineFeatures. The next commit will provide the bindings there. For now it's enough to understand that one of those two will trigger the shadergen subsystem, when rendering a material, to check it's associated list of features and spit out a shader if one is not already defined, or reference a pre-existing one that includes codelines determined by that list of features.

Relevant execution of this is as follows:
DeclareFeatureType( MFT_DeferredDiffuseMap ); - Name
ImplementFeatureType( MFT_DeferredDiffuseMap, MFG_Texture, 2.0f, false ); - Codeline Insertion Order
FEATUREMGR->registerFeature( MFT_DeferredDiffuseMap, new DeferredDiffuseMapHLSL ); - Hook to class which actually generates code
alternately    FEATUREMGR->registerFeature( MFT_Imposter, new NamedFeatureHLSL( "Imposter" ) ); - a simple feature that serves no purpose further than as a test of it's existence (to modify other features for instance)

class DeferredDiffuseMapHLSL : public ShaderFeatureHLSL - Class definition
{
getName  -embeded in the proceedural shader as a remline both up top and before actual code insertions
processPix  - pixel shader codeline insertions
getOutputTargets - used to determine which buffer is written to (assumes only one. depending on branched logic, older features that may be run for either forward or deferred rendering depending on circumstance may have a logical switch based on additional feature flags. as an example:  TerrainBaseMapFeatHLSL::getOutputTargets)
getResources - associated with the Resources struct, closely aligned with the hardware regestry
 getBlendOp - used to determine what blend operation to use if a material requires a second pass (defaults to overwriting)
setTexData - ???
processVert - vertex shader codeline insertions
};

_B)_
The resultant Gbuffer layout defined by the previous commit therefore is as follows:
defaultrendertarget (referred to in shaders as out.col or col depending on GFX plugin) contains either lighting and normal data, or color data depending on if it is used in a deferred or forward lit manner (note for forward lit, this data is replaced as a second step with color. why custommaterials have traditionally had problems with lighting)
color1 (referred to in shaders as out.col1 or col1 depending on GFX plugin) RGB color data and an A for blending operations (including transparency)
color2 (referred to in shaders as out.col2 or col2 depending on GFX plugin) contains:
 red channel comprising material flags such as metalness, emissive, ect,
 green channel for translucency (light shining through, as oposed to  see-through transparency), blue for
 blue for specular strength (how much light influences net color)
 alpha for specular power (generally how reflective/glossy an object is)

long term purpose:
further down the line, these will be used to condition data for use with a PBR subsystem, with further corrections to the underlying mathematics, strength being replaced by roughness, and power by metalness
2016-02-16 02:23:23 -06:00
DavidWyand-GG 17113d3ba5 Blinn-Phong Specular Changes
Based on the work done here:
http://www.garagegames.com/community/blogs/view/21032
2013-10-29 15:10:23 -04:00
DavidWyand-GG 7dbfe6994d Engine directory for ticket #1 2012-09-19 11:15:01 -04:00