Commit graph

39 commits

Author SHA1 Message Date
AtomicWalrus 13fec9bb80 Squashed commit of the following:
commit 678d0ea2357915c6502af90083f1d34b6b21b7b4
Author: AtomicWalrus <headlesschickens.inc@gmail.com>
Date:   Mon Feb 20 20:46:15 2023 -0700

    Removed some commented-out code

commit 4a149157f7a7b781e2246b1417b144625ff559cd
Author: AtomicWalrus <headlesschickens.inc@gmail.com>
Date:   Mon Feb 20 20:42:03 2023 -0700

    Remove un-used instance of the blendHardness var

commit e5dc42adef00ed371cbc89b731ae16889ba68d9a
Author: AtomicWalrus <headlesschickens.inc@gmail.com>
Date:   Mon Feb 20 18:57:51 2023 -0700

    Cleanup un-needed conditionals and other leftover code

commit dccd10010e058f00cd41f5c5c111443f9cb71721
Author: AtomicWalrus <headlesschickens.inc@gmail.com>
Date:   Mon Feb 20 18:05:31 2023 -0700

    Use validator instead of protected field (2)

commit 4cc7f1d32fcc6ab788de54bb38763283fbd5533e
Author: AtomicWalrus <headlesschickens.inc@gmail.com>
Date:   Mon Feb 20 18:03:40 2023 -0700

    Use validator instead of protected field

commit e8d7e1731e383a99e8a0539d23a3b04f9c252491
Author: AtomicWalrus <headlesschickens.inc@gmail.com>
Date:   Mon Feb 20 15:34:48 2023 -0700

    Terrain macro textures and blending hardness
2023-02-20 20:47:46 -07:00
AzaezelX 1dd8149074 cleanups for terrain blending 2022-11-03 10:07:27 -05:00
Robert MacGregor 5d26dba7da * BugFix: Clear some MSVC compiler warnings. 2021-10-07 00:27:39 -04:00
Areloch 5525f8ecdd Converts all game, gui editor, and system classes to utilize assets
Processed core, tools and default modules to utilize assets
Converted all console types that were string based, such as TypeImageFilename to utilize const char*/the string table, which avoids a lot of type swapping shenanigans and avoids string corruption
Removed unneeded MainEditor mockup module
Removed some unused/duplicate image assets from the tools
2021-07-19 01:07:08 -05:00
Lukas Aldershaab 481e2a7230 Improve terrain rendering, handle bug with no detail 2021-01-04 20:06:17 +01:00
Lukas Aldershaab 60a10f4334 Add global blendDepth slider and update default blendDepth for mats 2021-01-03 01:26:19 +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
Brian Roberts d50f1f0b81
Merge pull request #342 from lukaspj/fix/replace-dstrcmp
Replace uses of dStrCmp with new String::compare
2020-10-03 17:01:12 -05:00
Lukas Aldershaab c999baf7ed Moves from using dStrCmp to the new String::compare static functions. Keeps things cleaner, consistent, and works with intellisense. 2020-10-03 14:37:55 +02:00
AzaezelX 0c7811bd1a shift pbrconfig to ORM 2020-09-30 13:51:12 -05:00
Areloch 8956559bfd Various misc. tweaks and fixes based on static code analysis to minimize/fix memleaks, crashes, or other performance impacting code. 2020-09-19 18:25:10 -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 c2e74f375a uninitialized variables-terrain 2020-05-11 15:37:43 -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
Areloch c283295f22 Merge branch 'CustomShaderFeatures' of https://github.com/Areloch/Torque3D into development 2019-05-11 21:53:08 -05:00
Azaezel daef7aa128 debug spew cleanup 2018-11-08 01:27:42 -06: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
Azaezel 01f0d5cfca tAlgorythm fed namespace T3D for better library interoperability. resulted in the need to specify usage in... a few places. 2017-12-27 22:57:47 -06:00
Areloch dc5e502dec Initial implementation of Custom Shader Features. 2017-10-05 17:04:51 -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
Areloch ec3806bb0a Catches the remaining prepass to deferred changes on the engine side. 2017-05-14 18:28:17 -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
RexTimmy d46f82ef1d re-enable face culling for the terrain 2016-12-01 11:03:32 +10:00
Azaezel fbfd3ed8ed clang: constructor initialization order
while not a major issue per-se, the sheer number of times the engine has to jump back in memory and backfill data in a given class can add up. First run of... many.,
2016-10-14 18:16:55 -05: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 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
LuisAntonRebollo 7962eef7dd Revert - Merge pull request #962 Fix OpenGL new terrain blend
from BeamNG/fix_opengl_new_terrain_blend (reverted from commit a0d5dc25cd)
2014-12-03 21:54:57 +01:00
LuisAntonRebollo ff83e8c209 Merge remote-tracking branch 'GG-Github/development' into fix_opengl_new_terrain_blend 2014-11-30 04:47:38 +01:00
LuisAntonRebollo 2f8d18c0c0 Merge pull request #929 from BeamNG/remove_old_opengl_code
Remove unnecesary code for handle OpenGL.
2014-11-30 02:22:24 +01:00
Anis A. Hireche a954daa43f terrain_blending_opengl_port_from_lukas_code 2014-11-27 20:56:23 +01:00
LuisAntonRebollo 1ac8fab884 Changes for get necesary sampler names for OpenGL shaders. 2014-11-08 18:31:14 +01:00
LuisAntonRebollo f101fbe820 Remove unnecesary code for handle OpenGL. 2014-11-08 18:11:35 +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