Commit Graph

831 Commits

Author SHA1 Message Date
Benau
e06fabde96 Clean up alpha test and unlit shader
Remove 1 wrong line in alpha test shader
2018-02-01 11:26:58 +08:00
Benau
154ad8d0db Fix skybox blending with light scatter 2018-01-31 01:31:12 +08:00
Benau
9e57bfb73f Split point light scatter so it can be combined together 2018-01-30 13:42:50 +08:00
Benau
11f9b74e13 Don't use out variable in vertex shader 2018-01-28 15:28:20 +08:00
Sam
c4b42c1852 Add layer of abstraction to output pbrData 2018-01-26 20:16:16 +01:00
Sam
e75f1cb799 Merge branch 'master' of https://github.com/supertuxkart/stk-code 2018-01-26 10:52:23 +01:00
Benau
97fd634ed8 Allow auto-add usable uniforms to shader 2018-01-26 16:02:31 +08:00
Benau
ff38cb6423 Clean up advanced pipeline off code
Don't use RTT at all in game when it's off
2018-01-25 15:36:34 +08:00
Sam
37a6f464b9 Merge branch 'master' of https://github.com/supertuxkart/stk-code 2018-01-24 21:51:11 +01:00
Benau
e5cdf3a086 Remove all unneed gamma correction when advanced pipeline off
Except for the colorization stuff
2018-01-23 01:16:45 +08:00
Benau
86393ba0a9 Use alphatest as a fallback shader for unlit
Adjust graph shader when advanced pipeline off, and no srgb prefilled
texture when advanced pipeline off
2018-01-22 13:27:21 +08:00
Benau
45957af6f8 Remove !sRGB in shader which is always true now
Also don't use tonemap in RTT
2018-01-22 12:54:39 +08:00
Benau
4025883243 Use sampleTextureLayer in shader files 2018-01-22 10:43:22 +08:00
Benau
390554eca1 Add xml shader and the loader 2018-01-21 13:19:00 +08:00
Sam
6abd79dde6 Add the world position in default information avaliable to shaders 2018-01-14 10:39:16 +01:00
Benau
24308ced03 Remove features in SP that give no performance boost at all
gl_Layer in vertex shader, bindless and array textures
2018-01-13 14:49:33 +08:00
Benau
68e8da2353 Remove all unused shaders 2018-01-12 19:10:55 +08:00
Benau
76788d7dd8 Fix GLES 2018-01-07 15:44:57 +08:00
Benau
e1c7efd68c Add sam's formula for pbr 2018-01-05 16:45:33 +08:00
Benau
cce8abe6f3 Port billboard text 2017-12-30 15:28:04 +08:00
Benau
d71ea71e35 Remove some ifdef 2017-12-29 18:10:51 +08:00
Benau
711fb8211a Add samuncle way to sample texture slot 2017-12-29 15:39:22 +08:00
Benau
f040be710e Fix normal visualizer 2017-12-29 00:52:29 +08:00
Benau
62e0effed6 Rename input variables 2017-12-27 12:31:21 +08:00
Benau
dbc3cd5ff5 Normalize in shader for broken drivers 2017-12-27 11:33:30 +08:00
Benau
891b053358 Add more functions to normal visualizer 2017-12-27 01:33:21 +08:00
Benau
ce45605c18 Use half float for texture matrix 2017-12-26 15:28:01 +08:00
Benau
daf1294e6f Add minimap and adjust unlit shader for it 2017-12-26 14:34:34 +08:00
Benau
7797115867 Add SP for correct normal and easier shader system 2017-12-25 14:00:10 +08:00
Deve
f7886a31bf Better fix for shadow acne 2017-10-29 20:26:46 +01:00
Benau
fc2e05c0a6 Use a trick to make skinned mesh shader branchless 2017-10-22 13:03:45 +08:00
Benau
7252a38da1 Fix skinning glitches possible in (some) cards 2017-10-22 02:17:37 +08:00
Benau
6a79d204c1 Don't use SSBO for skinning
It causes trouble in hd5670 in windows
2017-10-22 01:31:15 +08:00
Benau
8a0232382a Some fixes for some shader compiler 2017-10-20 09:25:43 +08:00
Benau
553b2439ac Allow using SSBO for skinning if supported 2017-10-20 01:27:44 +08:00
Benau
0d96906d54 Use texture buffer (texture2d in gles) for skinning 2017-10-19 13:31:07 +08:00
Benau
9f10676dd3 Remove unused billboard shader 2017-10-16 07:43:00 +08:00
Benau
4573e51e98 Fix #2427 2017-10-15 19:14:07 +08:00
Benau
058f9163db Some work to make particle shader able to render billboard
The lifetime in height map stimulation will always now < 1.0f
2017-10-15 13:57:01 +08:00
Benau
c3a22ddcf7 Pre-generate some particles if max count is small 2017-10-14 14:42:24 +08:00
Benau
a0c9ba2b8c Pack mixed color into instanced array
With half-floats for lifetime and size for same stride
2017-10-14 12:33:08 +08:00
Benau
0b9a3e1c69 Fix some issues found in first-try 2017-10-14 09:47:13 +08:00
Benau
0066722dab Features completed cpu particle 2017-10-14 00:19:59 +08:00
Deve
63ecbefbdd I forgot about particles 2017-10-12 22:55:26 +02:00
Deve
ae4e302741 Add a way to run STK without srgb framebuffer 2017-10-09 21:18:15 +02:00
Deve
bc84559f1d Revert a hack for shadows.
It helps for horizontal surfaces, but makes vertical surfaces worse (for example rocks in cornfield crossing), so it's not really a solution.
2017-10-04 22:19:19 +02:00
Deve
27a79526b1 Allow to use particles heightmap simulation in GLES 2017-10-02 23:05:12 +02:00
Deve
6f11a1669f Make particles in GLES renderer to look a bit better.
Now kart exhaust is not too dark anymore.
2017-09-02 01:01:35 +02:00
Benau
850afc8620 Allow using animated texture with displace shader
Plus some clean-up
2017-08-23 00:55:25 +08:00
Benau
cc8331f5cd Fix #2897 2017-08-09 15:03:37 +08:00
Benau
79c6705bb1 Fix #2814 2017-08-09 13:00:09 +08:00
Deve
bc6ff38b22 Simplify light factor when advanced lighting is disabled.
In this case only diffuseMatColor really matters, other values are constant.

