Commit Graph

39 Commits

Author SHA1 Message Date
Alexis Maiquez
48a91ff297 More code cleanup
Input is now handled by context

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-08 14:57:17 +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
ecd8ff3757 Applied the same context-driver treatment to the audio subsystem (still needs some extra work to ensure all audio plays fine and a good cleanup)
Fixed README.md to properly reflect all dependencies in the command examples
Added support for audio looping

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-06 22:35:46 +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
7079d12e2a Switched video backgrounds to mpv (should fix all the videos that weren't playing sound or had random issues)
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-05 06:11:04 +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
176470dad9 Image color and alpha can now be user-settings
Removed old Color structures not useful anymore

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-02-01 02:08:05 +01:00
Alexis Maiquez
fc150576eb Object and effect visibility can now be compared to project's properties
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2023-01-30 13:34:02 +01:00
Alexis Maiquez
fa67fa5b00 Fixed bloom effect not being properly applied
Added support for userparameter on the clearcolor of the scene
Scenes should draw into the full framebuffer

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-05 10:50:55 +01:00
Alexis Maiquez
0843f69edf Fix some backgrounds appearing flipped upside down, bloom effect now renders directly into the _rt_FrameBuffer as the flip happens after the scene is drawn completely
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-04 11:28:10 +01:00
Alexis Maiquez
e24c19ff81 Added Missing braces that caused crashing on non-bloom backgrounds
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-03 23:34:21 +01:00
Alexis Maiquez
b5b7824233 Better approach on rendering the bloom effect, uses one less draw call
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-03 23:32:49 +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
625397ea0c Added a basic (and somewhat convincing) parallax effect for the camera
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-11-03 18:43:05 +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
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
4d5cdf57b2 First attempt at automatically detect orthographic projection's size
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-10-28 09:29:56 +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
5bc0525493 ~ reorganized context initialization so opengl is ready
~ moved pixmap, gc and image creation to the initialization
  TODO: SUPPORT SCREEN SIZE CHANGES (THIS MIGHT NEED REINITIALIZATION OF THINGS)
~ moved fbo creation to initialization as it won't change anymore
~ reverted render code to the original loop as now the framebuffer is exactly as big as the whole display
~ moved glReadPixels off the wallpaper as that's code is exclusively used for screen rendering and not general rendering
~ XChangeProperty forces the update of the background, otherwise the compositor stops refreshing the screen and the background gets stuck
~ updated viewport variables to be integers instead of floats
~ reverted frame rendering code to be simpler and added the option to specify a framebuffer as target instead of screen

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2022-02-28 02:03:47 +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
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
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
93456940e3 ~ fix videos not being rendered properly
~ fix some combos not having the correct casing for shaders

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-08 21:57:57 +02:00
Alexis Maiquez
0225cac917 ~ changed glfw to use a custom library version until upstream adds proper support for this
~ brought back proper background rendering and position detection

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-08 19:09:43 +02:00
Alexis Maiquez
2ffb5f1b24 + added an extra render pass to render the scene upside down (so it looks fine)
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-03 03:24:55 +02:00
Alexis Maiquez
16ed2f30de + added FreeImage for loading all the non-compiled textures (jpg, pngs, etc)
+ set proper glViewport instead of hardcoded 1920 by 1080 (this might require some changing and instead do a glViewport of the screen/window size and then scaling the backbuffers)
~ set proper texture size for pingpong buffers (to work with the viewport fixes)
- removed FREE_IMAGE_FORMAT as it's already included in the FreeImage library

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-09-02 23:59:00 +02:00
Alexis Maiquez
8bc19b20ae + added support for the isVisible flag on images
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2021-08-31 02:51:10 +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
IceCryptonym
5d5ce361fe
Initial video support without audio (#14)
* Adds FFmpeg to CMake
* Refactors to allow support for other wallpaper types
* Updates README.md for compilation requirements
* Initial video support without audio
* Properly support different wallpapers
* Fixes videos not rendering
* Nitpicks
* Moves code related to rendering from Core::CVideo to Render::CVideo
2020-04-27 18:50:17 +02:00
Alexis Maiquez
d03edb7c1e ~ cleaned up main function and moved initialization functions to a more proper place
~ check for SDL initialization before playing audio to prevent error messages when there is not really any error
~ changed a missed iterator to auto on CSound

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2019-09-10 12:55:45 +02:00
Alexis Maiquez
3587fdec1e ~ changed all iterators to auto
~ changed most pointers to const references to prevent modification, specially from the background parser

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2019-09-10 11:02:45 +02:00
Alexis Maiquez
3371e10b01 ~ fixed segmentation fault when creating a scene
+ added check for texture rendering on startup
~ fixed possibly wrong texture size for passes
~ changed camera position

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2019-09-09 16:06:28 +02:00
Alexis Maiquez
f7be32eed3 ~ moved OnRegisterSceneNode to CObject as this function should barely change
+ support for sounds added

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2019-09-09 10:13:06 +02:00
Alexis Maiquez
fc8778ab64 ~ More changes to the new parser to properly load object passes from JSON (combos, elements missing, shader, etc)
+ Added camera for new renderization code
+ Added scene for new renderization code
+ Added object for new renderization code
+ Added image for new renderization code
  WARNING: THIS IS A REGRESSION AS IN SHADERS ARE NOT AS COMPLETE AS IN THE MASTER BRANCH
~ New renderization code in place

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
2019-09-06 15:54:41 +02:00