Commit graph

5390 commits

Author SHA1 Message Date
Azaezel
bc433e7c30 Merge branch 'ColorPickerAdvanced' of https://github.com/Azaezel/Torque3D into ColorPickerAdvanced 2016-02-21 15:31:09 -06:00
Azaezel
ca2ffea6cd Merge branch 'development' of https://github.com/GarageGames/Torque3D into ColorPickerAdvanced 2016-02-21 15:30:54 -06:00
Azaezel
554a871df9 Merge branch 'development' into navMess2
Conflicts:
	Engine/source/navigation/navMesh.cpp
2016-02-21 15:27:12 -06:00
Anis
5c2bfbf82e Update guiColorPicker.h 2016-02-21 22:10:17 +01:00
Anis
aed2e0b5b6 Update guiColorPicker.cpp 2016-02-21 22:09:14 +01:00
Anis
494922d9ed fixed the not working text edit RGB field on color picker. 2016-02-21 18:14:41 +01: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
Dušan Jocić
28d303c5ea Added immutable vertex and index buffers. 2016-02-20 21:28:18 +01:00
Anis
6a2d394d90 Merge pull request #1348 from hpvb/intel-mesa-compile-fix
Fix running on Linux / Intel Mesa drivers
2016-02-20 14:50:22 +01:00
Azaezel
612d932372 Revert "Update navMesh.cpp"
This reverts commit f3ff199554.
2016-02-19 17:34:27 -06:00
Anis
cebfc81d7f Merge pull request #1496 from camporter/linux_compat_fixes
Fix case sensitivity and Platform::fileDelete
2016-02-19 16:50:27 +01:00
Anis
92e5cb3528 Merge pull request #1381 from Azaezel/debugdraw
From Dušan Jocić: additional debugdraw entries.
2016-02-19 16:29:29 +01:00
Anis
9acf487f03 Merge pull request #1332 from Azaezel/guiRelativeYresizes
initial aspect ratio maintaining relative gui scaling
2016-02-19 00:46:20 +01:00
Anis
6f47cb7dfa Update guiControl.h 2016-02-19 00:34:07 +01:00
Anis
df283a2709 Update guiTypes.cpp 2016-02-18 23:33:46 +01:00
Anis
3ca67b3148 Update guiTypes.h 2016-02-18 23:32:19 +01:00
Anis
c4590f6e3d Update guiTextEditCtrl.cpp 2016-02-18 23:30:09 +01:00
Anis
9a2a5b2a90 compile fix. 2016-02-18 16:49:06 +01:00
Anis
d08c0df85d Merge pull request #1512 from Lopuska/OpenGL_FullScreen_Clean
[OpenGL - Win32] This fix a bug during resolution change.
2016-02-18 15:26:21 +01:00
Anis
fe5bf90153 Merge pull request #1102 from Azaezel/mipmap_emission
extraneous mipmap generation prune
2016-02-17 19:02:15 +01:00
Anis
664f6c0639 Merge pull request #1518 from Azaezel/mathUtilsMangle
http://stackoverflow.com/questions/8461832/explicit-qualification-in-
2016-02-16 19:19:19 +01:00
Areloch
4ccef9acf7 Merge pull request #1517 from Azaezel/AccessGranted
Looks good.
2016-02-16 09:34:50 -06:00
Anis
09ae25a567 Merge pull request #1516 from Azaezel/vsprintf_Variant
vsprintf replacement with engine vairant
2016-02-16 14:55:47 +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
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
Azaezel
f8c4dd9d1d http://stackoverflow.com/questions/8461832/explicit-qualification-in-declaration 2016-02-15 19:08:03 -06:00
Azaezel
db4755a00f namespace conflict resolution 2016-02-15 19:05:09 -06:00
Azaezel
d25b03cd52 vsprintf replacement with engine vairant
resolves first issue in
https://github.com/GarageGames/Torque3D/issues/1515#issuecomment-184446719
2016-02-15 18:12:56 -06:00
Anis
f30aac3655 Merge pull request #1424 from rextimmy/fmod_crash_fix
Changed order of fmodex library unload.
2016-02-16 00:26:47 +01:00
Anis
168a2fe029 Merge pull request #1419 from irei1as/patch-1
mQuat.h change to fix QuatF::angleBetween
2016-02-16 00:22:39 +01:00
irei1as
6891d348af Update mQuat.h 2016-02-15 18:50:18 +01:00
irei1as
39613c0d87 Optimized
You're right. If the normalized quaternions are in a variable or something for normal uses it's just a waste to force the change hidden inside again.
2016-02-15 18:43:56 +01:00
Anis
74c189681c Merge pull request #1504 from Lopuska/patch-16
ResourceLeakFix for OpenGL
2016-02-15 14:08:44 +01:00
Anis
b009d678fa Merge pull request #1505 from Azaezel/OcclusionQueryFixGL_Clean
courtessy @Lopuska: opengl occlusion query fix
2016-02-15 14:07:09 +01:00
Anis
7aeec65a3b Update win32Window.cpp 2016-02-13 20:27:30 +01:00
Anis
f3ff199554 Update navMesh.cpp 2016-02-13 18:50:11 +01:00
Areloch
eebb1852f0 Merge pull request #1507 from RoundedIcon/PlayerScalingFix
Works  nicely.
2016-02-13 11:17:28 -06:00
RoundedIcon
7924f056bd Fix for collision issues with scaled players
Players scaled after their creation have collision issues with terrain.
Changing this bit of code fixes those issues for downsized players, even
when shrunk to 10% of their original size.
2016-02-01 16:58:39 -07:00
Azaezel
0f173df0d4 setDetailFromDistance aspect ratio friendly adjustment 2016-01-28 00:42:08 -06:00
Azaezel
6a930f3da1 rigid body on rigid body reactions 2016-01-21 19:05:48 -06:00
Azaezel
d8f889f840 backend fix: rigid on rigid collisions 2016-01-21 19:04:58 -06:00
Azaezel
0678817217 redundancy kill-off 2016-01-21 18:31:47 -06:00
Azaezel
d6b6f36b0a rev 1 refactor for fitting rigidshape into the vehicle hierarchy.
cleaned a few, but by no means all redundancies.

DO NOTE THE FOLLOWING:

   ShapeBase::processTick(move);
    ShapeBase::interpolateTick(dt);

to avoid side effects for now. properly those would be retooled down the line to be more inheritance-friendly.
2016-01-21 18:14:15 -06:00
Azaezel
23c4b52e1f courtessy @Lopuska: opengl occlusion query fix 2016-01-18 00:28:09 -06:00
Anis
e2d789e87d Update gfxGLTextureTarget.cpp 2016-01-18 06:17:20 +01:00
Anis
ca31ef3f1a Update gfxGLWindowTarget.cpp 2016-01-18 06:15:07 +01:00