* render Q3 shader based skyboxes

logic: load 6 skybox textures when shader gets used by scene, don't unload dynamically, just on 'flush'
texture browser only uses normal preview image and doesn't trigger potentially heavy box loading
also fix R_ResampleTexture for [2+x upscaling
This commit is contained in:
Garux
2022-07-18 10:05:19 +03:00
parent 22377bb255
commit d3e48d8c31
11 changed files with 219 additions and 21 deletions

View File

@@ -82,6 +82,7 @@ public:
GLint m_texture5;
GLint m_texture6;
GLint m_texture7;
GLint m_textureSkyBox;
Vector4 m_colour;
GLenum m_blend_src, m_blend_dst;
GLenum m_depthfunc;

View File

@@ -98,6 +98,7 @@ public:
virtual void DecRef() = 0;
// get/set the qtexture_t* Radiant uses to represent this shader object
virtual qtexture_t* getTexture() const = 0;
virtual qtexture_t* getSkyBox() = 0;
virtual qtexture_t* getDiffuse() const = 0;
virtual qtexture_t* getBump() const = 0;
virtual qtexture_t* getSpecular() const = 0;

View File

@@ -32,8 +32,9 @@ class LoadImageCallback
public:
void* m_environment;
LoadFunc m_func;
bool m_skybox;
LoadImageCallback( void* environment, LoadFunc func ) : m_environment( environment ), m_func( func ){
LoadImageCallback( void* environment, LoadFunc func, bool skybox = false ) : m_environment( environment ), m_func( func ), m_skybox( skybox ){
}
Image* loadImage( const char* name ) const {
return m_func( m_environment, name );