Commit graph

590 commits

Author SHA1 Message Date
Azaezel
c104313f43 updated empty template with stray script files from devhead that had yet to be converted 2016-05-08 21:21:52 -05:00
Areloch
c645475e56 Adds in some missing script functions that let projectiles damage and destroy physics shapes. 2016-04-26 11:30:24 -05:00
Azaezel
3d6803865c missing samplerstate configurations 2016-04-25 11:36:23 -05:00
Areloch
25d2fd877b Makes the profiler pop-up act on a toggle, and also adds an entry into the World Editor's Tool menu to easily activate it. 2016-04-20 01:06:31 -05:00
Areloch
587ab6a39e Adds 2 fields to expose the net simulation functionality more readily to the NetGraph GUI.
Also added a Tools option to the World Editor menubar, with the NetGraph as the first option to make it easier to activate the NetGraph in the editor.
2016-04-20 00:46:41 -05:00
Areloch
bab55d46a9 Merge pull request #1555 from Azaezel/CausticCaustics
fix for broken caustics reference
2016-04-19 22:04:00 -05:00
Azaezel
88356ae37f subsurface followup: cleanups and corrections for vectorlightP, fillins for spot, point, and opengl equivalents 2016-04-15 16:06:10 -05:00
Azaezel
00cc949011 reimplements a form of subsurface scattering 2016-04-15 00:20:55 -05:00
Areloch
60ffb8e902 Merge pull request #1568 from Azaezel/soSensitive9001
case sensitivity typofix
2016-04-10 09:28:47 -05:00
Azaezel
df3cb6cb44 case sensitivity typofix 2016-03-25 18:46:25 -05:00
rextimmy
3a9b50f702 Direct3D11 common shader changes. 2016-03-20 21:50:21 +10:00
Azaezel
7f4bfad10a fix for broken caustics reference 2016-03-16 23:54:47 -05:00
Azaezel
4b983cf23e exposes several datablock entries to the particle editor gui subsystem
windCoefficient, animateTexture, framesPerSec, animTexFrames*, animTexTiling

*at time of writing, it will read and write this entry to disk, but will not update in realtime.
2016-03-11 23:36:00 -06:00
Azaezel
1c854b6009 opengl crashfix pow(x,y) needed to be passed matching vartypes. 2016-02-29 04:17:42 -06:00
Areloch
908be4818f Merge pull request #1519 from Azaezel/deferredShading
Deferred shading
2016-02-27 15:08:20 -06:00
Areloch
c0e29d4a22 Correction for 2 of the render bin settings, as well as correcting the water shader over-exposing it's reflections. 2016-02-27 13:13:12 -06:00
Anis
a34cf9e3f9 Merge pull request #1185 from MusicMonkey5555/script-improvements
Improved file open dialogue
2016-02-26 23:01:24 +01:00
Azaezel
ca2ffea6cd Merge branch 'development' of https://github.com/GarageGames/Torque3D into ColorPickerAdvanced 2016-02-21 15:30:54 -06:00
Anis
5947933f99 Merge pull request #1434 from blackwc/fullscreen-cli-fix
fullscreen and windowed mode cli fix
2016-02-19 16:59:42 +01:00
Azaezel
8c5810adad The final step (barring any overlooked missing bits, requested refactors, and of course, rolling in dependencies already submitted as PRs) consists of:
renderPrePassMgr.cpp related:
A) shifting .addFeature( MFT_XYZ); calls from ProcessedShaderMaterial::_determineFeatures to ProcessedPrePassMaterial::_determineFeatures
B) mimicking the "// set the XXX if different" entries from RenderMeshMgr::render in RenderPrePassMgr::render
C) fleshing out ProcessedPrePassMaterial::getNumStages() so that it shares a 1:1 correlation with ProcessedShaderMaterial::getNumStages()
D) causing inline void Swizzle<T, mapLength>::ToBuffer( void *destination, const void *source, const dsize_t size )  to silently fail rather than fatally assert if a source or destination buffer is not yet ready to be filled. (support for #customTarget scripted render targets)

Reflections:
A) removing reflectRenderState.disableAdvancedLightingBins(true); entries. this would otherwise early out from prepass and provide no color data whatsoever.
B) removing the fd.features.addFeature( MFT_ForwardShading ); entry forcing all materials to be forward lit when reflected.
C) 2 things best described bluntly as working hacks:
C1) when reflected, a scattersky is rotated PI along it's z then x axis in order to draw properly.
C2) along similar lines, in terraincellmaterial, we shut off culling if it's a prepass material.

