Commit graph

96 commits

Author SHA1 Message Date
Juan Linietsky 9738ebcda0 -Fixed height fog (was broken)
-Make sure materials are named in OBJ importer, so they can be saved outside as resources.
2017-11-25 12:32:41 -03:00
Ferenc Arn 6e68c86ba6 Add viewport to the other SceneData struct.
This was missed in #12288.
2017-10-30 20:48:33 -04:00
Juan Linietsky 4785e66eea
Merge pull request #12288 from tagcup/expose_viewport_size
Expose VIEWPORT_SIZE in shader language.
2017-10-30 19:32:21 -03:00
Ferenc Arn a0fc641f25 Expose VIEWPORT_SIZE in shader language.
Fixes #11710.
2017-10-26 15:00:28 -04:00
Rémi Verschelde abea816e54 Revert "Rename Schlick GGX to GGX." 2017-10-23 07:42:36 +02:00
Ferenc Arn fd166d6fda Partially undo #11807.
Specular light at zero roughness needs some discussion. Until we do that, this fixes #12309.
2017-10-22 16:18:54 -04:00
Rémi Verschelde d60b774924 Merge pull request #12297 from tagcup/clearcoat_fix
Don't add clearcoat BRDF to specular light as-is.
2017-10-22 13:18:24 +02:00
Ferenc Arn 06fcbe0092 Don't add clearcoat BRDF to specular light as-is.
BRDF needs to be multiplied with N.L, the incoming light and attenuation. Also specular_blob_intensity should affect clearcoat.
2017-10-21 20:25:17 -04:00
Ferenc Arn cb0bf1edea Rename Schlick GGX to GGX.
Schlick's approximation and GGX are orthogonal concepts.

Furthermore, it's usage so far has been inconsistent: we don't even use it with anisotropic SchlickGGX, and Burley (Disney) diffuse does use it while its name doesn't indicate it.

