Commit Graph

61 Commits

Author SHA1 Message Date
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
Almamu
d652691088 chore: cleanup typing issues and various other warnings here and there 2024-05-11 18:39:16 +02: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
b58cd97255 remove define code for shaders that was generating errors
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-12-12 02:00:43 +01: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
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
b69ce8ba57 Added support for running multiple X11 backgrounds off the same instance
Window mode now has extra settings for setting the position and size
Fixed audio not muting when --silent was used

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-03-21 07:07:36 +01:00
Alexis Maiquez
e2d80a074c Add messages for [COMBO] types
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-11 05:51:35 +01:00
Alexis Maiquez
5e384d968d Fixed multiple defines of the same thing
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-11 05:34:35 +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
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
cd40950ade Fixed some shaders not getting properly compiled (missing part of the content)
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-01 01:07:09 +01:00
Alexis Maiquez
62af627ffa Added some missing texture formats to the definition
Added some extra settings for debugging

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-01-29 21:15:26 +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
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
a13d2f265b Fixed regression for spritesheets not working properly
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-10-28 18:43:12 +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
8955ba791c Bumped up shader version to 150 (work on shaders not compiling for #115 and #117)
Improved jsonFindDefault to not crash when the value types do not match (should partially fix #116)

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-07-15 12:20:12 +02:00
Alexis Maiquez
09effd0303 CFBO frame dummy values added
Added combo properties support
Bumped up GLSL version to 130 and added some extra definitions

This work goes on to #115, although the background won't start up yet because of shader compilation issues

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-07-14 22:12:46 +02:00
Alexis Maiquez
e5ef7bd53e ~ updated shader compiler to look for the first function, not just main
should fix #106

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-06-10 14:04:22 +02:00
Alexis Maiquez
e51734e4f9 ~ better fix for #103
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-06-09 12:33:38 +02:00
Alexis Maiquez
cf2e31a606 ~ quick fix for shader compilation with nested includes, should fix #103
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-06-09 12:12:50 +02:00
Alexis Maiquez Murcia
7acac874fa ~ Includes should be after all variable declarations and before the main function, fixes #97 and #100
Signed-off-by: Alexis Maiquez Murcia <almamu@almamu.com>
2022-06-01 20:12:23 +02:00
Alexis Maiquez Murcia
fca645b25a ~ Fixed RG88 and R8 textures not loading properly
~ Fixed combo setting based on the textures supplied to the image
~ Fixed vec4 shader constants not using the default value
  Should fix #87

Signed-off-by: Alexis Maiquez Murcia <almamu@almamu.com>
2022-04-07 23:34:03 +02:00
Alexis Maiquez Murcia
8450413105 The "max" function has the parameters in the reverse order, fixes #86 not booting up
Signed-off-by: Alexis Maiquez Murcia <almamu@almamu.com>
2022-04-07 20:45:19 +02:00
Alexis Maiquez
d0572b257f ~ Combos can have no default value
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-12-02 22:00:43 +01:00
Alexis Maiquez
342522cd1d + Added handling for floating point precision qualifiers on type detection
+ Fixed textures not being detected properly on images that do not have any source

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-12-02 21:33:50 +01:00
Alexis Maiquez
9d2e9b43ee ~ Fixed an infinite loop in the shader compiler
+ Added more valid variable types to the shader compiler so compilation doesn't fail

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-11-29 13:36:15 +01:00
Alexis Maiquez
5828b2ee80 + added some extra documentation on rendering based on observations and trial and error
~ deprecated --dir --pkg options, the software will automatically detect the background we're loading
+ first draft of FBO support, there's still some extra work to do
~ texture header is now hidden behind getters so the textures can be any kind of source
~ proper setting of resolution and translation variables for textures
~ simplified call flow for any pass rendering, removing render functions on effect and material
~ framebuffer setup has to happen before object setup in the scene

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-27 01:39:23 +02:00
Alexis Maiquez
3736c0c1b9 - removed some irr:: types left on the code that I missed
~ quick and dirty hack to make combos propagate between shaders (this needs to be improved, left TODOs for that)

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-08 20:30:03 +02:00
Alexis Maiquez
2432ec9a36 ~ some cleanup of todos and dead code
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-05 22:02:58 +02:00
Alexis Maiquez
113d84173e ~ changed readTexture for containers to produce a CTexture file ready to be used (simplifies loading textures)
~ fixed a write to null error on CDirectory that wasn't taking into account that length can be null

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-05 14:29:11 +02:00
Alexis Maiquez Murcia
30b4eb4cd4 ~ fix type extraction on shaders not working properly
+ added uint4 and mat4x3 types

Signed-off-by: Alexis Maiquez Murcia <almamu@almamu.com>
2021-09-04 21:49:48 +02:00
Alexis Maiquez
65bfbe1493 + added some default values for TextureMipmap as they were not being set automatically by the compiler sometimes (and thus breaking the texture load)
+ added helper to parse vector4 data from json
- removed some old, commented out code
+ added support for getting textures from the shader's code too (fixes masks on some backgrounds)
+ added support for shader varibles with default values from shader's source code

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-04 15:02:11 +02:00
Alexis Maiquez
dd76439901 ~ fixed a_TexCoord variable not having the correct values
- removed irrlicht functions and types from the active codebase so it's no longer required at compile time (CContext still there as the code might be still be useful)

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-08-31 02:29:28 +02:00
Alexis Maiquez
291b7e364a - removed/commented out most irrlicht-specific code
~ written close to equivalent versions in OpenGL code using GLM and GLFW
~ written replacements for texture and package loading to not use irrlicht anymore
~ updated shader compiler as we now don't need to replace attributes anymore
+ added support for texture flags in the texture header (as they're needed for opengl to get proper information)

TODO: REWRITE VIDEO PLAYER SUPPORT AS THIS UPDATE EFFECTIVELY BREAKS IT

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-08-31 01:14:08 +02:00
Alexis Maiquez
537acb97bd ~ shader precompilation should be done in order to ensure that the vertex shader has information discovered by the fragment shader (like new combos) should fix some effects on backgrounds
+ added partial support for shader constant values from the scene.json

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-08-08 08:41:03 +02:00
Alexis Maiquez
8d0eb6d63c ~ combo value detection should now update combo list on shaders too instead of writting them directly
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-08-08 07:46:06 +02:00
Alexis Maiquez
b4a6dc9bcd ~ fragment shaders can set new combos on rare occasions, so updated shader compiler to reflect this possibility
~ also updated shader passes to ensure it takes this into account

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-08-08 07:41:12 +02:00
Alexis Maiquez
e89e80c2b8 ~ Fixed a mistake in the variable parsing for the shader pre-compiler, arrays are not always expected
Signed-off-by: Alexis Maiquez Murcia <almamu@almamu.com>
2020-10-29 12:00:51 +01:00
IceCryptonym
b37c519209 Nitpicks 2020-03-25 10:20:34 +10:00