Commit Graph

84 Commits

Author SHA1 Message Date
x2048
835524654e
Fix shadow mapping when PCF is disabled () 2022-01-02 13:45:55 -08:00
x2048
cef016d393
Apply shadow only to the naturally lit part of the fragment color ()
Fragment color for nodes is now calculated from:

 * Texture color, highlighted by artificial light if present (light color conveyed via vertex color).
 * Texture color highlighted by natural light (conveyed via vertex color) filtered by shadow.
 * Reflected day/moonlight filtered by shadow (color and intensity), assuming some portion of the light is directly reflected from the materials.
2021-10-31 19:18:30 +01:00
x2048
982e03f60d
Improvements to colored shadows () 2021-10-01 16:21:53 +02:00
sfan5
ea250ff5c5 Fix GLES2 discard behaviour (texture transparency) 2021-09-17 18:13:50 +02:00
x2048
bf3acbf388
Distribute shadow map update over multiple frames to reduce stutter ()
Reduces stutter and freezes when playing.

 * Maintains double SM and SM Color textures
 * Light frustum update triggers incremental generation of shadow map into secondary 'future' textures.
 * Every incremental update renders a portion of the shadow draw list (split equally).
 * After defined number of frames (currently, 4), 'future' and 'current' textures are swapped, and DirectionalLight 'commits' the new frustum to use when rendering shadows on screen.

Co-authored-by: sfan5 <sfan5@live.de>
2021-07-25 12:36:23 +02:00
x2048
ff2d2a6e93
Add smooth light-shadow transition at noon ()
Node faces with normals pointing East/West (+X/-X) will transition between light
and shadow at noon. This code makes the transition smooth.
2021-07-25 12:35:12 +02:00
x2048
f5706d444b
Improve shadow rendering with non-default camera FOV ()
* Adjust minimum filter radius for perspective

* Expand shadow frustum when camera FOV changes, reuse FOV distance adjustment from numeric.cpp

* Read shadow_soft_radius setting as float

* Use adaptive filter radius to accomodate for PSM distortion

* Adjust filter radius for texture resolution
2021-07-11 08:15:19 -07:00
Liso
c47313db65
Shadow mapping render pass ()
Co-authored-by: x2048 <codeforsmile@gmail.com>
2021-06-06 18:51:21 +02:00
sfan5
69c70dd319 Fix swapped vertex colors on GLES2 2021-05-11 21:15:39 +02:00
Muhammad Rifqi Priyo Susanto
1abb83b1ab
Use vec4 for varTexCoord in interlaced shader ()
Somewhen in the past, inTexCoord0 was a vec2. Now, it is a vec4.
2021-03-01 13:37:32 +01:00
Vitaliy
03540e7140
Fix GLES shader support after () 2020-12-22 14:53:52 +01:00
Vitaliy
ccbf8029ea
Cleanup shader generation code ()
Shader generation is a mess. This commit cleans some parts up, including dropping remains of HLSL support which was never actually implemented.
2020-12-19 20:57:10 +01:00
HybridDog
e73c5d4585
Fix MSAA stripes ()
This only works when shaders are enabled.
The centroid varying avoids that the textures (which repeat themselves out of bounds) are sampled out of bounds in MSAA.
If MSAA (called FSAA in minetest) is disabled, the centroid keyword does nothing.
2020-12-04 20:16:12 +01:00
numzero
cdcf7dca7c Sky: support GLES2
IrrLicht built-in shader is broken, have to write my own
2020-11-26 12:49:10 -08:00
Vitaliy
707c8c1e95
Shaders for Android (GLES 2) ()
Shader support for OpenGL ES 2 devices (Android)

Co-authored-by: sfan5 <sfan5@live.de>
2020-10-25 18:01:03 +01:00
Lars
ed22260822 Remove all bump mapping and parallax occlusion related code. 2020-10-17 13:09:16 -07:00
hecks
fcff9f2911
Remove "generate normal maps" feature ()
Erase all traces of normal "generation" from fragment shaders
Remove the "feature" from the engine and default config
Remove any leftover documentation of it
2020-09-14 19:27:25 +02:00
mntmn
44c98089cf
shaders: Fix transparency on GC7000L ()
Workaround for the missing GL_ALPHA_TEST implementation in Mesa (etnaviv driver).
2020-08-25 20:49:51 +02:00
Danila Shutov
3a6dfda358
Make shading of CAOs optional () 2020-06-16 20:48:31 +01:00
Danila Shutov
fe3e69eb40
Fix broken coloring of wielditems ()
Fixes a regression that appeared in 5.3.0-dev.
2020-06-09 21:38:09 +02:00
Danila Shutov
cdbe3c5e57
Reuse object_shader for "wielditem" and "item" entity drawtypes () 2020-04-19 18:47:13 +02:00
SmallJoker
c87d52a5fa Shaders: Complete 478e753. OpenGL 4.3 compatiblity 2020-04-18 18:36:47 +02:00
Danila Shutov
661b4a1837
Add tone mapping for entities ()
fixes 
2020-04-06 16:06:40 +02:00
Danila Shutov
ca646487f2
Transform texture UVs with provided tex. matrix ()
fixes 
2020-03-16 22:57:46 +01:00
Danila Shutov
6958071f49
Basic model shading () 2020-02-16 20:37:28 +01:00
SmallJoker
478e753298 Shaders: Fix OpenGL < 4.3 compatibility 2020-02-16 14:14:34 +01:00
Lars Hofhansl
60bff1e6cb Waves generated with Perlin-type noise 2019-11-19 19:42:52 -08:00
lhofhansl
5fde69798c
Simple shader fixes. ()
1. Pass current camera offset to shader, so shader have access to the global coordinates
2. Pass animation timer to fragment shader. C++ code is already there, just wasn't declared in the shader
3. Delay animation timer wrap-around (from 100s to about 16 minutes)
2019-09-26 13:57:39 -07:00
Paramat
42e1a12714
Require 'waving = 3' in a nodedef to apply the liquid waving shader ()
Makes the liquid waving shader per-nodedef like waving leaves/plants,
instead of being applied to all liquids.
Like the waving leaves/plants shaders, the liquid waving shader can
also be applied to meshes and nodeboxes.