The use of Schlick's approximation in Burley and GGX is an implementation detail and doesn't need to be reflected to the namig.
2017-10-21 19:35:54 -04:00
Ferenc Arn 6890245321 Corrections to #11807.
Added missing metallic parameter, also fixed a missed a case where wrong roughness condition was used.
2017-10-21 13:40:14 -04:00
Juan Linietsky a2a4f9a62a Merge pull request #11807 from tagcup/roughness_metallic_limiting_cases
Fix the condition when specular light calculation is avoided (should …
2017-10-21 13:44:41 -03:00
Hiroshi Ogawa 59544c74fe Fix render mode specular schlick ggx 2017-10-14 19:32:13 +09:00
Ferenc Arn 9324555998 Fix the condition when specular light calculation is avoided (should be roughness == 1).
Also avoid calculating diffuse light calculation when metallic == 1, and test against clearcoat's own parameter to check whether to do clearcoat.
2017-10-11 17:22:44 -04:00
Ferenc Arn 12596cb5bc Fix anisotropic GGX D function, and introduce and use anistropic GGX G function.
Also fixed isotropic GGX G function with Schlick approximation, and added a commented out version without the approximation.
Added references.
2017-10-09 12:29:05 -04:00
Ferenc Arn f48b162a6b Various clean ups and cosmetic changes in scene.glsl.
Use self-documenting names for variables which are otherwise confusing. Also avoid recalculating certain terms.
2017-10-03 11:02:39 -04:00
Andreas Haas 1e9465096d Merge pull request #11700 from tagcup/clearcoat_fix
Fix clearcoat without Schlick-GGX specular.
2017-10-02 22:51:51 +02:00
Juan Linietsky 66987d6878 missing PI division on vertex shader 2017-10-02 09:09:32 -03:00
Juan Linietsky 1b358783ce Slight proposed fixes to PBR. 2017-10-01 21:51:11 -03:00
Juan Linietsky c864b782c0 Using advise from Matias, left the 0-1 range for lights, divisiom by PI, and multiplied lights by PI internally. 2017-10-01 20:33:38 -03:00
Juan Linietsky c9a925c4e0 Switched Burley/Lambert, and restored diffuse term to 0-1 range for compatibility. 2017-10-01 19:08:49 -03:00
Juan Linietsky 99a464ceb4 Merge pull request #11694 from tagcup/lambert_normalization
Ensure that Lambert is energy conserving.
2017-10-01 12:18:40 -03:00
Ferenc Arn ece18153c6 Add missing N.L factor to Burley's contribution to radiance. 2017-10-01 10:20:57 -04:00
Ferenc Arn dfaf071ae3 Fix environmental BRDF. 2017-09-30 20:28:30 -04:00
Ferenc Arn 3e09b9b335 Fix clearcoat without Schlick-GGX specular.
Fixes #11698.
2017-09-29 10:59:05 -04:00
Ferenc Arn 33c600fedc Ensure that Lambert is energy conserving.
Also remove the diffuse_color factor in Oren-Nayar (which was already taken care of below, oops).
2017-09-29 09:47:06 -04:00
Gilles Roudiere 2c5fa0947d Merge pull request #11672 from tagcup/fix_oren_nayar
Fix Oren-Nayar diffuse.
2017-09-29 13:47:38 +02:00
Ferenc Arn 8cb67b03a9 Fix Oren-Nayar diffuse. 2017-09-28 19:26:01 -04:00
Indah Sylvia 392a94686c Fixed typo: 'texure' to 'texture' 2017-09-29 04:40:01 +07:00
Juan Linietsky 4f39ce32b9 Fixes to light shaders, should work now.. 2017-09-27 21:45:47 -03:00
Ferenc Arn ae78413bb1 Avoid pow in Burley diffuse. 2017-09-26 22:15:38 -04:00
Juan Linietsky 81c9cfdc1b Added light affect parameter to baked AO 2017-09-23 23:10:34 -03:00
Juan Linietsky fbabef6da3 Fixes to rim parameter in shader 2017-09-23 08:27:48 -03:00
Juan Linietsky bf371dcb32 Added proximity and distance fade to SpatialMaterial 2017-09-21 15:20:28 -03:00
Juan Linietsky 1c5376ae59 Many fixes to visual script, changed virtuals override for a proper selector. 2017-09-12 07:58:54 -03:00
Juan Linietsky c023a132d0 Fixed orthogonal projection in all effects and post processes 2017-09-07 20:16:33 -03:00
Juan Linietsky eedb39091a Several fixes to directional shadows, closes #10926
Added option to change directional light range mode, between optimized and stable. For Orthogonal, you might need to use optimized.
2017-09-07 18:00:47 -03:00
Juan Linietsky e192c1a7d3 Fix directional vertex shaded light which was using normal instead of light color, closes #10608 2017-09-05 17:31:09 -03:00
Juan Linietsky e611ff5f01 Fix opaque pre pass, closes #10472 2017-09-04 20:27:45 -03:00
Juan Linietsky 281fb4e4fb Added transmission shader parameter. 2017-09-03 10:30:37 -03:00
Juan Linietsky 089cf8176e removed DISCARD built in variable, replaced by actual discard GLSL instruction, fixes #9677 2017-08-29 10:15:49 -03:00
Juan Linietsky d23f323cde -Moved script run to editor, removed from project
-fixed to code completion
-fix shader crash bug reported by tagcup
2017-08-27 19:04:19 -03:00
Juan Linietsky 90445aae67 Fixed opaque unshaded materials, they go through the regular opaque render list, closes #9917 2017-08-25 09:56:10 -03:00
Juan Linietsky 294e912a84 Fade last cascade in directional shadow, closes #9779 2017-08-22 12:17:20 -03:00
Juan Linietsky df573f5c3a -Restored Sprite3D to working function, fixes #2061, fixes #9738
-Restored an alpha scissor property in Material
2017-08-08 17:23:44 -03:00
Juan Linietsky 2ea64d2dc1 Use vertex distance instead of z, fixes #9108 2017-08-06 21:57:40 -03:00
Juan Linietsky b276d92c8a Few small GI Probe fixes 2017-07-29 00:04:29 -03:00
Juan Linietsky 772485cdb3 Several changes to better run in mobile. 2017-07-22 14:08:17 -03:00
Juan Linietsky 3da3a36034 Many fixes to improve GI Probe quality 2017-07-15 23:24:37 -03:00
Juan Linietsky 5dd7c3b6ab Fix to make voxel cone tracing work properly again 2017-07-15 20:02:56 -03:00
Juan Linietsky 741145febd -Fix for multiple reflection probes causing issues.
-Fix for positional sound corruption to avoid making people deaf.
2017-07-15 18:42:06 -03:00