It improves performance on GLES renderer and it's also noticeably faster for GL on desktop.
For example:
- fps increased for me from 60 to 69 on Hacienda with intel HD 4000
- from 43 to 49 on lighthouse

There is much less difference on nvidia graphics card, but still it gives small performance improvement.
2017-08-06 22:18:18 +02:00
Deve
d44802a482 Add a workaround for some qualcomm devices on android 4.4 2017-07-11 00:37:31 +02:00
Benau
8653d410f8 Option 1 for fixing android 4.4
Reinit vertex attribute pointer each time, performance may hurt
2017-07-09 00:46:42 +08:00
Deve
af98b526d6 Give few more fps in GLES renderer by pre-computing diffuse/specular color 2017-03-28 22:15:33 +02:00
Deve
a7f0d3762c Some fixes for GLES renderer.
- Don't use BGRA format at all. It doesn't work with non-typical cases (i.e. with srgb or compressed textures) and also casues artifacts on some android devices. I kept the extension in central settings, but it probably won't be used.
- Use sRGB texture format when advanced lighting is enabled. This makes it closer to the original OpenGL renderer and also avoids to have even more #ifdef's for sRGB conversions.
- Keep RGBA textures for non-advanced lighting to make it simpler.

Now advanced lighting in GLES looks almost the same as in OpenGL 3.x (without shadows/GI)
2017-03-25 22:23:46 +01:00
Sam
97670ed23c Improved wind effect for vegetation 2017-03-12 21:35:48 +01:00
Deve
adfa8f30f9 Better fix for missing transparency in GLES legacy pipeline 2017-03-08 23:17:03 +01:00
Deve
11024569b0 More tweaks to GLES legacy pipeline 2017-03-02 22:19:10 +01:00
deve
82e724c12e One more fix for GLES legacy pipeline 2017-02-27 06:41:26 +01:00
Deve
40fe3585bb One more fix for legacy pipeline in GLES renderer.
It looks that the second texture is not used at all and it may cause a crash, so just disable it.
2017-02-27 00:58:43 +01:00
Benau
c635e8d1c4 Get rid of some srgb conversion in shader, see #2787 2017-02-13 10:06:35 +08:00
Deve
68a99fd38b Fixed sRGB for GLES renderer.
It's a bit ugly solution because we should handle it properly in one place and not add another sRGB correction... But it's already working solution and it doesn't affect the OpenGL renderer, so we can use it until better fix will be done.
Now the GLES renderer looks almost the same as the original OpenGL 3.x one :)
2017-02-11 23:56:44 +01:00
Deve
5df2531a65 Added a hack that removes ugly lines when shadows are enabled.
Mathematically it's not 100% correct, but it looks much better.
2017-02-07 21:48:50 +01:00
Deve
28d85d7ba3 Use explicit attrib location when the extension is available.
It allows to enable it easily in GLES renderer. And we check if this extension is available anyway because it's needed for shadows, so we can use it for other shaders too.
2017-02-01 21:58:10 +01:00
samuncle
e86e146442 Add emit map to a shader, so cars in candela are like small dots 2017-01-20 00:06:35 -05:00
samuncle
b9dd867c86 Use gamma corrected decal 2017-01-14 09:41:29 -05:00
Deve
6a16f23132 Fixed GLES 2016-12-31 03:41:37 +01:00
samuncle
b669382b93 Change the detail map to a more usefull decal shader. Now we can add easily details to texture 2016-12-28 10:23:07 -05:00
Deve
424b62552e Fixed MLAA in GLES renderer.
This function was used by Cand for his OpenGL 2.1 renderer. The round function is available since GLSL 1.3 (OpenGL 3.0), so there is no need to override it.
If it will be needed in future, I suggest to change the name to round_stk or something similar.
2016-12-23 15:12:16 +01:00
Benau
15d6c7207a Minor improvements for non-instanced shaders 2016-12-23 19:22:30 +08:00
Benau
d932451295 Don't out a interpolated color change
It will should be determined by colorization mask in fragment shader
2016-12-23 11:38:32 +08:00
Benau
f7e2122b79 Allow drawing instanced glow color without explicit location 2016-12-23 10:36:35 +08:00
Benau
8008ec851e Allow to use hardware skinning with opengl 3.1
Now we only need UBO to store the joint matrices to support it
2016-12-23 01:31:13 +08:00
Benau
4f2e2331ee Correct the spelling of shader files 2016-12-18 14:59:37 +08:00
Benau
752d847b09 Add the remaining shaders for GL3 hardware skinning
Also use the same shader code for normal map shader
2016-12-15 15:55:14 +08:00
Benau
a696fd6dff Add transparent skinned mesh shader 2016-12-15 09:52:02 +08:00
Benau
85bd8c3146 Add unlit and normal map skinned mesh shader
Also fix normal map with skinned mesh, now vertices and joints
will be recalculated for tangents mesh
2016-12-14 16:28:37 +08:00
Benau
e9b68a8a1f Use a non-hardcoded values for mat4 array (max 1024)
Also cull mesh that doesn't have enough space to be rendered
2016-12-11 15:50:53 +08:00
Benau
8ca0c54bdc Merge remote-tracking branch 'origin/master' into hardware_skinning 2016-12-10 10:09:30 +08:00
samuncle
ae0b1136f5 better shader for underwater vegetation 2016-12-09 11:38:56 -05:00
Benau
c68492f42b Use a for loop for four bones (thanks leyyin suggestion!) 2016-12-09 23:21:41 +08:00
Benau
94f6d09bf5 Allow indirect and azdo shadow rendering for skinned mesh 2016-12-09 22:37:17 +08:00
Benau
76e070b709 Allow GL3 to have hardware skinning 2016-12-09 18:41:13 +08:00
Benau
b7e047b4c1 Avoid using else if in skinning vertex shader 2016-12-09 14:16:30 +08:00
Benau
57d9e83ed4 First version of hardware skinning
Todo: shadow, non-instanced shaders, culling, changeable offset...
2016-12-07 02:15:11 +08:00
Benau
ed43d16a1c Allow alpha test shader to be colorizable 2016-12-04 13:21:39 +08:00
Benau
7d5f786da8 Make grass shader colorizable 2016-12-04 00:59:09 +08:00
Benau
4261a96d06 Fix inconsistency between grass shader and the instanced version
1. Assign the missing depth stencil texture (dtex)