Skies: scattersky is given a pair of rotations for reflection purposes, all sky objects are given a z value for depth testing.
2016-02-16 02:50:49 -06:00
Azaezel
5ed06fff9d Script:
by and large, Opengl branch compatibility alterations, though do again note the inclusion of
   sampler["lightBuffer"] = "#lightinfo";
   sampler["colorBuffer"] = "#color";
   sampler["matInfoBuffer"] = "#matinfo";

and
   samplerNames[5] = "$lightBuffer";
   samplerNames[6] = "$colorBuffer";
   samplerNames[7] = "$matInfoBuffer";
entries. This is where the engine knows to pass along a given rendertarget for input into a predefined shader, as opposed to the prior phase's output to targets within procedural ones.

Shader:
the XXXLight.hlsl/glsls account for alterations in inputs, check for emissive and translucency, apply Felix's Normal Mapped Ambient. and pass the results along to  AL_DeferredOutput for final computation before returning the result.
the lighting.hlsl/.glsl consissts of removal of the overridden engine-specific phong specular variant, and defines the  AL_DeferredOutput  method, which equates to the previously used pixspecular feature defined along the lines of
http://books.google.com/books?id=GY-AAwAAQBAJ&pg=PA112&lpg=PA112&dq=blinn+phong+specular+gloss+hlsl&source=bl&ots=q9SKJkmWHB&sig=uLIHX10Zul0X0LL2ehSMq7IFBIM&hl=en&sa=X&ei=DbcsVPeWEdW1yASDy4LYDw&ved=0CB4Q6AEwAA#v=onepage&q=gloss%20&f=false

also includes visualizers

Long term impact: This area, along with the \game\shaders\common\lighting\advanced\lightingUtils.hlsl/.glsl pair will be where we plug in properly attenuated Cook-Torrence later, presuming the impact is not to hefty.
2016-02-16 02:29:54 -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
5b5c6b9907 Deferred Shading
Phase 1: buffers
engine:
provides the following hooks and methods
A) render target "color", and "matinfo". these correspond to texture[0] = "#color";  texture[2] = "#matinfo"; entries in scripts
B) utilizes the independentMrtBitDepth method added GarageGames#857 to set color to an 8RGBA if cards support it
C) adds an RenderPrePassMgr::_initShaders() method to support void RenderPrePassMgr::clearBuffers(). This operates as a pseudo-postfx by rendering a veiwspace plane which fills the screen, then calls a shader which fills both the introduced rendertarget buffers and the prepass buffer to relevant defaults (white with full alpha for prepass, black with full alpha for color and material respectively)

script:
\game\tools\worldEditor\main.cs adds additional hooks similar to GarageGames#863 for colorbuffer, specular map, and backbuffer display
\game\core\scripts\client\lighting\advanced\deferredShading.cs adds the clearbuffer shader, visualizers, and the ShaderData( AL_DeferredShader )  +  PostEffect( AL_DeferredShading ) which combine the various buffers into the output which reaches the screen under normal conditions, as well as the extended debug visualizers.
again, note the lines

   texture[0] = "#color";
   texture[1] = "#lightinfo";
   texture[2] = "#matinfo";
   target = "$backBuffer";
in particular for the core tie-in.

shader:
\game\shaders\common\lighting\advanced\deferredColorShaderP.hlsl
\game\shaders\common\lighting\advanced\gl\deferredClearGBufferP.glsl
the previously mentioned shaders which clear the buffers to specified colors

\game\shaders\common\lighting\advanced\deferredShadingP.hlsl
\game\shaders\common\lighting\advanced\gl\deferredShadingP.glsl
the tie-in shaders

the rest are visualizers

purpose: to expose methodology that allows one to render color, lighting and material information such as specular and gloss which effect the result of both when combined