Derived from a PR by t0ny2.
2019-03-27 00:18:43 +00:00
xzcx
1c4c0d4673 Shaders: Fix comment line ()
Fixed comment as finalColorBlend() does not exist in the code base.
2018-08-30 20:32:17 +02:00
Vitaliy
28841961ba Rewrite rendering engine ()
* Clean draw_*() arguments

* Split rendering core

* Add anaglyph 3D

* Interlaced 3D

* Drop obsolete methods
2017-10-31 19:27:10 +01:00
paramat
3342dcc4bc Shaders: Remove unused water surface shader
Also remove hardcoded MTGame node.

The 'water surface shader' was duplicated shader code in preparation for
intended new water surface shaders. For development purposes the MTGame node
'default:water_source' had it's top tile assigned to 'water surface shader'.
Due to shader duplication this commit does not cause any change to shader
behaviour.
2017-05-08 05:58:59 +01:00
numberZero
74afe6fe6b Fix fog weirdness () 2017-01-31 08:42:39 +01:00
Dániel Juhász
d04d8aba70 Add hardware node coloring. Includes:
- Increase ContentFeatures serialization version
- Color property and palettes for nodes
- paramtype2 = "color", "colored facedir" or "colored wallmounted"
2017-01-23 07:27:12 +01:00
Lars Hofhansl
923a8f1983 Shaders: Remove unnecessary 'if' statements
Pull if GENERATE_NORMALMAPS == 1 into the template to avoid evaluating
it for each fragment.
Remove if (fogDistance != 0.0).
2016-12-24 00:22:16 +00:00
Lars Hofhansl
075833e393 Fog: Make fraction of visible distance at which fog starts configurable
Optimise the fetching of global settings 'camera_smoothing',
'cinematic' and 'cinematic_camera_smoothing'.
Cache 'cam_smoothing'.
2016-12-07 04:07:54 +00:00
Rogier-5
5f0dc8e78a Fix unexplained shader issue (glsl compiler bug??) () 2016-11-17 02:56:05 +10:00
lhofhansl
6bb4347208 Remove unused shader matrices. () 2016-11-04 18:12:45 +01:00
lhofhansl
198ed60cab Shaders: Remove special handling for liquids. () 2016-10-26 16:24:45 +02:00
Lars Hofhansl
98176481c1 Shaders: Apply tone mapping before fog calculation. 2016-10-25 07:49:19 +02:00
Lars Hofhansl
779d2c5f64 Shaders: Harmonize Irrlicht and shader fog calculations 2016-10-24 07:41:00 +01:00
Lars Hofhansl
0ad40fd484 Use range-based fog instead of z-plane based. 2016-10-13 23:30:15 +02:00
paramat
597c1d73da Nodes shader: Decrease amplitude of waving leaves and plants
Fix initialisation of variable 'disp'
Fix a few minor code style issues
Add independent X motion combining 2 prime frequencies
2016-03-30 01:53:22 +01:00
est31
205e38f5b8 Replace CRLF with LF in shader files 2016-03-25 15:57:18 +01:00
RealBadAngel
e8a3d22cbe Shaders: fix fog not affecting opaque liquids 2016-02-23 23:51:41 +00:00
RealBadAngel
eb3840a3f8 Filmic HDR tone mapping 2016-02-09 02:55:59 -05:00
RealBadAngel
b44da4916a Cleanup selection mesh code, add shaders for halo and selection boxes 2016-02-08 03:57:42 -05:00
RealBadAngel
a64d78a37e Speed up and make more accurate relief mapping
using linear + binary search.
2015-12-10 18:24:11 +01:00
paramat
0b87556048 Shaders: use triple-frequency waving for leaves and plants 2015-09-07 21:52:36 +02:00
RealBadAngel
8b8d17b22b Remove use of engine sent texture tiling flags - theyre no longer needed 2015-08-20 02:41:40 +02:00