Commit graph

86 commits

Author SHA1 Message Date
RexTimmy d46f82ef1d re-enable face culling for the terrain 2016-12-01 11:03:32 +10:00
Areloch 6cc7bcd2e0 Merge pull request #1805 from Azaezel/startRightEndRight
clang: constructor initialization order
2016-10-19 08:39:12 -05:00
Areloch 121d65215e Tweaks any enums that use uint_max values so that they have hard types to avoid any compiler kerfluffles with C++11 value narrowing, specifically pertaining to clang. 2016-10-17 01:00:12 -05: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 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
Anis 7bba3ee2de pushed a forgotten feature on OpenGL terrrain.
added this: 69f2efab8f on OpenGL
2016-03-04 22:51:09 +01:00
Areloch 908be4818f Merge pull request #1519 from Azaezel/deferredShading
Deferred shading
2016-02-27 15:08:20 -06:00
rextimmy 2383e8e43e Fix for TerrainFeatGLSL getProcessIndex() signed mismatch 2016-02-21 22:24:05 +10: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 165cdb64e9 Merge pull request #1322 from Areloch/String_isEmpty_Convert
Replace uses of dStrIsEmpty with new String::isEmpty
2015-10-31 23:40:13 -05:00
Areloch b1d2ba8412 Merge pull request #1379 from Azaezel/C4189
C4189 warning cleanups
2015-09-02 19:46:28 -05:00
Areloch 71c19a6151 Companion PR to #719
Adds the OGL side. redoing it to make sure the PR history is clean.
2015-08-28 00:27:08 -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 4f2f1ca4e1 Merge pull request #1356 from Areloch/PVS_Cleanup_813
Convert un-modified function arguments to const references.
2015-07-20 22:55:22 +10:00
Areloch 11398bb04e Issue found with PVS-Studio:
A lot of instances where some function args are not actually modified in any way, meaning that it is better for performance to convert them into const references. This prevents an additional copy, which can help performance.
2015-07-16 22:02:18 -05:00
Areloch 2002d74b78 Issue found with PVS-Studio:
Many instances of a function or expression being used repeatedly, which can lower performance.

Fixed it in these cases by creating on local var, reference or pointer that's used instead.
2015-07-13 22:51:17 -05:00
Azaezel 6218d792f3 No need for server-only aps to generate visible textures. (the other had a transcription error) 2015-06-15 21:07:33 +10:00
Areloch e18312b950 Fixed a issue with the terrain blending having hard-edges. 2015-06-08 00:11:48 -05:00
Areloch 6e8fa7215a Moves from using dStrIsEmpty to the new String::isEmpty static function. Keeps things cleaner, consistent, and works with intellisense. 2015-06-06 17:40:49 -05:00
Azaezel a879ad4dcf re-enables prior functionality allowing folks to post-editor modify terrain cached textures. 2015-05-16 16:35:47 +10: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
Daniel Buckmaster 7ab6731f51 Merge branch 'development' into walkabout
Conflicts:
	Templates/Empty/game/tools/worldEditor/scripts/editors/creator.ed.cs
	Templates/Full/game/tools/worldEditor/scripts/editors/creator.ed.cs
2015-01-02 14:45:20 +11:00
Daniel Buckmaster ae284a89ec Merge branch 'development' into defineconsolemethod
Conflicts:
	Engine/source/materials/materialDefinition.cpp
2014-12-26 13:22:16 +11:00
Daniel Buckmaster 3ab048c5b0 Fixes after feedback from Luis.
* Made use of dStrIsEmpty in more locations (and fixed it :P)
 * Removed commented-out code
 * Corrected default params
 * Fixed some console warning formats
 * Removed tabs
 * Corrected setExtent API
2014-12-23 18:48:02 +11:00
Daniel Buckmaster 9396ae7176 Merge remote-tracking branch 'Winterleaf/Development-Console' into defineconsolemethod
Conflicts:
	Engine/source/T3D/missionMarker.cpp
2014-12-21 21:23:55 +11:00
LuisAntonRebollo f3e737e001 3 textures blending fix for OpenGL. 2014-12-03 21:59:53 +01: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 4409a12af6 Fix GLSL out fragment shader color. 2014-11-30 05:32:40 +01:00
LuisAntonRebollo fb08fafc9c Fix terrFeatureGLSL.cpp for GCC. 2014-11-30 05:03:30 +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 98e3651db5 Merge pull request #940 from BeamNG/add_opengl_support
Add/Activate OpenGL render.
2014-11-30 02:48:13 +01:00
LuisAntonRebollo 9c66aa0681 Merge pull request #931 from BeamNG/terrain_layer_format
Set correct terrain layer texture format.
2014-11-30 02:22:39 +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
LuisAntonRebollo 03ffa1ddd3 Merge pull request #925 from BeamNG/shaderdata_samplernames
Add sampler names to ShaderData
2014-11-30 02:21:30 +01:00
Daniel Buckmaster f4c940f4fe Added basic Walkabout with #define renamed and no editor. 2014-11-28 19:42:10 +11:00
Anis A. Hireche a954daa43f terrain_blending_opengl_port_from_lukas_code 2014-11-27 20:56:23 +01:00
LuisAntonRebollo dd08fd2e7d Add OpenGL support. 2014-11-08 20:21:50 +01:00
LuisAntonRebollo 1ac8fab884 Changes for get necesary sampler names for OpenGL shaders. 2014-11-08 18:31:14 +01:00
LuisAntonRebollo b81ebaa386 Set correct terrain layer texture format. 2014-11-08 18:19:14 +01:00
LuisAntonRebollo f101fbe820 Remove unnecesary code for handle OpenGL. 2014-11-08 18:11:35 +01:00
LukasPJ f481d31285 BaseTexFormat was not networked properly. 2014-11-08 04:58:56 +01:00
LukasPJ ad7b75de09 Fix for fuzzy borders between textures 2014-11-08 04:58:01 +01:00
Daniel Buckmaster 9e4446046f Merge pull request #710 from lukaspj/3-Textures-Blending-Fix
3 textures blending fix
2014-11-04 17:06:04 +11:00
Daniel Buckmaster 97ae3445c9 Merge pull request #793 from lukaspj/Terrain-Basetex-Formats
Terrain basetex formats
2014-11-04 14:54:08 +11:00