Commit graph

49 commits

Author SHA1 Message Date
AzaezelX 1dd8149074 cleanups for terrain blending 2022-11-03 10:07:27 -05:00
JeffR 434c6c26fe A clean implementation of Lukas' Fix side projection #684 PR with Az's addendum fix rolled in 2021-12-13 15:56:14 -06:00
AzaezelX 5682bafb29 kills off that second buffer in terrain rendering when in forward mode 2021-09-22 18:28:19 -05:00
Lukas Aldershaab 481e2a7230 Improve terrain rendering, handle bug with no detail 2021-01-04 20:06:17 +01:00
Lukas Aldershaab 6f57aa51d2 Add 0.5f term back to contrast calculation 2021-01-03 11:43:13 +01:00
Lukas Aldershaab 9cac064be8 Avoid negative heights in texture blending 2021-01-03 11:35:08 +01:00
Lukas Aldershaab 10ed852dd2 Remove baseline component from contrast 2021-01-03 01:49:07 +01:00
Lukas Aldershaab 3c165b7d45 Update blendContrast, add glsl support 2021-01-02 03:30:08 +01:00
Lukas Aldershaab 1ffec9ab56 Add blend contrast slider 2021-01-02 03:20:18 +01:00
Lukas Aldershaab 3c8d07a03e Cleanup and fixes 2021-01-02 02:08:22 +01:00
Lukas Aldershaab 4f472bf402 New terrain blending 2021-01-01 21:07:12 +01:00
Lukas Aldershaab 87dd7ffc4a Implement Singlepass Terrain Render 2021-01-01 21:06:01 +01:00
Lukas Aldershaab 49a8c0ad36 Fix ORM maps in terrain textures
Fix default target for Composite Terrain GLSL
2020-12-26 20:02:37 +01:00
AzaezelX 0c7811bd1a shift pbrconfig to ORM 2020-09-30 13:51:12 -05:00
AzaezelX 4a88d7a4e4 adress #221 crash surpress macromap
while shifitng loop in _initSamplerNames to use sgMaxTerrainMaterialsPerPass. if folks absolutely require thier projects to contain terrain macromaps, they can unrem

FEATUREMGR->registerFeature( MFT_TerrainMacroMap, new NamedFeatureGLSL("TerrainMacroMap Deprecated")); // new TerrainMacroMapFeatGLSL);
   //samplerNames.push_back("$macrolayerTex");
and
      //samplerNames.push_back(avar("$macroMap%d", i));
as well as turn sgMaxTerrainMaterialsPerPass down to 2 entries on a given terrain subchunk before it requires another rerender of the terrain blended in with prior passes.
2020-06-19 21:12:20 -05:00
AzaezelX 9beaba0e60 HACKALERT: eat the low bit of the depth map to store off a copy of the blend total for norm|depth layer blending when layers exceed single passes. really should hunt down root causality there... 2020-03-08 17:25:27 -05:00
AzaezelX 29a8d5d36c backend support for isSRGB and invSmooth flags, general cleanup HLSL side. left GLSL alone for sxs comparrison while we work out the kinks 2019-12-17 19:26:47 -06:00
AzaezelX fb67458eaf fix terrain default values when not applying a pbrConfigMap 2019-11-07 03:27:44 -06:00
Azaezel b3805fe778 Merge branch 'terrainNormalNeener' into PBR_PR 2018-11-01 14:06:00 -05:00
Brian Roberts 4453a4ad4b Update terrFeatureHLSL.cpp 2018-10-29 13:22:16 -05:00
Azaezel 2c0a57449e filter out pixel shader normalmap calcs when not in deferred mode. 2018-09-26 06:49:36 -05: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 88a94342f8 Merge pull request #2051 from lukaspj/correct-terrain-colors-linear
Fix for terrain detail color blending post-linearization
2017-08-08 23:35:24 -05:00
Areloch 8c807485b1 Reworks the $Core::commonShaderPath variable usage to be a static variable in ShaderGen for efficiency(only one getVariable when shadergen is initialized), as well as implements the ability to set a default value, and ensures that it tries to set a path even if the pref variable is missing which is important for ported projects from older builds. 2017-07-24 00:40:27 -05:00
Lukas Jørgensen 0b9aede7a2 Fix for terrain detail color blending post-linearization 2017-07-20 11:32:17 +02: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
Areloch edd1e0a270 Removes Direct3D9 functionality. 2017-05-28 16:51:31 -05:00
Areloch af8fbf0e3a Goes and replaces the references/names that use Prepass to be Deferred, since we're actually using deferred. 2017-04-11 00:23:14 -05:00
Areloch 1ed8b05169 Initial implementation of the new Base Game Template and some starting modules.
This makes some tweaks to the engine to support this, specifically, it tweaks the hardcoded shaderpaths to defer to a pref variable, so none of the shader paths are hardcoded.