long term intent: the previous prepass lighting methodology while serviceable, unfortunately had the side effect of throwing out raw color information required by more modern pipelines and methodologies. This preserves that data while also allowing the manipulation to occur only on a screenspace (or reflected speudo-screenspace) basis.
2016-02-16 01:50:58 -06:00
Areloch
cb22357eb2 Merge pull request #1461 from Azaezel/textureLinearization
Diffuse/albedo texture linearization
2016-02-16 01:23:16 -06:00
Areloch
98b3d3294d Merge of PR #855 2016-02-16 00:23:02 -06:00
Areloch
a90eb9762b Re-submission of the Volumetric Fog PR, with cleanup. 2015-12-01 00:10:13 -06:00
Areloch
498ed63f0b Merge pull request #1438 from Azaezel/rektRadius
explosion cover miscalc
2015-11-14 00:43:49 -06:00
Areloch
1a009d6dd3 Merge pull request #1443 from Areloch/TAM_Implementation
TAML, Assets and Modules implementation
2015-11-12 23:54:27 -06:00
Areloch
92aa785bb2 Merge pull request #1442 from Azaezel/shadow_caching
This all seems to work pretty well.
2015-11-12 12:49:58 -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
9d726bb9ed Merge pull request #1453 from blackwc/playJournal-template-fix
playJournal fix and removed depcrecated command line options
2015-11-09 10:24:30 -06:00
Azaezel
b778121fc4 castDynamicShadows defaults to false, flipped it over to true for materials on mobile/animated assets. 2015-11-02 23:06:51 -06:00
Azaezel
24f7dc8314 rtparams(#) needs to match the ssaomask register 2015-11-02 23:01:43 -06:00
blackwc
ca37e9f84e fix playJournal instruction in comments 2015-10-28 22:52:16 -04:00
blackwc
bba604a043 playJournal fix and removed depcrecated command line options 2015-10-28 22:46:17 -04:00
Areloch
48d38ca803 Merge pull request #1447 from blackwc/radioButton-image-new
improved radio button
2015-10-27 00:26:21 -05:00
Areloch
8253bcc343 Merge pull request #1446 from rextimmy/water_vertex_format_fix
Looks to work fine. Thanks!
2015-10-24 02:12:46 -05:00
blackwc
ea1931d215 improved radio button 2015-10-23 20:37:22 -04:00
rextimmy
9c6ff1775b Removed unused vertex colors from GFXWaterVertex 2015-10-22 21:54:35 +10:00
Areloch
a72802b677 Merge pull request #1435 from Azaezel/glowDebugEmpty
Looks good
2015-10-21 00:56:59 -05:00
Areloch
aba6cf2d9e Merge pull request #1436 from Azaezel/ribbonShadersEmpty
Agreed, it makes sense that the shaders are common, so that people can start with empty and add their own art without worrying about stuff not working as expected.
2015-10-21 00:51:22 -05:00
Areloch
f41f9fb7c8 Merge pull request #1431 from blackwc/sfxCompareProvider-fix
Seems to work fine.
2015-10-19 22:20:18 -05:00
Azaezel
348a0f20d9 Looks like according to reports, they also weren't checking for physicsshapes. 2015-10-18 23:48:29 -05:00
rextimmy
246785a8bf Removed unused vertex formats from ScatterSky 2015-10-16 21:30:39 +10:00
Azaezel
2753f562e8 shadow caching
SPECIAL NOTE: highly suggest https://github.com/GarageGames/Torque3D/pull/1441 or a variation thereof to prevent debug spew and false-postives for occlusion results.

With significant research, development and prototyping assistance from both @andr3wmac (shaders and partial hook work), and @LuisAntonRebollo (additional culling)

System operates as follows:
1) materials are given an additional castDynamicShadows boolean entry. (Default at time of writing is true by request. Personal usage at time of writing defaults to false. value is default-initialized in materialDefinition.cpp. script/gui exposed)
2) lights are given a staticRefreshFreq and dynamicRefreshFreq (in milliseconds). script/gui exposed
3) materials are (effectively) sorted into dynamic and static shadowmap render lists based on flag. (see shadowMapPass.cpp)
4) initial shadowmaps are generated for each light and 'list'.
5) as each refreshFreq times out, the relevant shadowmap for a given light is refreshed.

Special notes:
dynamicRefreshFreq for all lights is set to a (script exposed) 8MS refresh timer.
StaticRefreshFreq for the lions share of lights defaults to 250 MS (1/4 of a second)
scattersky's embedded light, which is intended to operate in a mobile manner, defaults to 8
to reiterate, these are all customizable per-light via script/inspector gui in the case of alternate project needs.
2015-10-13 18:12:19 -05:00
Areloch
7a3b40a86d Initial Implementation of the Taml, Asset and Modules systems.
Only has example and shape assets currently.
2015-10-13 15:19:36 -05:00
blackwc
ef5bdc66d3 fullscreen and windowed mode cli fix update 2 2015-10-11 02:34:21 -04:00
Azaezel
2da94ed4ee explosion cover miscalc
%distscale can actually end up negative. causes miscalculations for applyimpulse and the like (or even healing if you've hacked in the capacity for negative damage)
2015-10-09 17:43:00 -05:00
Azaezel
a100a00c99 missing ribbon shaders, empty template 2015-10-07 05:40:05 -05:00
Azaezel
e0c275b56b missing empty template glow pass debug tool 2015-10-07 05:36:44 -05:00