Commit Graph

74 Commits

Author SHA1 Message Date
Almamu
ae66deffb6 chore: some readability improvements on code 2025-04-11 01:40:13 +02:00
Almamu
7bff63c037 chore: changed shader compilation slightly so they're passed onto glsl just once 2025-04-06 20:13:45 +02:00
Almamu
740c290a82 chore: make use of external repos for all deps instead of copying things manually and more cleanup work 2025-04-06 08:40:00 +02:00
Almamu
85eecc3ea1 feat: added glslang and spirv-core for handling shaders, should provide better results than current systems 2025-03-31 01:24:25 +02:00
moetayuko
5a45c9a26b
Workaround errors when loading wallpapers made recently (#244)
* Add sampler2DComparison and uint to known types

* Ignore unsupported `#require` preprocessor directive

`#require LightingV1` is found in generic4.frag, genericimage4.frag, ...

* Mark _alias_* textures as FBOs

Currently not supported, but prevents loading from the file, thereby
avoiding CAssetLoadException
2024-09-03 00:23:56 +02:00
Alexis Maiquez
bd5e452d34 fix: support shaders without textures (like flat), improves #184
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-12-14 03:10:52 +01:00
Alexis Maiquez
170af5ff7c fix: black backgrounds on latest wallpaperengine version (g_Color4 was added)
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-12-14 02:59:00 +01:00
Alexis Maiquez
b8fd1eefac chore: clang-format and code formatting done with an extra of code cleanup
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-12-14 02:20:34 +01:00
Alexis Maiquez
181dd1eef8 Fix for #161, texture priorities were not being properly taken into account
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-05-07 18:54:01 +02:00
Alexis Maiquez
a713ad001a Fixes #160, xray effects on full image layers weren't working properly. Should fix anything using the inverse matrix of modelViewProjection
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-04-20 23:40:16 +02:00
Alexis Maiquez
73ef4d6dbf Added support for g_Daytime in shaders
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-04-20 22:48:08 +02:00
Alexis Maiquez
96b931d931 Added g_ModelMatrix, g_NormalModelMatrix, g_ViewProjectionMatrix, g_LightAmbientColor and g_LightSkylightColor to shaders
Added support for specifying array variables for shaders

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-04-20 21:54:45 +02:00
Alexis Maiquez
a89d8ebb22 Added basic support for audio processing so backgrounds can react to sound playing in the system
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-03-26 18:18:21 +02:00
Alexis Maiquez
cc7ec0561d Separated X11 fullscreen code detection from the output driver as they don't have to work at the same time
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-03-23 23:38:23 +01:00
Alexis Maiquez
f499454957 Fixed identation problems
Added comments all over the codebase to explain things a bit better
Improved CApplicationContext to be a bit more self-explanatory
Abstracted CRenderContext access away into a helper that every render class should use

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-03-23 01:42:01 +01:00
Alexis Maiquez
37631e9c40 Upgraded to shader version 330
Added support for shader patches
Removed useless DEBUG define in favour of NDEBUG

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-11 03:21:45 +01:00
Alexis Maiquez
3d8452ee9a Revert "Properly clamp volume value"
This partially reverts commit 95713ae439.

# Conflicts:
#	src/WallpaperEngine/Application/CApplicationContext.cpp

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-08 23:59:39 +01:00
Alexis Maiquez
732c60da46 More code cleanups
Update .clang-format

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-08 18:48:19 +01:00
Alexis Maiquez
d2e82e72d8 Small code cleanups
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-08 14:27:41 +01:00
Alexis Maiquez
95713ae439 Properly clamp volume value
Removed all usages of std::make_pair

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-07 04:35:47 +01:00
Alexis Maiquez
55760aee4d More code cleanup:
- Separated program args parsing and validation from initialization code
 - Application's main body in it's own class

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-07 04:17:51 +01:00
Alexis Maiquez
e888bb452d Fix bloom effect FBO's not using GL_LINEAR, no more blocky bloom
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-05 06:45:14 +01:00
Alexis Maiquez
30bb8d6d72 Small cleanup of pass initialization code
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-05 06:36:07 +01:00
Alexis Maiquez
a24b1923f6 Cleanup of code:
- use of auto in some places (more of this to come)
 - use for loops instead of iterators for most of the loops
 - extracted glfw/glew code into it's own class
 - make usage of std::filesystem instead of checking things with old C libraries

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-03 18:41:51 +01:00
Alexis Maiquez
d370e028ff Renamed CContext to CRenderContext to allow for the introduction of CAudioContext in following iterations
Improved logging and error reporting to be a bit more flexible

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-03 00:00:17 +01:00
Alexis Maiquez
4dc3a4bc01 Added g_PointerPositionLast
Improved delay calculation for parallax (should prevent backgrounds from flickering with big delays)
Fixed g_TexelSize having the wrong value and g_TexelSizeHalf not being defined

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-01 18:40:38 +01:00
Alexis Maiquez
ed1efdcd66 Added parsing for text properties
Simplified how passes rendering works and separated it into a two stages process
  Setup (prepares shaders, uniforms, attributes, etc)
  Render (only performs the actual rendering)

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-04 10:16:15 +01:00
Alexis Maiquez
cdaebbe893 Added support for camera bloom
Added support for virtual files

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-03 23:07:13 +01:00
Alexis Maiquez
c13d743022 Container access should happen through CContext
Textures now have a cache system that prevents loading them more than once

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-03 14:27:05 +01:00
Alexis Maiquez
5521e90155 Ignore composelayers for now
Added support for color blend mode
Main pass' blendmode should be normal
Last pass' blendmode should be the first's
Fixed order of glClear's so _rt_FullFrameBuffer is the right color at the right time
Simplified effect and pass creation code a bit more
Non-visible images should render the full chain into the pingpong framebuffers instead of to screen
Fixed an integer division not producing float numbers

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-03 13:14:52 +01:00
Alexis Maiquez
261bc696df Added some object labels in opengl so they're reflected on RenderDoc while on debug
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-02 09:28:42 +01:00
Alexis Maiquez
7e6cb9a458 Simplified image rendering code further
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-01 04:00:34 +01:00
Alexis Maiquez
cb6f05ff27 Simplified image rendering code a bit so it's easier to follow
Improved detection of macros for shaders

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-10-31 12:09:14 +01:00
Alexis Maiquez
c9f8624b8b Reduced amount of glClears used in the rendering process
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-10-29 14:02:10 +02:00
Alexis Maiquez
7b7d699371 Implemented proper dependency detection for images
Simplified texture decision graph and preload it so render is quicker
Improved material detecion on shaders

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-10-28 18:21:29 +02:00
Alexis Maiquez
9ff33ef61f Support for specifying FBOs texture flags
Further improvements on detection of combo values for shaders
Support for detecting visibility settings on effects

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-10-28 15:45:35 +02:00
Alexis Maiquez
4e3254e843 Improved detection of "previous" textures (fixes 2370927443)
Added support for PKGV0018
Try to prevent crashing when shaders do not compile and go with whatever can be displayed

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-10-26 09:09:13 +02:00
Alexis Maiquez Murcia
693f3c5d0e Added different PKGV versions to the list of supported packages, should fix #85
Added some extra logging to the shader compilation to have an easier debugging experience

Signed-off-by: Alexis Maiquez Murcia <almamu@almamu.com>
2022-04-04 20:59:04 +02:00
Alexis Maiquez
cad78c58f9 + Support animated images in the background
~ ITextures can now also return sub-textures width and height
+ added proper code to handle animated images to properly play at normal speed

  this should actually fix #79 for good

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-03-06 01:28:31 +01:00
Alexis Maiquez
64d2f77d41 + added support for reading multiple images from a texture
first steps to fix #79

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-02-28 23:48:43 +01:00
Alexis Maiquez
131801b7f0 ~ quick and dirty fix for composite color not being the right value (need to verify that this is actually what should happen)
fixes @C0nvert's #59 issue

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-02-23 09:50:55 +01:00
Alexis Maiquez
e08a252f03 + Added brightness reading for image objects
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-12-04 23:15:56 +01:00
Alexis Maiquez
afe7452340 + added support for alpha and color loading for images
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-12-04 21:57:21 +01:00
Alexis Maiquez
49a5f9e2ab + added proper framebuffer clearing for passes
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-12-04 02:50:11 +01:00
Alexis Maiquez
b55f2e8bf4 + Added PKGV0015 support
+ Added basic support for mouse position on shaders (still needs to be adjusted for backgrounds that are too big for the screen)
  (this makes XRAY effects work)

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-12-03 02:02:46 +01:00
Alexis Maiquez
13bcd52e8c ~ Fixed regression in composite layer handling
~ Properly fixed usage of "previous" as texture

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-11-30 23:49:08 +01:00
Alexis Maiquez
96fb8a6700 + Added some more default values for shaders so genericimage2 displays properly
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-11-29 14:37:09 +01:00
Alexis Maiquez
13ef4a96c2 ~ changed orthographic camera to use the center as 0, might get reverted,
~ shader passes now won't try to detect projection, texcoord or position, as this'll be specified as parameters
~ removed useless variables being stored
~ model view projection matrix is now stored by image, not by pass
~ proper calculation of centered images

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-10-01 04:06:27 +02:00
Alexis Maiquez
f86eba347c ~ changed priority of assets loading, so background's assets should be loaded before looking into the assets folder
~ hopefully fixed effects that use shader targets so they now display properly

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-29 01:21:35 +02:00
Alexis Maiquez
f5e943b0fc + added ansiotropic filtering
~ material's binds are now a map by index so it's easier to use
- removed depth buffer for FBOs as they're not really useful (at least for now)
~ separated image setup in two stages so FBO creation happens before actually requiring them
- removed ping-pong FBOs where they didn't make sense
~ image's should now render to scene buffer directly whenever possible
~ better support for FBO scaling
~ rendering should now take into account targets and binds in a much better way

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-28 21:41:24 +02:00