Simplified texture decision graph and preload it so render is quicker
Improved material detecion on shaders
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
Further improvements on detection of combo values for shaders
Support for detecting visibility settings on effects
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
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>
~ 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>
+ 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>
~ 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>
~ 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>
~ 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>
~ 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>
+ added support for texture format definition (TEX0FORMAT) although it might need some more investigation (specially for multi-pass shaders)
+ added implicit conversion from vec3 to vec2 in shaders
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
~ updated some strings to ensure the type-checking matches
+ added support for integer <-> float casting on constants
+ added support for vec2 variables
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
+ 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>
~ changed how g_Time is calculated so any shader that uses it should behave properly
~ changed how the uniforms are set to a reinterpret_cast instead of static_cast to perform a direct pointer conversion (safe as we know the types were actually those types)
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
+ added texture resolution to CTexture so it can be properly used in the CPass
+ framebuffer textures now have filtering specified (prevents black screen), still need to adjust information about the texture
+ added proper uniform variable registration to ease the usage
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
- 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>
~ 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>
+ properly set g_TextureXResolution for shaders
+ properly set g_TextureX for shaders
+ properly set g_TextureXRotation for shaders
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
~ removed reduntant code from CImage and made use of the new versions of the same code on CEffect, CMaterial and CPass to simplify the rendering code and make it easier to read
TODO: FIX MATRIX THAT VERTICALLY FLIPS THE IMAGES!
~ properly linked output from CMaterial, CEffect and CPass so a full render pass outputs something to the screen
Signed-off-by: Alexis Maiquez <almamu@almamu.com>
+ added parsing of bind section for shader passes
~ various new classes to properly handle texture targets, shader passes and materials
Signed-off-by: Alexis Maiquez <almamu@almamu.com>