Also tweaks how post effects read in texture files, removing a bizzare filepath interpretation choice, where if the file path didn't start with "/" it forcefully appended the script's file path. This made it impossible to have images not in the same dir as the script file defining the post effect.

This was changed and the existing template's post effects tweaked for now to just add "./" to those few paths impacted, as well as the perf vars to support the non-hardcoded shader paths in the engine.
2017-02-24 02:40:56 -06:00
Azaezel 598fb758f3 embeds blendtotal into the low bit for the normal|depth buffer for terrains to support multi-pass blending. 2016-09-14 15:35:35 -05:00
Azaezel a0c0f5766f adresses #1704: partial reversion to 3.8 specs regarding layer blending. 2016-07-29 11:26:44 -05:00
rextimmy 41e5caf22b Direct3D11 Engine/source changes 2016-03-20 21:52:11 +10:00
Areloch 908be4818f Merge pull request #1519 from Azaezel/deferredShading
Deferred shading
2016-02-27 15:08:20 -06:00
rextimmy 36daca8d8e Corrected FeatureSet::getNextFeatureIndex and ShaderFeature::getProcessIndex signed mismatch. 2016-02-21 15:10:58 +10: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
Azaezel ce2964d2d0 diffuse/albedo texture linearization
http://http.developer.nvidia.com/GPUGems3/gpugems3_ch24.html
2015-11-11 13:52:46 -06:00
Areloch b1d2ba8412 Merge pull request #1379 from Azaezel/C4189
C4189 warning cleanups
2015-09-02 19:46:28 -05:00
Areloch 95ab3a33a5 Merge pull request #719 from rextimmy/dxtnm-parallax-fix
Fix to allow parallax mapping with dxtnm textures via the red channel.
2015-08-27 23:59:20 -05:00
Azaezel 555610f69f Addresses roughly half of the C4189 errors though the following methodologies:
1) truly unused vars removed
2) vars leading to remmed out code for debugging remmed in turn.

left out:
vars in macros.
2015-07-29 03:03:27 -05:00
Daniel Buckmaster 69f2efab8f Merge remote-tracking branch 'lukaspj/Fuzzy-texture-border-fix' into release-3.7 2015-05-09 14:29:30 +10:00
LukasPJ a3f08df9e3 Fix for fuzzy borders 2015-01-12 17:03:52 +01:00
LuisAntonRebollo dd08fd2e7d Add OpenGL support. 2014-11-08 20:21:50 +01:00
LukasPJ ad7b75de09 Fix for fuzzy borders between textures 2014-11-08 04:58:01 +01:00
Lukas Joergensen 9612d3c290 BlendTotal is now an actual total rather than a max 2014-08-25 21:08:34 +02:00
rextimmy 3c56bf3a56 Fix to allow parallax mapping with dxtnm textures via the red channel. 2014-07-03 17:56:47 +10:00
Thomas Fischer 502e346eb6 visual studio 2012 Level 4 warning fixes 2014-03-15 11:38:53 +01:00
xoltan add2f8cb47 Terrain Macro Texture
Adds another layer of detail-like texture to the terrain and the
interface updates in the Terrain Painter.
2013-03-27 18:58:37 -06:00
DavidWyand-GG 7dbfe6994d Engine directory for ticket #1 2012-09-19 11:15:01 -04:00