Commit graph

62 commits

Author SHA1 Message Date
AzaezelX 42e90ad3fb RTLightingFeat work.
1) we do *not* in fact want to early out in the presence of MFT_ImposterVert. it mangles the position-send.
2) dx sucessfuly handles the    if ( !fd.features[MFT_NormalMap] ) case, so use the same for gl
2021-10-05 14:46:37 -05:00
AzaezelX a1117b1c41 add getInWorldNormal method glsl side 2021-10-03 21:51:40 -05:00
Jeff Hutchinson e784b0140c Let's fix the texcoord alignment for RT Lighting. 2021-09-22 21:41:38 -04:00
AzaezelX 8ce207561e revert a bit causing crashes on certain 'nix boxes. 2021-09-20 16:56:53 -05:00
AzaezelX 21c17d0ed1 cleanups for shadergen and the visibility feature
math fixes, feature inclusion removal. will still need to circle back on why the crosshatch.. isn't
2021-09-17 01:24:20 -05:00
AzaezelX 2287c28d32 be clear where we're referencing gbuffer render targets 2021-08-28 17:21:45 -05:00
AzaezelX 438e6cbb3c fix for diffuse map mangling in several cases, filter imposters out of real time lighting (for now?) fix the blankskybox via a resave, and filter "badfilereference" and "failed" assets out of variable replacement for the project converter 2021-07-25 17:18:55 -05:00
Areloch 6a3603c737 Overhauls the handling of probes to utilize an active probe list to improve performance and allow a greater total number of active probes in a scene.
Also fixes handling of metal materials during bakes to render properly, and fixes a possible double-up return in findObjectByType, which could cause doubling when getting probes in the scene
2020-10-19 00:53:09 -05: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 197a62f6ea Convert dStrcmp to String::compare for more cases 2020-10-04 00:00:01 +02:00
AzaezelX 0c7811bd1a shift pbrconfig to ORM 2020-09-30 13:51:12 -05:00
AzaezelX 454192ed02 from @rextimmy new isbackground shader feature. used the same z=w trick we've done before to force things to render behind everything else. applied to fog 2020-07-14 14:08:12 -05:00
AzaezelX 6859cbe308 adress #16 - don't need to swizzle vert colors 2020-06-13 13:02:56 -05:00
AzaezelX f956c17f3b for normal rendering, if we're translucent, don't use alphatesting. (as a remindernote, the shadowmathook removes MFT_IsTranslucent]) 2020-03-01 11:51:50 -06:00
Areloch 27ee09e491 Merge branch 'alpha40_premul' of https://github.com/Azaezel/Torque3D into Preview4_0 2019-11-22 21:27:52 -06:00
Areloch ac77315e29 Merge branch 'alph40_pbrConfig_BREAKINGWip' of https://github.com/Azaezel/Torque3D into Preview4_0 2019-11-22 21:24:59 -06:00
AzaezelX bd21a207ef largely based on work by @rextimmy: add premultiplied alpha 2019-11-22 10:02:01 -06:00
AzaezelX 2e56645f13 shifts spotlightparams to the actually used float2/vec2 entries (stops debug screaming every frame) 2019-11-07 23:18:14 -06:00
AzaezelX ad216abc02 cleans up a few more spots of various variables that ammount to the "PBRConfig" in the end, as well as a MFT_isDeferred test for determining if that's stored off as a temp-val or in the gbuffer. though seem to have forgotten a catch, as it's not finding the MFT_PBRConfigMap feature and falling back to recreation come time to process MFT_ReflectionProbes 2019-10-23 14:59:29 -05:00
Areloch 01f562b9e5 Added check for when getting the Detail feature's output, to validate if we have the foliage feature, which was causing a stomp on the required float4 texCoord for the foliage featuer to work right
Temporarily disabled wsNormal addition when we have no defined normal map until it's finished being integrated
Fixed the structure for the lighting/probe shadergen logic in GL so it generates correctly, resolving a crash on unix machines.
2019-10-03 23:46:53 -05:00
Areloch e7bf49e801 Moved unneeded modules to Templates/Modules
Added templated getObjectsByClass to Scene for easier engine-side polling of objects, including nested checks for subscenes
Proper init'ing of mGamemodeName in LevelAsset, as well as proper fieldType for mIsSubLevel
D3D11 added logic to handle scaling down of textures in cubemap arrays for lower texture resolution preferences
Added ability to collapse groups programmatically to GuiVariableInspector
Upped PSSM shadowmap max size to 4096
Caught GL deferred lighting/probes up to D3D11
Temporarily disabled forward lighting/probes on GL materials until conversion finished
Upped smMaxInstancingVerts to 2000 from 200 to support slightly more detailed meshes being instanced
Reordered project settings so they load ahead of core modules, so that core modules can actually use project settings
Established current preset file for PostFXManager to use for reverting
WIP logic for forcing probes to update as part of level lighting load step in loading process
Streamlined PostFXManager code, removing unnecessary/redundant files
Coverted HDR, Lightrays and SSAO and ExamplePostEffect to use new PostFX Manager/Editor paradigm
PostFX manager now enacts callbacks so that postFXs' can process their own settings as well as provide editor fields
Changed PostFX editor to work with new callbacks via using VariableInspector
Updated PostEffectAsset's template file so new PostFX's will now automatically register with the PostFXManager and have the needed new callbacks for integration
Made HDR on by default, removed enable field from editing
Made probe bake resolution a project setting
Updated many GL postFX shaders to have proper case for PostFx.glsl
Example module now loads ExampleGUI and ExamplePostEffect during init'ing
Removed unneeded autoload definitions from ExampleModule's module file
Fixed Graphics Adapter settings field to properly display as well as apply setting
Updated many referenced profiles in tools folder to use the Tools specific gui profiles to make theming more consistent
Fixed coloration of tools button bitmap to make theming more consistent
Updated a few theme settings for improved visibility with theme, particularly selected/highlighted text
Moved AssetBrowser field types to separated folder/files
Updated new module creation to properly utilize template file instead of overriding it with a programmatic script generation.
Removed unneded default autoload definitions from new modules
Added WIP for editing Module/Asset dependencies
Updated the PostEffectAsset to properly generate glsl and hlsl files from templates
Updated module editor window to display only necessary fields
Added WIP of TerrainAsset
Added shaderCache gitignore file so folder isn't lost
2019-09-29 06:44:43 -05:00
AzaezelX 4d714091b7 missed a few conversions 2019-06-28 10:56:38 -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
Brian Roberts 47640420ca mac compilation correction - don't use Class:Class constructors 2019-05-21 21:29:19 -05:00
AzaezelX dd1470202d Merge branch 'development' of https://github.com/GarageGames/Torque3D into PBR_ProbeArrayGLWIP
# Conflicts:
#	Engine/source/gfx/D3D11/gfxD3D11Device.cpp
#	Engine/source/lighting/lightManager.cpp
#	Templates/Full/game/levels/Empty Room.mis
#	Templates/Full/game/levels/Empty Terrain.mis
2019-05-01 23:18:31 -05:00
AzaezelX 98a3ff604a nonbreaking 'specularcolor' to 'pbrConfig' var conversion. (TODO: specularMap entries) 2019-04-29 19:40:22 -05:00
AzaezelX d2a01ece03 gl conversionwork - forward lit variant. do note, crashs with
`Engine\source\gfx\gfxDevice.cpp(837,0): {Fatal} - GFXDevice::setTexture - out of range stage! -1>16` though the shaders themselves are now in a compling state (ostensibly)
2019-04-28 06:24:19 -05:00
Azaezel b50f72b109 set gl vertcolor mapping to bgra format, the same as we do for stateblocks 2019-02-11 07:42:31 -06:00
Azaezel 518bcaaabf from @rextimmy: shifts sybox rendering to last (kils a bit of overdraw) 2018-11-18 06:36:16 -06:00
Areloch b4a1d18f42 Core implementation of Physical Based Rendering. 2018-09-15 20:19:57 -05:00
Azaezel 02541ab1f9 shader hooks and gen cleanups 2018-03-13 18:07:58 -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
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 c6e2563a38 went overzealous on the bitangent cleanup when reviewing parallax. the W multiplier can and should stay. the y flip can remain gone. 2016-12-11 15:04:33 -06:00
Azaezel a5755be681 factoring in tangentW casues parallax (but not normals) to swap specular highlight directions. removed that, as well as a prior attempted workaround. 2016-12-06 23:30:35 -06:00
James Urquhart 3496c549b5 Hardware Skinning Support
- Supports GL, D3D9 & D3D11
- Extends vertex formats & shadergen to support blend indices and weights
- Adds basic support for using 4x3 matrices for shader constants
- Supports software fallback
2016-08-21 01:43:30 +01:00
Anis e13513f059 Merge pull request #1713 from Azaezel/c4189_cleanup
adresses C4189 warnings
2016-08-07 00:38:51 +02:00
Azaezel 76fe7937ce adresses C4189 warnings ('identifier' : local variable is initialized but not referenced) 2016-07-31 10:46:52 -05:00
Azaezel 21d1bfa64c 3.9 fix: on the hlsl side: corrects improperly applied specularpower
(slider in conjunction with cubemap). gl side kills a redundant test
2016-07-27 16:48:55 -05:00
Azaezel 942235d114 Fixes vertcolor code insertion order, and applies it adaptively based on defered or forward lit context 2016-05-25 03:08:28 -05:00
Azaezel d79b9a2988 removes w=z trick (was causing fisheye, effectively) 2016-05-18 06:38:13 -05:00
Azaezel 9472bfd3ca addresses https://github.com/GarageGames/Torque3D/issues/1537 via the following:
908be4818f/Engine/source/materials/materialDefinition.cpp (L261) denotes power as sharpness, reflected in the size/falloff of a highlight halo *

908be4818f/Engine/source/materials/materialDefinition.cpp (L264) denotes strength as overall brightness of highlights. **

*and sharpness of reflection if using a cubemap.
**  reflected in cubemapped objects as also degree of 'reflection' vs diffuse/albedo coloration.
2016-03-01 20:25:52 -06:00
Azaezel 496b6a3ea8 truncation warning cleanups dx side (was also causing cornercase crashes gl side) 2016-02-26 00:21:01 -06: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
Azaezel 215ae1429e ensures opengl texSpaceMat is initialized from the get-go (whines in console otherwise) 2015-10-11 22:47:33 -05:00
Luis Anton Rebollo 25a790103e Merge pull request #1116 from Lopuska/patch-16
Intel OpenGL - fix a crash/shader compile error when you activate Vertex...
2015-02-07 22:24:55 +01:00