93 Commits

Author SHA1 Message Date
rem..om
3c84826db1 Shadows,fixed an issue when PolyOffset was not properly applied on lighting material
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10044 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-12-24 10:14:34 +00:00
rem..om
01bf1ca843 Fixed 2 issues with shadows :
- Looks like Poly offset behave defferently between ATI and NVIDIA i added a bit of offset to avoid shadow acne for NVIDIA
- Added a flag needCompareModeUpdate in the Texture class to avoid setting it on every frame in the renderer. I changed Lwjgl and Jogl renderer accordingly.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10043 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-12-23 13:55:17 +00:00
Zer..om
ecb8b0508d (Hopefully) Fixed a shader problem on macs where it was trying to multiply an int with a float...
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10021 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-12-05 13:05:59 +00:00
rem..om
84e4f0f8ad Ten thousand monkeys !!
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10000 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-11-16 21:22:15 +00:00
rem..om
0dadaa80f5 Shadow system refactoring.
- Basic and PSSM shadow renderer are now deprecated
- There is now one processor and its filter conterpart for each light type
- created an abstract shadow processor that hold the common shadowing code. It's totally independent of the shadow technique used.
- extracted the CompareMode and FilterMode enum to their own files.
- renamed FilterMode enum to EdgeFilteringMode
- refactored the shader code, to avoid duplicate code. all shadow related code is now gathered into Shadows.glsllib and Shadows15.glsllib.
- added spot light Shadows
- removed the ShadowCamera class as it was not used.
- removed "pssm" in the naming of classes, shader and shader libs since it's not relevant anymore

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9971 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-11-07 08:38:56 +00:00
rem..om
66ddbb654d Point light shadows first push. Working solution based on rendering 6 different shadow maps.
Made a PointlLightShadowRenderer and a PointLightShadowFilter.
- This will need a lot of refactoring as a lot of code is duplicated with the PSSMShadowRenderer
- Also i plan to change the Shadow map rendering to a cubemap instead of 6 separate textures.
Added a cornell box model and a test case


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9942 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-11-03 09:38:33 +00:00
rem..om
d1a036a021 Pssm now supports fade out of the shadows when using a zextend
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9929 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-10-31 15:53:33 +00:00
rem..om
a5b8b48ea1 fixed an isue in shadow shaders where shadows outside of the shadowZExtend were dark instead of light.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9905 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-10-26 16:20:31 +00:00
rem..om
cbafa1852b Shadows : There is now an alternative to the PssmRenderer : the PssmFilter that has to be used as any other filter. It does the same ass the PssmRenderer except the post shadow pass is done in screen space making it run very faster on scene that have a lot of shadow recieving Geometries.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9787 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-09-29 09:38:53 +00:00
PSp..om
f0d4f86dd8 Updates to use logical ID mapping instead of names.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9785 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-09-27 22:26:25 +00:00
PSp..om
4b4ae178e5 Added a basic way to have default remappings of
joysticks that properly report their name.  It's
a simple system using properties files on the
classpath.  A core file has been added with at
least one known remapping.
Buttons and axes can be renamed but they can't
yet be flipped.  If needed that can be added
later.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9774 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-09-25 06:31:25 +00:00
rem..om
d980519674 Re-introduced alphaDiscardThreshold in lighting frag
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9768 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-09-24 16:40:03 +00:00
rem..om
bdb715e527 Shadows : attempt two to fix them on mac.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9757 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-09-21 20:26:08 +00:00
rem..om
6c2dcc472d Lighting and Shadows :
- removed the const keyword for the poisson disk array declaration in the shader (attempt to fix the shader on mac)

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9754 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-09-19 16:25:32 +00:00
rem..om
384f4ac1c2 Lighting and Shadows (PSSM only) :
- re introduced the alphaDiscardThreshold as explained in prvious commit. It's not binded to the AlphaTestFallOff fixedfunc binding
- Added a small poly offset to post shadow technique, this greatly help in fixing shadow acne.
- Added Poisson disc sampling PCF Filtering for shadows
- Properly passed the shadow map size as a define in the shaders and remove the hardcoded value
- Pssm15 don't use the textureSize function anymore and use the same shadow map size define ( this increased performance quite a bit)
- Optimized the shaders code a bit
- Better PSSM test

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9750 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-09-18 21:37:11 +00:00
Sha..rd
0a38ca0cf4 * GLSL spec allows having unset uniforms/attributes/varyings as long as they are not used in the shader, thus they are now always in scope
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9622 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-08-05 21:59:58 +00:00
rem..om
a38c61a65a Fixed syntax error in post shadow shader
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9573 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-07-20 21:21:39 +00:00
rem..om
28926b8383 WaterFilter can now have a square shape
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9553 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-07-10 22:19:03 +00:00
Sha..rd
27e97c34da * 'FixedFunc' technique were wiped out entirely. Not useful since now we choose default technique based on caps anyway.
^ Make sure to fix your materials by removing the 'FixedFunc' name from your fixed pipeline techniques! Or remove then entirely if the material doesn't support OpenGL1 ...

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9546 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-07-10 03:56:51 +00:00
Sha..rd
8d7b054b31 * Sky shader now normalizes direction in fragment shader instead of vertex shader
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9533 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-06-30 18:01:50 +00:00
Sha..rd
c498e79511 * Gui shader now supports vertex color on GL1
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9532 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-06-30 18:00:53 +00:00
rem..om
3f5fd9f6c3 Parallax mapping : changed calls to texture2DLod to texture2D as it fails on mac since it shouldn't be used in a frag shader
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9384 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-05-13 19:51:57 +00:00
rem..om
9d7d5a388c Shadows/SSAO and transparency : Removed the AlphaDiscardThreshold from the frag shaders
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9334 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-04-30 11:39:21 +00:00
rem..om
22edb7beb0 Shadows/SSAO and transparency : Removed the AlphaDiscardThreshold attribute from the lighting material. Transparency discarding is now handled by the AlphaFallOff render state (as it should be).
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9330 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-04-29 20:32:08 +00:00
ShA..Rd
ac59c1ffdf * Fix link error in glow material techniques
* DesktopAssetManager now works as before (flipY and generate mips options are enabled)
 * Fix crash in TestSimpleWater

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9322 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-04-19 02:25:10 +00:00
Sha..rd
60e0e46344 * Remove usage of "SimpleTextured" shaders from other materials
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9320 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-04-15 21:20:37 +00:00
Sha..rd
5d37b914e1 * Removed deprecated material definitions
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9315 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-04-14 20:19:13 +00:00
Sha..om
9aacd96926 * PostShadowPSSM: Made texSize const, to fix shader error
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9284 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-04-09 17:39:43 +00:00
rem..om
bf55974bf4 Changed the way post shadow pass is done. It's now a technique of the lighting material definition.
This allow to have shadows that fully works with partially transparent objects (like trees).
If a material does not have the postShadow technique, the renderer uses the fallback material (like before).

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9279 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-04-07 19:55:43 +00:00
rem..om
203bc00a7d Lighting material now normalize normal value read from the normal map to avoid banding artifacts
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9261 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-03-25 12:36:27 +00:00
rem..om
5671358657 Soft particles implementation.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9223 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-29 22:26:37 +00:00
Sha..rd
3dfe3d70f5 * Re-added conditional in Lighting.frag to avoid NVIDIA bug. It uses control flow but most GLSL compilers should optimize it to compare and set.
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9204 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-25 19:51:35 +00:00
nor..67
9978684407 - move effects and networking to separate jar files
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9189 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-24 12:16:33 +00:00
rem..om
26ffa11655 - Fixed parallax distortion thanks to Survivor
- Used a quad in TestParallax instead of a grid

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9173 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-18 08:17:07 +00:00
rem..om
512ebfaa1f Fixed artifact on simple water for old intel card thanks to Androlo
http://jmonkeyengine.org/groups/graphics/forum/topic/fixed-problem-in-simple-water/#post-162943

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9145 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-11 16:56:12 +00:00
Sha..om
3bceee24fb * Fixed syntax error due to implicit float -> vec3 conversion in PostShadowPSSM15.frag
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9134 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-02-04 05:17:45 +00:00
nor..67
697d23ddc0 - fix FXAA shader BlindCoding(TM) bug
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9096 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-01-18 01:36:13 +00:00
sha..rd
d0699f5c60 * FXAA now supports baseline GLSL 1.00 instead of GLSL 1.3
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9095 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-01-18 01:14:06 +00:00
sha..rd
e9a28ced31 * Cleaned up FXAA shader, moved requirement to GLSL 1.3, removed dependency on EXT_gpu_shader4
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9094 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-01-18 00:07:40 +00:00
Sha..rd
8d7aed43d1 * Removed useless vPosition varying from Lighting shader
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9009 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2012-01-09 04:36:04 +00:00
sha..rd
dcb71def31 * Specular color is now black by default
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8333 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-10-02 19:15:38 +00:00
Sha..om
d38b469de6 * Fix for "Internal error wrong operand type built in unary operator function. Type: in sampler2DMS" if multisample is not being used (old ATI driver bug)
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8326 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-10-02 04:42:11 +00:00
sha..rd
c8f96e47a4 * Fixed Lighting.frag compile error when using vertex lighting
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8291 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-09-24 18:00:14 +00:00
nor..67
2eca2f0bdd - fix some int * float errors in Parallax.glsllib, still crashing on mac due to lines 39/42
com.jme3.renderer.RendererException: compile error in:ShaderSource[name=Common/MatDefs/Light/Lighting.frag, defines, type=Fragment] error:ERROR: 0:45: Call to undeclared function 'texture2DLod'

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8260 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-09-16 22:22:07 +00:00
rem..om
1ca81c3355 Added GammaCorrectionFilter contributed by phate666
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8256 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-09-16 08:56:59 +00:00
sha..rd
dd7495185c * Do not use control flow in GLSL version 1.0 in Lighting.frag
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8170 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-09-04 06:08:48 +00:00
sha..rd
f421e2a876 * Removed shiny check in Lighting.frag (for ATI Radeon X1600 and similar)
* Applying default values for materials inside old J3O files
 * Default shininess in TerrainLighting

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8163 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-09-03 22:39:02 +00:00
rem..om
367c9c3799 Fixed typo in FXAA filter
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8087 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-08-25 16:25:52 +00:00
rem..om
5f5eb708da - Added steep parallax mapping, activate it by setting SteepParallax attribute to true in lighting material
- Refactored paralax calculation code in Parallax.glsllib
- Added a boolean param to lighting material PackedNormalParallax to specify if the parallax map is stored in the alpha channel of the normal map (it was already implemented in the shader). added a dds file and a material using this
- The parallax height can now be set by users by setting the ParallaxHeight attribute. default is 0.05
- Deleted old normal map for water
- Inverted green channel of the brickwall normal texture to look good with recent change in normal calculation in lighting material
- Created a test case for parallax mapping where you can swich from classic to steep parallax using spacebar, and where you can tweak the parallax heigh by using I and K keys.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8046 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-08-20 21:42:47 +00:00
rem..om
75b320b7d6 Better normal map for water
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8044 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
2011-08-20 13:41:03 +00:00