2. Correct the movement and color
2016-12-03 15:54:59 +08:00
Benau
acf0ac909f And a correct ifdef for bindless texture 2016-11-30 15:00:08 +08:00
Benau
9e8fb63dc4 Fix AZDO with colorization
Also re-arrange texture layer
2016-11-30 13:52:06 +08:00
Benau
5884d7b9d8 Avoid using matrix4 calculation 2016-11-28 15:44:14 +08:00
Benau
45c5b0ffd6 Improved colorization in instanced rendering 2016-11-28 13:08:27 +08:00
Benau
decf3b9715 4 bindless textures + texture translation + colorization in vao 2016-11-28 10:47:14 +08:00
Benau
60908c3e1d Try to use vec2 for texture translation only
In stk, only setTextureTranslate is used which modify 8,9 of
matrix array. Also don't update it when it is identity.
2016-11-28 10:41:27 +08:00
Benau
2f0252be98 Merge remote-tracking branch 'origin/master' into renderer_refactoring 2016-10-28 21:41:49 +08:00
deve
5502fa4ebe Declare custom alpha also when bindless sampler is enabled 2016-10-17 08:23:27 +02:00
Benau
af223ddf24 Try to use sun color to determine custom alpha for ghost karts
This may need more adjustments, also add custom_alpha uniform float
to transparent fragment shader to remove duplicated shader
2016-10-17 01:03:10 +08:00
Benau
23a1b08efe Allow normal map karts to be used in ghost race
Also split ghost karts out of additive shader, so fixed issues like
"drivers are facing backwards", "water in abyss affects ghost karts"

Todo: maybe transparency depend on current track color?
2016-10-16 15:40:40 +08:00
Deve
3a9b2b9872 Fixed advanced lighting on android 2016-09-12 21:43:31 +02:00