Move all gfx related config to a separate file
This commit is contained in:
parent
2d0c929a70
commit
f644543bc1
@ -24,6 +24,7 @@
|
||||
#include "config/hardware_stats.hpp"
|
||||
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "online/http_request.hpp"
|
||||
@ -303,7 +304,7 @@ void reportHardwareStats()
|
||||
|
||||
json.add("os_version", getOSVersion());
|
||||
|
||||
unsigned int ogl_version = irr_driver->getGLSLVersion();
|
||||
unsigned int ogl_version = CVS->getGLSLVersion();
|
||||
unsigned int major = ogl_version/100;
|
||||
unsigned int minor = ogl_version - 100*major;
|
||||
std::string version =
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "2dutils.hpp"
|
||||
#include "central_settings.hpp"
|
||||
#include "glwrap.hpp"
|
||||
#include "utils/cpp2011.hpp"
|
||||
|
||||
@ -104,7 +105,7 @@ void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect
|
||||
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect,
|
||||
const video::SColor &colors, bool useAlphaChannelOfTexture)
|
||||
{
|
||||
if (!irr_driver->isGLSL()) {
|
||||
if (!CVS->isGLSL()) {
|
||||
video::SColor duplicatedArray[4] = {
|
||||
colors, colors, colors, colors
|
||||
};
|
||||
@ -195,7 +196,7 @@ void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect
|
||||
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect,
|
||||
const video::SColor* const colors, bool useAlphaChannelOfTexture)
|
||||
{
|
||||
if (!irr_driver->isGLSL())
|
||||
if (!CVS->isGLSL())
|
||||
{
|
||||
irr_driver->getVideoDriver()->draw2DImage(texture, destRect, sourceRect, clipRect, colors, useAlphaChannelOfTexture);
|
||||
return;
|
||||
@ -246,7 +247,7 @@ void draw2DVertexPrimitiveList(video::ITexture *tex, const void* vertices,
|
||||
u32 vertexCount, const void* indexList, u32 primitiveCount,
|
||||
video::E_VERTEX_TYPE vType, scene::E_PRIMITIVE_TYPE pType, video::E_INDEX_TYPE iType)
|
||||
{
|
||||
if (!irr_driver->isGLSL())
|
||||
if (!CVS->isGLSL())
|
||||
{
|
||||
irr_driver->getVideoDriver()->draw2DVertexPrimitiveList(vertices, vertexCount, indexList, primitiveCount, vType, pType, iType);
|
||||
return;
|
||||
@ -281,7 +282,7 @@ void GL32_draw2DRectangle(video::SColor color, const core::rect<s32>& position,
|
||||
const core::rect<s32>* clip)
|
||||
{
|
||||
|
||||
if (!irr_driver->isGLSL())
|
||||
if (!CVS->isGLSL())
|
||||
{
|
||||
irr_driver->getVideoDriver()->draw2DRectangle(color, position, clip);
|
||||
return;
|
||||
|
312
src/graphics/central_settings.cpp
Normal file
312
src/graphics/central_settings.cpp
Normal file
@ -0,0 +1,312 @@
|
||||
#include "central_settings.hpp"
|
||||
#include "modes/profile_world.hpp"
|
||||
#include "gl_headers.hpp"
|
||||
#include "glwrap.hpp"
|
||||
#include "graphics_restrictions.hpp"
|
||||
|
||||
CentralVideoSettings *CVS = new CentralVideoSettings();
|
||||
|
||||
void CentralVideoSettings::init()
|
||||
{
|
||||
m_gl_major_version = 2;
|
||||
m_gl_minor_version = 1;
|
||||
|
||||
// Parse extensions
|
||||
hasVSLayer = false;
|
||||
hasBaseInstance = false;
|
||||
hasBuffserStorage = false;
|
||||
hasDrawIndirect = false;
|
||||
hasComputeShaders = false;
|
||||
hasTextureStorage = false;
|
||||
hasTextureView = false;
|
||||
hasBindlessTexture = false;
|
||||
hasAtomics = false;
|
||||
hasSSBO = false;
|
||||
hasImageLoadStore = false;
|
||||
hasMultiDrawIndirect = false;
|
||||
hasTextureCompression = false;
|
||||
hasUBO = false;
|
||||
hasGS = false;
|
||||
|
||||
m_need_rh_workaround = false;
|
||||
m_need_srgb_workaround = false;
|
||||
|
||||
// Call to glGetIntegerv should not be made if --no-graphics is used
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
{
|
||||
|
||||
}
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
{
|
||||
glGetIntegerv(GL_MAJOR_VERSION, &m_gl_major_version);
|
||||
glGetIntegerv(GL_MINOR_VERSION, &m_gl_minor_version);
|
||||
Log::info("IrrDriver", "OpenGL version: %d.%d", m_gl_major_version, m_gl_minor_version);
|
||||
Log::info("IrrDriver", "OpenGL vendor: %s", glGetString(GL_VENDOR));
|
||||
Log::info("IrrDriver", "OpenGL renderer: %s", glGetString(GL_RENDERER));
|
||||
Log::info("IrrDriver", "OpenGL version string: %s", glGetString(GL_VERSION));
|
||||
}
|
||||
m_glsl = (m_gl_major_version > 3 || (m_gl_major_version == 3 && m_gl_minor_version >= 1));
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
initGL();
|
||||
|
||||
#if !defined(__APPLE__)
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
{
|
||||
std::string driver((char*)(glGetString(GL_VERSION)));
|
||||
std::string card((char*)(glGetString(GL_RENDERER)));
|
||||
std::vector<std::string> restrictions =
|
||||
GraphicsRestrictions::getRestrictions(driver, card);
|
||||
|
||||
if (hasGLExtension("GL_AMD_vertex_shader_layer")) {
|
||||
hasVSLayer = true;
|
||||
Log::info("GLDriver", "AMD Vertex Shader Layer Present");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_buffer_storage")) {
|
||||
hasBuffserStorage = true;
|
||||
Log::info("GLDriver", "ARB Buffer Storage Present");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_base_instance")) {
|
||||
hasBaseInstance = true;
|
||||
Log::info("GLDriver", "ARB Base Instance Present");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_draw_indirect")) {
|
||||
hasDrawIndirect = true;
|
||||
Log::info("GLDriver", "ARB Draw Indirect Present");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_compute_shader")) {
|
||||
hasComputeShaders = true;
|
||||
Log::info("GLDriver", "ARB Compute Shader Present");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_texture_storage")) {
|
||||
hasTextureStorage = true;
|
||||
Log::info("GLDriver", "ARB Texture Storage Present");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_texture_view")) {
|
||||
hasTextureView = true;
|
||||
Log::info("GLDriver", "ARB Texture View Present");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_bindless_texture")) {
|
||||
hasBindlessTexture = true;
|
||||
Log::info("GLDriver", "ARB Bindless Texture Present");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_shader_image_load_store")) {
|
||||
hasImageLoadStore = true;
|
||||
Log::info("GLDriver", "ARB Image Load Store Present");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_shader_atomic_counters")) {
|
||||
hasAtomics = true;
|
||||
Log::info("GLDriver", "ARB Shader Atomic Counters Present");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_shader_storage_buffer_object")) {
|
||||
hasSSBO = true;
|
||||
Log::info("GLDriver", "ARB Shader Storage Buffer Object Present");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_multi_draw_indirect")) {
|
||||
hasMultiDrawIndirect = true;
|
||||
Log::info("GLDriver", "ARB Multi Draw Indirect Present");
|
||||
}
|
||||
if (hasGLExtension("GL_EXT_texture_compression_s3tc")) {
|
||||
hasTextureCompression = true;
|
||||
Log::info("GLDriver", "EXT Texture Compression S3TC Present");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_uniform_buffer_object")) {
|
||||
hasUBO = true;
|
||||
Log::info("GLDriver", "ARB Uniform Buffer Object Present");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_geometry_shader4")) {
|
||||
hasGS = true;
|
||||
Log::info("GLDriver", "ARB Geometry Shader 4 Present");
|
||||
}
|
||||
|
||||
|
||||
// Specific disablement
|
||||
// (should use graphic restriction system)
|
||||
if (strstr((const char *)glGetString(GL_VENDOR), "Intel") != NULL)
|
||||
{
|
||||
// Intel doesnt support sRGB compressed textures on some chip/OS
|
||||
// TODO: Have a more precise list
|
||||
// Sandy Bridge on Windows
|
||||
hasTextureCompression = false;
|
||||
#ifdef WIN32
|
||||
// Fix for Intel Sandy Bridge on Windows which supports GL up to 3.1 only
|
||||
// Works with Haswell and latest drivers
|
||||
// Status unknown on Ivy Bridge
|
||||
// Status unknown on older driver for Haswell
|
||||
if (m_gl_major_version == 3 && m_gl_minor_version == 1)
|
||||
hasUBO = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (strstr((const char *)glGetString(GL_VENDOR), "NVIDIA") != NULL)
|
||||
{
|
||||
// Fix for Nvidia and instanced RH
|
||||
// Compiler crashes with a big loop in RH or GI shaders
|
||||
m_need_rh_workaround = true;
|
||||
// Atomic counters make the driver crash on windows and linux
|
||||
hasAtomics = false;
|
||||
}
|
||||
|
||||
if (strstr((const char *)glGetString(GL_VENDOR), "ATI") != NULL)
|
||||
{
|
||||
// Bindless textures are all treated RGB even sRGB one
|
||||
m_need_srgb_workaround = true;
|
||||
}
|
||||
|
||||
// Mesa
|
||||
if (strstr((const char *)glGetString(GL_VENDOR), "Intel Open Source Technology Center") != NULL ||
|
||||
strstr((const char *)glGetString(GL_VENDOR), "Gallium") != NULL)
|
||||
{
|
||||
// Needs a patched Mesa (current 10.4) to use array texture fbo
|
||||
// Technically GS works but array texture fbo interacts with GS.
|
||||
hasGS = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
unsigned CentralVideoSettings::getGLSLVersion() const
|
||||
{
|
||||
if (m_gl_major_version > 3 || (m_gl_major_version == 3 && m_gl_minor_version == 3))
|
||||
return m_gl_major_version * 100 + m_gl_minor_version * 10;
|
||||
else if (m_gl_major_version == 3)
|
||||
return 100 + (m_gl_minor_version + 3) * 10;
|
||||
else
|
||||
return 120;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isGLSL() const
|
||||
{
|
||||
return m_glsl;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::needRHWorkaround() const
|
||||
{
|
||||
return m_need_rh_workaround;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::needsRGBBindlessWorkaround() const
|
||||
{
|
||||
return m_need_srgb_workaround;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBGeometryShader4Usable() const
|
||||
{
|
||||
return hasGS;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBUniformBufferObjectUsable() const
|
||||
{
|
||||
return hasUBO;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isEXTTextureCompressionS3TCUsable() const
|
||||
{
|
||||
return hasTextureCompression;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBBaseInstanceUsable() const
|
||||
{
|
||||
return hasBaseInstance;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBDrawIndirectUsable() const
|
||||
{
|
||||
return hasDrawIndirect;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isAMDVertexShaderLayerUsable() const
|
||||
{
|
||||
return hasVSLayer;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBBufferStorageUsable() const
|
||||
{
|
||||
return hasBuffserStorage;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBComputeShaderUsable() const
|
||||
{
|
||||
return hasComputeShaders;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBTextureStorageUsable() const
|
||||
{
|
||||
return hasTextureStorage;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBTextureViewUsable() const
|
||||
{
|
||||
return hasTextureView;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBBindlessTextureUsable() const
|
||||
{
|
||||
return hasBindlessTexture;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBShaderAtomicCountersUsable() const
|
||||
{
|
||||
return hasAtomics;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBShaderStorageBufferObjectUsable() const
|
||||
{
|
||||
return hasSSBO;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBImageLoadStoreUsable() const
|
||||
{
|
||||
return hasComputeShaders;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBMultiDrawIndirectUsable() const
|
||||
{
|
||||
return hasMultiDrawIndirect;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::supportsShadows() const
|
||||
{
|
||||
return isARBGeometryShader4Usable() && isARBUniformBufferObjectUsable();
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::supportsGlobalIllumination() const
|
||||
{
|
||||
return isARBGeometryShader4Usable() && isARBUniformBufferObjectUsable();
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::supportsIndirectInstancingRendering() const
|
||||
{
|
||||
return isARBBaseInstanceUsable() && isARBDrawIndirectUsable();
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::supportsComputeShadersFiltering() const
|
||||
{
|
||||
return isARBBufferStorageUsable() && isARBImageLoadStoreUsable();
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isShadowEnabled() const
|
||||
{
|
||||
return supportsShadows() && UserConfigParams::m_shadows;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isGlobalIlluminationEnabled() const
|
||||
{
|
||||
return supportsGlobalIllumination() && UserConfigParams::m_gi;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isTextureCompressionEnabled() const
|
||||
{
|
||||
return isEXTTextureCompressionS3TCUsable() && UserConfigParams::m_texture_compression;
|
||||
}
|
||||
|
||||
// See http://visual-computing.intel-research.net/art/publications/sdsm/
|
||||
bool CentralVideoSettings::isSDSMEnabled() const
|
||||
{
|
||||
return isShadowEnabled() && isARBShaderAtomicCountersUsable() && isARBShaderStorageBufferObjectUsable() && isARBComputeShaderUsable() && isARBImageLoadStoreUsable() && UserConfigParams::m_sdsm;
|
||||
}
|
||||
|
||||
// See http://fr.slideshare.net/CassEveritt/approaching-zero-driver-overhead
|
||||
bool CentralVideoSettings::isAZDOEnabled() const
|
||||
{
|
||||
return supportsIndirectInstancingRendering() && isARBBindlessTextureUsable() && isARBMultiDrawIndirectUsable() && UserConfigParams::m_azdo;
|
||||
}
|
72
src/graphics/central_settings.hpp
Normal file
72
src/graphics/central_settings.hpp
Normal file
@ -0,0 +1,72 @@
|
||||
#ifndef CENTRAL_SETTINGS_HPP
|
||||
#define CENTRAL_SETTINGS_HPP
|
||||
|
||||
class CentralVideoSettings
|
||||
{
|
||||
private:
|
||||
/** Supports GLSL */
|
||||
bool m_glsl;
|
||||
|
||||
int m_gl_major_version, m_gl_minor_version;
|
||||
bool hasVSLayer;
|
||||
bool hasBaseInstance;
|
||||
bool hasDrawIndirect;
|
||||
bool hasBuffserStorage;
|
||||
bool hasComputeShaders;
|
||||
bool hasTextureStorage;
|
||||
bool hasTextureView;
|
||||
bool hasBindlessTexture;
|
||||
bool hasUBO;
|
||||
bool hasGS;
|
||||
bool hasTextureCompression;
|
||||
bool hasAtomics;
|
||||
bool hasSSBO;
|
||||
bool hasImageLoadStore;
|
||||
bool hasMultiDrawIndirect;
|
||||
|
||||
bool m_need_rh_workaround;
|
||||
bool m_need_srgb_workaround;
|
||||
public:
|
||||
void init();
|
||||
bool isGLSL() const;
|
||||
unsigned getGLSLVersion() const;
|
||||
|
||||
// Needs special handle ?
|
||||
bool needRHWorkaround() const;
|
||||
bool needsRGBBindlessWorkaround() const;
|
||||
|
||||
// Extension is available and safe to use
|
||||
bool isARBUniformBufferObjectUsable() const;
|
||||
bool isEXTTextureCompressionS3TCUsable() const;
|
||||
bool isARBTextureViewUsable() const;
|
||||
bool isARBGeometryShader4Usable() const;
|
||||
bool isARBTextureStorageUsable() const;
|
||||
bool isAMDVertexShaderLayerUsable() const;
|
||||
bool isARBComputeShaderUsable() const;
|
||||
bool isARBBindlessTextureUsable() const;
|
||||
bool isARBBufferStorageUsable() const;
|
||||
bool isARBBaseInstanceUsable() const;
|
||||
bool isARBDrawIndirectUsable() const;
|
||||
bool isARBShaderAtomicCountersUsable() const;
|
||||
bool isARBShaderStorageBufferObjectUsable() const;
|
||||
bool isARBImageLoadStoreUsable() const;
|
||||
bool isARBMultiDrawIndirectUsable() const;
|
||||
|
||||
|
||||
// Are all required extensions available for feature support
|
||||
bool supportsShadows() const;
|
||||
bool supportsGlobalIllumination() const;
|
||||
bool supportsIndirectInstancingRendering() const;
|
||||
bool supportsComputeShadersFiltering() const;
|
||||
|
||||
// "Macro" around feature support and user config
|
||||
bool isShadowEnabled() const;
|
||||
bool isGlobalIlluminationEnabled() const;
|
||||
bool isTextureCompressionEnabled() const;
|
||||
bool isSDSMEnabled() const;
|
||||
bool isAZDOEnabled() const;
|
||||
};
|
||||
|
||||
extern CentralVideoSettings* CVS;
|
||||
|
||||
#endif
|
@ -1,3 +1,4 @@
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
|
||||
#include "config/user_config.hpp"
|
||||
@ -265,7 +266,7 @@ void FrameBuffer::BlitToDefault(size_t x0, size_t y0, size_t x1, size_t y1)
|
||||
void draw3DLine(const core::vector3df& start,
|
||||
const core::vector3df& end, irr::video::SColor color)
|
||||
{
|
||||
if (!irr_driver->isGLSL()) {
|
||||
if (!CVS->isGLSL()) {
|
||||
irr_driver->getVideoDriver()->draw3DLine(start, end, color);
|
||||
return;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/callbacks.hpp"
|
||||
#include "graphics/camera.hpp"
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
#include "graphics/2dutils.hpp"
|
||||
#include "graphics/graphics_restrictions.hpp"
|
||||
@ -157,7 +158,7 @@ IrrDriver::~IrrDriver()
|
||||
*/
|
||||
void IrrDriver::reset()
|
||||
{
|
||||
if (m_glsl) m_post_processing->reset();
|
||||
if (CVS->isGLSL()) m_post_processing->reset();
|
||||
} // reset
|
||||
|
||||
void IrrDriver::setPhase(STKRenderingPass p)
|
||||
@ -473,123 +474,8 @@ void IrrDriver::initDevice()
|
||||
m_scene_manager = m_device->getSceneManager();
|
||||
m_gui_env = m_device->getGUIEnvironment();
|
||||
m_video_driver = m_device->getVideoDriver();
|
||||
|
||||
m_gl_major_version = 2;
|
||||
m_gl_minor_version = 1;
|
||||
// Call to glGetIntegerv should not be made if --no-graphics is used
|
||||
if(!ProfileWorld::isNoGraphics())
|
||||
{
|
||||
|
||||
}
|
||||
if(!ProfileWorld::isNoGraphics())
|
||||
{
|
||||
glGetIntegerv(GL_MAJOR_VERSION, &m_gl_major_version);
|
||||
glGetIntegerv(GL_MINOR_VERSION, &m_gl_minor_version);
|
||||
Log::info("IrrDriver", "OpenGL version: %d.%d", m_gl_major_version, m_gl_minor_version);
|
||||
Log::info("IrrDriver", "OpenGL vendor: %s", glGetString(GL_VENDOR));
|
||||
Log::info("IrrDriver", "OpenGL renderer: %s", glGetString(GL_RENDERER));
|
||||
Log::info("IrrDriver", "OpenGL version string: %s", glGetString(GL_VERSION));
|
||||
|
||||
m_need_ubo_workaround = false;
|
||||
m_need_rh_workaround = false;
|
||||
m_need_srgb_workaround = false;
|
||||
m_support_sdsm = true;
|
||||
m_support_texture_compression = true;
|
||||
if (strstr((const char *)glGetString(GL_VENDOR), "Intel") != NULL)
|
||||
{
|
||||
// Intel on windows doesnt support srgb compressed textures properly
|
||||
m_support_texture_compression = false;
|
||||
#ifdef WIN32
|
||||
// Fix for Intel Sandy Bridge on Windows which supports GL up to 3.1 only
|
||||
if (m_gl_major_version == 3 && m_gl_minor_version == 1)
|
||||
m_need_ubo_workaround = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Fix for Nvidia and instanced RH
|
||||
if (strstr((const char *)glGetString(GL_VENDOR), "NVIDIA") != NULL)
|
||||
{
|
||||
m_need_rh_workaround = true;
|
||||
m_support_sdsm = false;
|
||||
}
|
||||
|
||||
// Fix for AMD and bindless sRGB textures
|
||||
if (strstr((const char *)glGetString(GL_VENDOR), "ATI") != NULL)
|
||||
m_need_srgb_workaround = true;
|
||||
}
|
||||
#ifdef WIN32
|
||||
m_glsl = (m_gl_major_version > 3 || (m_gl_major_version == 3 && m_gl_minor_version >= 1));
|
||||
#else
|
||||
m_glsl = (m_gl_major_version > 3 || (m_gl_major_version == 3 && m_gl_minor_version >= 1));
|
||||
#endif
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
initGL();
|
||||
m_sync = 0;
|
||||
|
||||
// Parse extensions
|
||||
hasVSLayer = false;
|
||||
hasBaseInstance = false;
|
||||
hasBuffserStorage = false;
|
||||
hasDrawIndirect = false;
|
||||
hasComputeShaders = false;
|
||||
hasTextureStorage = false;
|
||||
hasTextureView = false;
|
||||
hasBindlessTexture = false;
|
||||
// Default false value for hasVSLayer if --no-graphics argument is used
|
||||
#if !defined(__APPLE__)
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
{
|
||||
if (hasGLExtension("GL_AMD_vertex_shader_layer")) {
|
||||
hasVSLayer = true;
|
||||
Log::info("GLDriver", "AMD Vertex Shader Layer enabled");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_buffer_storage")) {
|
||||
hasBuffserStorage = true;
|
||||
Log::info("GLDriver", "ARB Buffer Storage enabled");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_base_instance")) {
|
||||
hasBaseInstance = true;
|
||||
Log::info("GLDriver", "ARB Base Instance enabled");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_draw_indirect")) {
|
||||
hasDrawIndirect = true;
|
||||
Log::info("GLDriver", "ARB Draw Indirect enabled");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_compute_shader")) {
|
||||
hasComputeShaders = true;
|
||||
Log::info("GLDriver", "ARB Compute Shader enabled");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_texture_storage")) {
|
||||
hasTextureStorage = true;
|
||||
Log::info("GLDriver", "ARB Texture Storage enabled");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_texture_view")) {
|
||||
hasTextureView = true;
|
||||
Log::info("GLDriver", "ARB Texture View enabled");
|
||||
}
|
||||
if (hasGLExtension("GL_ARB_bindless_texture")) {
|
||||
hasBindlessTexture = true;
|
||||
Log::info("GLDriver", "ARB Bindless Texture enabled");
|
||||
}
|
||||
m_support_sdsm = m_support_sdsm && hasComputeShaders && hasBuffserStorage;
|
||||
|
||||
std::string driver((char*)(glGetString(GL_VERSION)));
|
||||
std::string card((char*)(glGetString(GL_RENDERER)));
|
||||
std::vector<std::string> restrictions =
|
||||
GraphicsRestrictions::getRestrictions(driver, card);
|
||||
|
||||
for (const std::string &restriction : restrictions)
|
||||
{
|
||||
if (!restriction.compare("BufferStorage"))
|
||||
{
|
||||
hasBuffserStorage = false;
|
||||
Log::info("Graphics restrictions", "Buffer Storage disabled");
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
m_support_sdsm = false;
|
||||
#endif
|
||||
CVS->init();
|
||||
|
||||
|
||||
// This remaps the window, so it has to be done before the clear to avoid flicker
|
||||
@ -603,20 +489,20 @@ void IrrDriver::initDevice()
|
||||
file_manager->reInit();
|
||||
|
||||
|
||||
if (m_glsl)
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
Log::info("irr_driver", "GLSL supported.");
|
||||
}
|
||||
|
||||
if (!supportGeometryShader())
|
||||
/* if (!supportGeometryShader())
|
||||
{
|
||||
// these options require geometry shaders
|
||||
UserConfigParams::m_shadows = 0;
|
||||
UserConfigParams::m_gi = false;
|
||||
}
|
||||
}*/
|
||||
|
||||
// m_glsl might be reset in rtt if an error occurs.
|
||||
if(m_glsl)
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
m_shaders = new Shaders();
|
||||
|
||||
@ -1154,7 +1040,7 @@ scene::IMeshSceneNode *IrrDriver::addMesh(scene::IMesh *mesh,
|
||||
const std::string& debug_name,
|
||||
scene::ISceneNode *parent)
|
||||
{
|
||||
if (!isGLSL())
|
||||
if (!CVS->isGLSL())
|
||||
return m_scene_manager->addMeshSceneNode(mesh, parent);
|
||||
|
||||
if (!parent)
|
||||
@ -1186,7 +1072,7 @@ scene::ISceneNode *IrrDriver::addBillboard(const core::dimension2d< f32 > size,
|
||||
scene::ISceneNode* parent, bool alphaTesting)
|
||||
{
|
||||
scene::IBillboardSceneNode* node;
|
||||
if (isGLSL())
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
if (!parent)
|
||||
parent = m_scene_manager->getRootSceneNode();
|
||||
@ -1342,7 +1228,7 @@ void IrrDriver::removeTexture(video::ITexture *t)
|
||||
scene::IAnimatedMeshSceneNode *IrrDriver::addAnimatedMesh(scene::IAnimatedMesh *mesh,
|
||||
const std::string& debug_name, scene::ISceneNode* parent)
|
||||
{
|
||||
if (!isGLSL())
|
||||
if (!CVS->isGLSL())
|
||||
{
|
||||
return m_scene_manager->addAnimatedMeshSceneNode(mesh, parent, -1,
|
||||
core::vector3df(0, 0, 0),
|
||||
@ -1777,7 +1663,7 @@ void IrrDriver::setRTT(RTT* rtt)
|
||||
// ----------------------------------------------------------------------------
|
||||
void IrrDriver::onLoadWorld()
|
||||
{
|
||||
if (m_glsl)
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
const core::recti &viewport = Camera::getCamera(0)->getViewport();
|
||||
size_t width = viewport.LowerRightCorner.X - viewport.UpperLeftCorner.X, height = viewport.LowerRightCorner.Y - viewport.UpperLeftCorner.Y;
|
||||
@ -2172,7 +2058,7 @@ void IrrDriver::update(float dt)
|
||||
// video::SColor(0,0,0,255));
|
||||
//m_scene_manager->drawAll();
|
||||
|
||||
if (m_glsl)
|
||||
if (CVS->isGLSL())
|
||||
renderGLSL(dt);
|
||||
else
|
||||
renderFixed(dt);
|
||||
@ -2192,7 +2078,7 @@ void IrrDriver::update(float dt)
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_glsl)
|
||||
if (CVS->isGLSL())
|
||||
renderGLSL(dt);
|
||||
else
|
||||
renderFixed(dt);
|
||||
@ -2258,7 +2144,7 @@ bool IrrDriver::OnEvent(const irr::SEvent &event)
|
||||
|
||||
bool IrrDriver::supportsSplatting()
|
||||
{
|
||||
return m_glsl;
|
||||
return CVS->isGLSL();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -2401,7 +2287,7 @@ void IrrDriver::RTTProvider::setupRTTScene(PtrVector<scene::IMesh, REF>& mesh,
|
||||
m_camera = irr_driver->getSceneManager()->addCameraSceneNode();
|
||||
|
||||
m_camera->setPosition( core::vector3df(0.0, 20.0f, 70.0f) );
|
||||
if (irr_driver->isGLSL())
|
||||
if (CVS->isGLSL())
|
||||
m_camera->setUpVector( core::vector3df(0.0, 1.0, 0.0) );
|
||||
else
|
||||
m_camera->setUpVector( core::vector3df(0.0, 1.0, 0.0) );
|
||||
@ -2478,7 +2364,7 @@ video::ITexture* IrrDriver::RTTProvider::renderToTexture(float angle,
|
||||
|
||||
void IrrDriver::applyObjectPassShader(scene::ISceneNode * const node, bool rimlit)
|
||||
{
|
||||
if (!m_glsl)
|
||||
if (!CVS->isGLSL())
|
||||
return;
|
||||
|
||||
// Don't override sky
|
||||
@ -2546,7 +2432,7 @@ void IrrDriver::applyObjectPassShader(scene::ISceneNode * const node, bool rimli
|
||||
|
||||
void IrrDriver::applyObjectPassShader()
|
||||
{
|
||||
if (!m_glsl)
|
||||
if (!CVS->isGLSL())
|
||||
return;
|
||||
|
||||
applyObjectPassShader(m_scene_manager->getRootSceneNode());
|
||||
@ -2557,7 +2443,7 @@ void IrrDriver::applyObjectPassShader()
|
||||
scene::ISceneNode *IrrDriver::addLight(const core::vector3df &pos, float energy, float radius,
|
||||
float r, float g, float b, bool sun, scene::ISceneNode* parent)
|
||||
{
|
||||
if (m_glsl)
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
if (parent == NULL) parent = m_scene_manager->getRootSceneNode();
|
||||
LightNode *light = NULL;
|
||||
|
@ -183,20 +183,6 @@ enum TypeRTT
|
||||
class IrrDriver : public IEventReceiver, public NoCopy
|
||||
{
|
||||
private:
|
||||
int m_gl_major_version, m_gl_minor_version;
|
||||
bool hasVSLayer;
|
||||
bool hasBaseInstance;
|
||||
bool hasDrawIndirect;
|
||||
bool hasBuffserStorage;
|
||||
bool hasComputeShaders;
|
||||
bool hasTextureStorage;
|
||||
bool hasTextureView;
|
||||
bool hasBindlessTexture;
|
||||
bool m_support_sdsm;
|
||||
bool m_support_texture_compression;
|
||||
bool m_need_ubo_workaround;
|
||||
bool m_need_rh_workaround;
|
||||
bool m_need_srgb_workaround;
|
||||
GLsync m_sync;
|
||||
/** The irrlicht device. */
|
||||
IrrlichtDevice *m_device;
|
||||
@ -275,106 +261,6 @@ public:
|
||||
float power;
|
||||
};
|
||||
|
||||
unsigned getGLSLVersion() const
|
||||
{
|
||||
if (m_gl_major_version > 3 || (m_gl_major_version == 3 && m_gl_minor_version == 3))
|
||||
return m_gl_major_version * 100 + m_gl_minor_version * 10;
|
||||
else if (m_gl_major_version == 3)
|
||||
return 100 + (m_gl_minor_version + 3) * 10;
|
||||
else
|
||||
return 120;
|
||||
}
|
||||
|
||||
bool supportsSDSM() const
|
||||
{
|
||||
return m_support_sdsm && UserConfigParams::m_sdsm;
|
||||
}
|
||||
|
||||
bool supportTextureCompression() const
|
||||
{
|
||||
return m_support_texture_compression;
|
||||
}
|
||||
|
||||
bool supportGeometryShader() const
|
||||
{
|
||||
return getGLSLVersion() >= 330;
|
||||
}
|
||||
|
||||
bool usesShadows() const
|
||||
{
|
||||
return supportGeometryShader() && UserConfigParams::m_shadows && !needUBOWorkaround();
|
||||
}
|
||||
|
||||
bool usesGI() const
|
||||
{
|
||||
return supportGeometryShader() && UserConfigParams::m_gi && !needUBOWorkaround();
|
||||
}
|
||||
|
||||
bool usesTextureCompression() const
|
||||
{
|
||||
return UserConfigParams::m_texture_compression && m_support_texture_compression;
|
||||
}
|
||||
|
||||
bool useAZDO() const
|
||||
{
|
||||
return hasBindlessTexture && UserConfigParams::m_azdo;
|
||||
}
|
||||
|
||||
bool needUBOWorkaround() const
|
||||
{
|
||||
return m_need_ubo_workaround;
|
||||
}
|
||||
|
||||
bool needRHWorkaround() const
|
||||
{
|
||||
return m_need_rh_workaround;
|
||||
}
|
||||
|
||||
bool needsRGBBindlessWorkaround() const
|
||||
{
|
||||
return m_need_srgb_workaround;
|
||||
}
|
||||
|
||||
bool hasARB_base_instance() const
|
||||
{
|
||||
return hasBaseInstance;
|
||||
}
|
||||
|
||||
bool hasARB_draw_indirect() const
|
||||
{
|
||||
return hasDrawIndirect;
|
||||
}
|
||||
|
||||
bool hasVSLayerExtension() const
|
||||
{
|
||||
return hasVSLayer;
|
||||
}
|
||||
|
||||
bool hasBufferStorageExtension() const
|
||||
{
|
||||
return hasBuffserStorage;
|
||||
}
|
||||
|
||||
bool hasARBComputeShaders() const
|
||||
{
|
||||
return hasComputeShaders;
|
||||
}
|
||||
|
||||
bool hasARBTextureStorage() const
|
||||
{
|
||||
return hasTextureStorage;
|
||||
}
|
||||
|
||||
bool hasARBTextureView() const
|
||||
{
|
||||
return hasTextureView;
|
||||
}
|
||||
|
||||
bool hasARBBindlessTexture() const
|
||||
{
|
||||
return hasBindlessTexture;
|
||||
}
|
||||
|
||||
video::SColorf getAmbientLight() const;
|
||||
|
||||
struct GlowData {
|
||||
@ -390,9 +276,6 @@ private:
|
||||
/** Whether the mouse cursor is currently shown */
|
||||
bool m_pointer_shown;
|
||||
|
||||
/** Supports GLSL */
|
||||
bool m_glsl;
|
||||
|
||||
/** Internal method that applies the resolution in user settings. */
|
||||
void applyResolutionSettings();
|
||||
void createListOfVideoModes();
|
||||
@ -686,12 +569,6 @@ public:
|
||||
FrameBuffer& getFBO(TypeFBO which);
|
||||
GLuint getDepthStencilTexture();
|
||||
// ------------------------------------------------------------------------
|
||||
inline bool isGLSL() const { return m_glsl; }
|
||||
// ------------------------------------------------------------------------
|
||||
/** Called when the driver pretends to support it, but fails at some
|
||||
* operations. */
|
||||
void disableGLSL() { m_glsl = false; }
|
||||
// ------------------------------------------------------------------------
|
||||
void resetDebugModes()
|
||||
{
|
||||
m_wireframe = false;
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "config/stk_config.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "graphics/callbacks.hpp"
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/particle_kind_manager.hpp"
|
||||
@ -689,7 +690,7 @@ void Material::setMaterialProperties(video::SMaterial *m, scene::IMeshBuffer* m
|
||||
m_texname.c_str());
|
||||
}
|
||||
|
||||
if (irr_driver->isGLSL())
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
ITexture *tex;
|
||||
ITexture *glossytex;
|
||||
@ -952,7 +953,7 @@ void Material::setMaterialProperties(video::SMaterial *m, scene::IMeshBuffer* m
|
||||
void Material::adjustForFog(scene::ISceneNode* parent, video::SMaterial *m,
|
||||
bool use_fog) const
|
||||
{
|
||||
if (irr_driver->isGLSL())
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
// to disable fog in the new pipeline, we slightly abuse the steps :
|
||||
// moving an object into the transparent pass will make it rendered
|
||||
@ -982,7 +983,7 @@ void Material::adjustForFog(scene::ISceneNode* parent, video::SMaterial *m,
|
||||
/** Callback from LOD nodes to create some effects */
|
||||
void Material::onMadeVisible(scene::IMeshBuffer* who)
|
||||
{
|
||||
if (!irr_driver->isGLSL()) return;
|
||||
if (!CVS->isGLSL()) return;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -990,14 +991,14 @@ void Material::onMadeVisible(scene::IMeshBuffer* who)
|
||||
/** Callback from LOD nodes to create some effects */
|
||||
void Material::onHidden(scene::IMeshBuffer* who)
|
||||
{
|
||||
if (!irr_driver->isGLSL()) return;
|
||||
if (!CVS->isGLSL()) return;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void Material::isInitiallyHidden(scene::IMeshBuffer* who)
|
||||
{
|
||||
if (!irr_driver->isGLSL()) return;
|
||||
if (!CVS->isGLSL()) return;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -17,6 +17,7 @@
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "graphics/mesh_tools.hpp"
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include <irrlicht.h>
|
||||
#include <IMesh.h>
|
||||
#include <IMeshBuffer.h>
|
||||
@ -325,7 +326,7 @@ void recalculateTangents(scene::IMesh* mesh, bool recalculateNormals, bool smoot
|
||||
|
||||
bool MeshTools::isNormalMap(scene::IMeshBuffer* mb)
|
||||
{
|
||||
if (!irr_driver->isGLSL())
|
||||
if (!CVS->isGLSL())
|
||||
return false;
|
||||
return (mb->getMaterial().MaterialType == irr_driver->getShader(ES_NORMAL_MAP) &&
|
||||
mb->getVertexType() != video::EVT_TANGENTS);
|
||||
|
@ -17,7 +17,7 @@
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "graphics/particle_emitter.hpp"
|
||||
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "graphics/material.hpp"
|
||||
#include "graphics/material_manager.hpp"
|
||||
#include "graphics/particle_kind.hpp"
|
||||
@ -298,7 +298,7 @@ ParticleEmitter::ParticleEmitter(const ParticleKind* type,
|
||||
m_particle_type = NULL;
|
||||
m_parent = parent;
|
||||
m_emission_decay_rate = 0;
|
||||
m_is_glsl = irr_driver->isGLSL();
|
||||
m_is_glsl = CVS->isGLSL();
|
||||
m_randomize_initial_y = randomize_initial_y;
|
||||
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/callbacks.hpp"
|
||||
#include "central_settings.hpp"
|
||||
#include "graphics/camera.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
@ -169,7 +170,7 @@ void PostProcessing::begin()
|
||||
/** Set the boost amount according to the speed of the camera */
|
||||
void PostProcessing::giveBoost(unsigned int camera_index)
|
||||
{
|
||||
if (irr_driver->isGLSL())
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
m_boost_time[camera_index] = 0.75f;
|
||||
|
||||
@ -185,7 +186,7 @@ void PostProcessing::giveBoost(unsigned int camera_index)
|
||||
*/
|
||||
void PostProcessing::update(float dt)
|
||||
{
|
||||
if (!irr_driver->isGLSL())
|
||||
if (!CVS->isGLSL())
|
||||
return;
|
||||
|
||||
MotionBlurProvider* const cb =
|
||||
@ -307,7 +308,7 @@ void PostProcessing::renderGaussian6BlurLayer(FrameBuffer &in_fbo, size_t layer,
|
||||
GLuint LayerTex;
|
||||
glGenTextures(1, &LayerTex);
|
||||
glTextureView(LayerTex, GL_TEXTURE_2D, in_fbo.getRTT()[0], GL_R32F, 0, 1, layer, 1);
|
||||
if (!irr_driver->hasARBComputeShaders())
|
||||
if (!CVS->supportsComputeShadersFiltering())
|
||||
{
|
||||
// Used as temp
|
||||
irr_driver->getFBO(FBO_SCALAR_1024).Bind();
|
||||
@ -367,7 +368,7 @@ void PostProcessing::renderGaussian6Blur(FrameBuffer &in_fbo, FrameBuffer &auxil
|
||||
assert(in_fbo.getWidth() == auxiliary.getWidth() && in_fbo.getHeight() == auxiliary.getHeight());
|
||||
float inv_width = 1.0f / in_fbo.getWidth(), inv_height = 1.0f / in_fbo.getHeight();
|
||||
|
||||
if (!irr_driver->hasARBComputeShaders())
|
||||
if (!CVS->supportsComputeShadersFiltering())
|
||||
{
|
||||
auxiliary.Bind();
|
||||
|
||||
@ -447,11 +448,11 @@ void PostProcessing::renderHorizontalBlur(FrameBuffer &in_fbo, FrameBuffer &auxi
|
||||
void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &auxiliary)
|
||||
{
|
||||
assert(in_fbo.getWidth() == auxiliary.getWidth() && in_fbo.getHeight() == auxiliary.getHeight());
|
||||
if (irr_driver->hasARBComputeShaders())
|
||||
if (CVS->supportsComputeShadersFiltering())
|
||||
glMemoryBarrier(GL_FRAMEBUFFER_BARRIER_BIT);
|
||||
float inv_width = 1.0f / in_fbo.getWidth(), inv_height = 1.0f / in_fbo.getHeight();
|
||||
{
|
||||
if (!irr_driver->hasARBComputeShaders())
|
||||
if (!CVS->supportsComputeShadersFiltering())
|
||||
{
|
||||
auxiliary.Bind();
|
||||
FullScreenShader::Gaussian17TapHShader::getInstance()->SetTextureUnits(in_fbo.getRTT()[0], irr_driver->getFBO(FBO_LINEAR_DEPTH).getRTT()[0]);
|
||||
@ -467,10 +468,10 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a
|
||||
glDispatchCompute((int)in_fbo.getWidth() / 8 + 1, (int)in_fbo.getHeight() / 8 + 1, 1);
|
||||
}
|
||||
}
|
||||
if (irr_driver->hasARBComputeShaders())
|
||||
if (CVS->supportsComputeShadersFiltering())
|
||||
glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
|
||||
{
|
||||
if (!irr_driver->hasARBComputeShaders())
|
||||
if (!CVS->supportsComputeShadersFiltering())
|
||||
{
|
||||
in_fbo.Bind();
|
||||
|
||||
@ -487,7 +488,7 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a
|
||||
glDispatchCompute((int)in_fbo.getWidth() / 8 + 1, (int)in_fbo.getHeight() / 8 + 1, 1);
|
||||
}
|
||||
}
|
||||
if (irr_driver->hasARBComputeShaders())
|
||||
if (CVS->supportsComputeShadersFiltering())
|
||||
glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT);
|
||||
}
|
||||
|
||||
@ -843,7 +844,7 @@ FrameBuffer *PostProcessing::render(scene::ICameraSceneNode * const camnode, boo
|
||||
}
|
||||
|
||||
// Workaround a bug with srgb fbo on sandy bridge windows
|
||||
if (irr_driver->needUBOWorkaround())
|
||||
if (!CVS->isARBUniformBufferObjectUsable())
|
||||
return in_fbo;
|
||||
|
||||
glEnable(GL_FRAMEBUFFER_SRGB);
|
||||
|
@ -17,7 +17,7 @@
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "graphics/referee.hpp"
|
||||
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/light.hpp"
|
||||
#include "graphics/mesh_tools.hpp"
|
||||
@ -150,7 +150,7 @@ Referee::Referee()
|
||||
|
||||
irr_driver->applyObjectPassShader(m_scene_node);
|
||||
|
||||
if (irr_driver->isGLSL() && UserConfigParams::m_dynamic_lights)
|
||||
if (CVS->isGLSL() && UserConfigParams::m_dynamic_lights)
|
||||
{
|
||||
m_light = irr_driver->addLight(core::vector3df(0.0f, 0.0f, 0.6f), 0.7f, 2.0f,
|
||||
0.7f /* r */, 0.0 /* g */, 0.0f /* b */, false /* sun */, m_scene_node);
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/callbacks.hpp"
|
||||
#include "central_settings.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
#include "graphics/lod_node.hpp"
|
||||
#include "graphics/post_processing.hpp"
|
||||
@ -352,12 +353,12 @@ void IrrDriver::renderScene(scene::ICameraSceneNode * const camnode, unsigned po
|
||||
// To avoid wrong culling, use the largest view possible
|
||||
m_scene_manager->setActiveCamera(m_suncam);
|
||||
if (UserConfigParams::m_dynamic_lights &&
|
||||
UserConfigParams::m_shadows && irr_driver->usesShadows() && hasShadow)
|
||||
UserConfigParams::m_shadows && CVS->isShadowEnabled() && hasShadow)
|
||||
{
|
||||
PROFILER_PUSH_CPU_MARKER("- Shadow", 0x30, 0x6F, 0x90);
|
||||
renderShadows();
|
||||
PROFILER_POP_CPU_MARKER();
|
||||
if (irr_driver->usesGI())
|
||||
if (CVS->isGlobalIlluminationEnabled())
|
||||
{
|
||||
PROFILER_PUSH_CPU_MARKER("- RSM", 0xFF, 0x0, 0xFF);
|
||||
renderRSM();
|
||||
@ -782,7 +783,7 @@ void IrrDriver::UpdateSplitAndLightcoordRangeFromComputeShaders(size_t width, si
|
||||
|
||||
void IrrDriver::computeCameraMatrix(scene::ICameraSceneNode * const camnode, size_t width, size_t height)
|
||||
{
|
||||
if (irr_driver->supportsSDSM())
|
||||
if (CVS->isSDSMEnabled())
|
||||
UpdateSplitAndLightcoordRangeFromComputeShaders(width, height);
|
||||
static_cast<scene::CSceneManager *>(m_scene_manager)->OnAnimate(os::Timer::getTime());
|
||||
camnode->render();
|
||||
@ -840,7 +841,7 @@ void IrrDriver::computeCameraMatrix(scene::ICameraSceneNode * const camnode, siz
|
||||
// Build the 3 ortho projection (for the 3 shadow resolution levels)
|
||||
for (unsigned i = 0; i < 4; i++)
|
||||
{
|
||||
if (!irr_driver->supportsSDSM())
|
||||
if (!CVS->isSDSMEnabled())
|
||||
{
|
||||
camnode->setFarValue(FarValues[i]);
|
||||
camnode->setNearValue(NearValues[i]);
|
||||
@ -895,7 +896,7 @@ void IrrDriver::computeCameraMatrix(scene::ICameraSceneNode * const camnode, siz
|
||||
|
||||
core::matrix4 tmp_matrix;
|
||||
|
||||
if (irr_driver->supportsSDSM()){
|
||||
if (CVS->isSDSMEnabled()){
|
||||
float left = float(CBB[currentCBB][i].xmin / 4 - 2);
|
||||
float right = float(CBB[currentCBB][i].xmax / 4 + 2);
|
||||
float up = float(CBB[currentCBB][i].ymin / 4 - 2);
|
||||
@ -1031,7 +1032,7 @@ void IrrDriver::renderGlow(std::vector<GlowData>& glows)
|
||||
glDepthMask(GL_FALSE);
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
if (irr_driver->hasARB_base_instance())
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(VAOManager::getInstance()->getVAO(EVT_STANDARD));
|
||||
for (u32 i = 0; i < glowcount; i++)
|
||||
{
|
||||
@ -1040,17 +1041,17 @@ void IrrDriver::renderGlow(std::vector<GlowData>& glows)
|
||||
|
||||
STKMeshSceneNode *node = static_cast<STKMeshSceneNode *>(cur);
|
||||
node->setGlowColors(SColor(0, (unsigned) (dat.b * 255.f), (unsigned)(dat.g * 255.f), (unsigned)(dat.r * 255.f)));
|
||||
if (!irr_driver->hasARB_draw_indirect())
|
||||
if (!CVS->supportsIndirectInstancingRendering())
|
||||
node->render();
|
||||
}
|
||||
|
||||
if (irr_driver->hasARB_draw_indirect())
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
{
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, GlowPassCmd::getInstance()->drawindirectcmd);
|
||||
glUseProgram(MeshShader::InstancedColorizeShader::getInstance()->Program);
|
||||
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(video::EVT_STANDARD, InstanceTypeGlow));
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
if (GlowPassCmd::getInstance()->Size)
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "graphics/irr_driver.hpp"
|
||||
|
||||
#include "central_settings.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/callbacks.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
@ -410,14 +410,14 @@ void renderMeshes1stPass()
|
||||
{
|
||||
auto &meshes = T::List::getInstance()->SolidPass;
|
||||
glUseProgram(T::FirstPassShader::getInstance()->Program);
|
||||
if (irr_driver->hasARB_base_instance())
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(VAOManager::getInstance()->getVAO(T::VertexType));
|
||||
for (unsigned i = 0; i < meshes.size(); i++)
|
||||
{
|
||||
std::vector<GLuint> Textures;
|
||||
std::vector<uint64_t> Handles;
|
||||
GLMesh &mesh = *(STK::tuple_get<0>(meshes.at(i)));
|
||||
if (!irr_driver->hasARB_base_instance())
|
||||
if (!CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(mesh.vao);
|
||||
if (mesh.VAOType != T::VertexType)
|
||||
{
|
||||
@ -427,7 +427,7 @@ void renderMeshes1stPass()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
HandleExpander<typename T::FirstPassShader>::template Expand(mesh.TextureHandles, T::FirstPassTextures);
|
||||
else
|
||||
TexExpander<typename T::FirstPassShader>::template ExpandTex(mesh, T::FirstPassTextures);
|
||||
@ -481,7 +481,7 @@ void IrrDriver::renderSolidFirstPass()
|
||||
{
|
||||
windDir = getWindDir();
|
||||
|
||||
if (irr_driver->hasARB_draw_indirect())
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, SolidPassCmd::getInstance()->drawindirectcmd);
|
||||
|
||||
{
|
||||
@ -500,7 +500,7 @@ void IrrDriver::renderSolidFirstPass()
|
||||
renderMeshes1stPass<SphereMap, 2, 1>();
|
||||
renderMeshes1stPass<DetailMat, 2, 1>();
|
||||
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
multidraw1stPass<DefaultMaterial>();
|
||||
multidraw1stPass<AlphaRef>();
|
||||
@ -511,7 +511,7 @@ void IrrDriver::renderSolidFirstPass()
|
||||
multidraw1stPass<NormalMat>();
|
||||
multidraw1stPass<DetailMat>();
|
||||
}
|
||||
else if (irr_driver->hasARB_draw_indirect())
|
||||
else if (CVS->supportsIndirectInstancingRendering())
|
||||
{
|
||||
renderInstancedMeshes1stPass<DefaultMaterial>();
|
||||
renderInstancedMeshes1stPass<AlphaRef>();
|
||||
@ -530,12 +530,12 @@ void renderMeshes2ndPass( const std::vector<uint64_t> &Prefilled_Handle,
|
||||
{
|
||||
auto &meshes = T::List::getInstance()->SolidPass;
|
||||
glUseProgram(T::SecondPassShader::getInstance()->Program);
|
||||
if (irr_driver->hasARB_base_instance())
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(VAOManager::getInstance()->getVAO(T::VertexType));
|
||||
for (unsigned i = 0; i < meshes.size(); i++)
|
||||
{
|
||||
GLMesh &mesh = *(STK::tuple_get<0>(meshes.at(i)));
|
||||
if (!irr_driver->hasARB_base_instance())
|
||||
if (!CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(mesh.vao);
|
||||
|
||||
if (mesh.VAOType != T::VertexType)
|
||||
@ -546,7 +546,7 @@ void renderMeshes2ndPass( const std::vector<uint64_t> &Prefilled_Handle,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
HandleExpander<typename T::SecondPassShader>::template Expand(mesh.TextureHandles, T::SecondPassTextures, Prefilled_Handle[0], Prefilled_Handle[1], Prefilled_Handle[2]);
|
||||
else
|
||||
TexExpander<typename T::SecondPassShader>::template ExpandTex(mesh, T::SecondPassTextures, Prefilled_Tex[0], Prefilled_Tex[1], Prefilled_Tex[2]);
|
||||
@ -595,7 +595,7 @@ void IrrDriver::renderSolidSecondPass()
|
||||
|
||||
uint64_t DiffuseHandle = 0, SpecularHandle = 0, SSAOHandle = 0, DepthHandle = 0;
|
||||
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
DiffuseHandle = glGetTextureSamplerHandleARB(m_rtts->getRenderTarget(RTT_DIFFUSE), MeshShader::ObjectPass2Shader::getInstance()->SamplersId[0]);
|
||||
if (!glIsTextureHandleResidentARB(DiffuseHandle))
|
||||
@ -633,7 +633,7 @@ void IrrDriver::renderSolidSecondPass()
|
||||
renderMeshes2ndPass<GrassMat, 3, 1>(createVector<uint64_t>(DiffuseHandle, SpecularHandle, SSAOHandle), DiffSpecSSAOTex);
|
||||
renderMeshes2ndPass<NormalMat, 3, 1>(createVector<uint64_t>(DiffuseHandle, SpecularHandle, SSAOHandle), DiffSpecSSAOTex);
|
||||
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
multidraw2ndPass<DefaultMaterial>(createVector<uint64_t>(DiffuseHandle, SpecularHandle, SSAOHandle, 0, 0));
|
||||
multidraw2ndPass<AlphaRef>(createVector<uint64_t>(DiffuseHandle, SpecularHandle, SSAOHandle, 0, 0));
|
||||
@ -658,7 +658,7 @@ void IrrDriver::renderSolidSecondPass()
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (irr_driver->hasARB_draw_indirect())
|
||||
else if (CVS->supportsIndirectInstancingRendering())
|
||||
{
|
||||
renderInstancedMeshes2ndPass<DefaultMaterial>(DiffSpecSSAOTex);
|
||||
renderInstancedMeshes2ndPass<AlphaRef>(DiffSpecSSAOTex);
|
||||
@ -714,7 +714,7 @@ static void renderMultiMeshNormals()
|
||||
|
||||
void IrrDriver::renderNormalsVisualisation()
|
||||
{
|
||||
if (irr_driver->useAZDO()) {
|
||||
if (CVS->isAZDOEnabled()) {
|
||||
renderMultiMeshNormals<DefaultMaterial>();
|
||||
renderMultiMeshNormals<AlphaRef>();
|
||||
renderMultiMeshNormals<UnlitMat>();
|
||||
@ -722,7 +722,7 @@ void IrrDriver::renderNormalsVisualisation()
|
||||
renderMultiMeshNormals<DetailMat>();
|
||||
renderMultiMeshNormals<NormalMat>();
|
||||
}
|
||||
else if (irr_driver->hasARB_draw_indirect())
|
||||
else if (CVS->supportsIndirectInstancingRendering())
|
||||
{
|
||||
renderInstancedMeshNormals<DefaultMaterial>();
|
||||
renderInstancedMeshNormals<AlphaRef>();
|
||||
@ -737,12 +737,12 @@ template<typename Shader, enum video::E_VERTEX_TYPE VertexType, int...List, type
|
||||
void renderTransparenPass(const std::vector<TexUnit> &TexUnits, std::vector<STK::Tuple<TupleType...> > *meshes)
|
||||
{
|
||||
glUseProgram(Shader::getInstance()->Program);
|
||||
if (irr_driver->hasARB_base_instance())
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(VAOManager::getInstance()->getVAO(VertexType));
|
||||
for (unsigned i = 0; i < meshes->size(); i++)
|
||||
{
|
||||
GLMesh &mesh = *(STK::tuple_get<0>(meshes->at(i)));
|
||||
if (!irr_driver->hasARB_base_instance())
|
||||
if (!CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(mesh.vao);
|
||||
if (mesh.VAOType != VertexType)
|
||||
{
|
||||
@ -752,7 +752,7 @@ void renderTransparenPass(const std::vector<TexUnit> &TexUnits, std::vector<STK:
|
||||
continue;
|
||||
}
|
||||
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
Shader::getInstance()->SetTextureHandles(mesh.TextureHandles[0]);
|
||||
else
|
||||
Shader::getInstance()->SetTextureUnits(getTextureGLuint(mesh.textures[0]));
|
||||
@ -775,7 +775,7 @@ void IrrDriver::renderTransparent()
|
||||
for (unsigned i = 0; i < ImmediateDrawList::getInstance()->size(); i++)
|
||||
ImmediateDrawList::getInstance()->at(i)->render();
|
||||
|
||||
if (irr_driver->hasARB_base_instance())
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(VAOManager::getInstance()->getVAO(video::EVT_STANDARD));
|
||||
|
||||
if (World::getWorld() && World::getWorld()->isFogEnabled())
|
||||
@ -820,7 +820,7 @@ void IrrDriver::renderTransparent()
|
||||
glStencilFunc(GL_ALWAYS, 1, 0xFF);
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||
|
||||
if (irr_driver->hasARB_base_instance())
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(VAOManager::getInstance()->getVAO(video::EVT_2TCOORDS));
|
||||
// Generate displace mask
|
||||
// Use RTT_TMP4 as displace mask
|
||||
@ -828,7 +828,7 @@ void IrrDriver::renderTransparent()
|
||||
for (unsigned i = 0; i < ListDisplacement::getInstance()->size(); i++)
|
||||
{
|
||||
const GLMesh &mesh = *(STK::tuple_get<0>(ListDisplacement::getInstance()->at(i)));
|
||||
if (!irr_driver->hasARB_base_instance())
|
||||
if (!CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(mesh.vao);
|
||||
const core::matrix4 &AbsoluteTransformation = STK::tuple_get<1>(ListDisplacement::getInstance()->at(i));
|
||||
if (mesh.VAOType != video::EVT_2TCOORDS)
|
||||
@ -855,7 +855,7 @@ void IrrDriver::renderTransparent()
|
||||
for (unsigned i = 0; i < ListDisplacement::getInstance()->size(); i++)
|
||||
{
|
||||
const GLMesh &mesh = *(STK::tuple_get<0>(ListDisplacement::getInstance()->at(i)));
|
||||
if (!irr_driver->hasARB_base_instance())
|
||||
if (!CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(mesh.vao);
|
||||
const core::matrix4 &AbsoluteTransformation = STK::tuple_get<1>(ListDisplacement::getInstance()->at(i));
|
||||
if (mesh.VAOType != video::EVT_2TCOORDS)
|
||||
@ -925,14 +925,14 @@ void renderShadow(unsigned cascade)
|
||||
{
|
||||
auto &t = T::List::getInstance()->Shadows[cascade];
|
||||
glUseProgram(T::ShadowPassShader::getInstance()->Program);
|
||||
if (irr_driver->hasARB_base_instance())
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(VAOManager::getInstance()->getVAO(T::VertexType));
|
||||
for (unsigned i = 0; i < t.size(); i++)
|
||||
{
|
||||
GLMesh *mesh = STK::tuple_get<0>(t.at(i));
|
||||
if (!irr_driver->hasARB_base_instance())
|
||||
if (!CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(mesh->vao);
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
HandleExpander<typename T::ShadowPassShader>::template Expand(mesh->TextureHandles, T::ShadowTextures);
|
||||
else
|
||||
TexExpander<typename T::ShadowPassShader>::template ExpandTex(*mesh, T::ShadowTextures);
|
||||
@ -1001,10 +1001,10 @@ void IrrDriver::renderShadows()
|
||||
renderShadow<UnlitMat, 1>(cascade);
|
||||
renderShadow<GrassMat, 3, 1>(cascade);
|
||||
|
||||
if (irr_driver->hasARB_draw_indirect())
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, ShadowPassCmd::getInstance()->drawindirectcmd);
|
||||
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
multidrawShadow<DefaultMaterial>(cascade);
|
||||
multidrawShadow<DetailMat>(cascade);
|
||||
@ -1013,7 +1013,7 @@ void IrrDriver::renderShadows()
|
||||
multidrawShadow<UnlitMat>(cascade);
|
||||
multidrawShadow<GrassMat>(cascade, windDir);
|
||||
}
|
||||
else if (irr_driver->hasARB_draw_indirect())
|
||||
else if (CVS->supportsIndirectInstancingRendering())
|
||||
{
|
||||
renderInstancedShadow<DefaultMaterial>(cascade);
|
||||
renderInstancedShadow<DetailMat>(cascade);
|
||||
@ -1029,7 +1029,7 @@ void IrrDriver::renderShadows()
|
||||
{
|
||||
ScopedGPUTimer Timer(getGPUTimer(Q_SHADOW_POSTPROCESS));
|
||||
|
||||
if (irr_driver->hasARBTextureView())
|
||||
if (CVS->isARBTextureViewUsable())
|
||||
{
|
||||
for (unsigned i = 0; i < 2; i++)
|
||||
{
|
||||
@ -1072,16 +1072,16 @@ template<typename T, int... Selector>
|
||||
void drawRSM(const core::matrix4 & rsm_matrix)
|
||||
{
|
||||
glUseProgram(T::RSMShader::getInstance()->Program);
|
||||
if (irr_driver->hasARB_base_instance())
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(VAOManager::getInstance()->getVAO(T::VertexType));
|
||||
auto t = T::List::getInstance()->RSM;
|
||||
for (unsigned i = 0; i < t.size(); i++)
|
||||
{
|
||||
std::vector<GLuint> Textures;
|
||||
GLMesh *mesh = STK::tuple_get<0>(t.at(i));
|
||||
if (!irr_driver->hasARB_base_instance())
|
||||
if (!CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(mesh->vao);
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
HandleExpander<typename T::RSMShader>::template Expand(mesh->TextureHandles, T::RSMTextures);
|
||||
else
|
||||
TexExpander<typename T::RSMShader>::template ExpandTex(*mesh, T::RSMTextures);
|
||||
@ -1135,10 +1135,10 @@ void IrrDriver::renderRSM()
|
||||
drawRSM<DetailMat, 3, 1>(rsm_matrix);
|
||||
drawRSM<SplattingMat, 1>(rsm_matrix);
|
||||
|
||||
if (irr_driver->hasARB_draw_indirect())
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, RSMPassCmd::getInstance()->drawindirectcmd);
|
||||
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
multidrawRSM<DefaultMaterial>(rsm_matrix);
|
||||
multidrawRSM<NormalMat>(rsm_matrix);
|
||||
@ -1146,7 +1146,7 @@ void IrrDriver::renderRSM()
|
||||
multidrawRSM<UnlitMat>(rsm_matrix);
|
||||
multidrawRSM<DetailMat>(rsm_matrix);
|
||||
}
|
||||
else if (irr_driver->hasARB_draw_indirect())
|
||||
else if (CVS->supportsIndirectInstancingRendering())
|
||||
{
|
||||
renderRSMShadow<DefaultMaterial>(rsm_matrix);
|
||||
renderRSMShadow<AlphaRef>(rsm_matrix);
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "graphics/irr_driver.hpp"
|
||||
|
||||
#include "central_settings.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
#include "graphics/light.hpp"
|
||||
@ -115,7 +115,7 @@ void IrrDriver::renderLights(unsigned pointlightcount, bool hasShadow)
|
||||
glDisable(GL_BLEND);
|
||||
m_rtts->getRH().Bind();
|
||||
glBindVertexArray(SharedObject::FullScreenQuadVAO);
|
||||
if (irr_driver->needRHWorkaround())
|
||||
if (CVS->needRHWorkaround())
|
||||
{
|
||||
glUseProgram(FullScreenShader::NVWorkaroundRadianceHintsConstructionShader::getInstance()->Program);
|
||||
FullScreenShader::NVWorkaroundRadianceHintsConstructionShader::getInstance()->SetTextureUnits(
|
||||
@ -145,7 +145,7 @@ void IrrDriver::renderLights(unsigned pointlightcount, bool hasShadow)
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
m_rtts->getFBO(FBO_DIFFUSE).Bind();
|
||||
if (irr_driver->usesGI() && hasShadow)
|
||||
if (CVS->isGlobalIlluminationEnabled() && hasShadow)
|
||||
{
|
||||
ScopedGPUTimer timer(irr_driver->getGPUTimer(Q_GI));
|
||||
m_post_processing->renderGI(rh_matrix, rh_extend, m_rtts->getRH().getRTT()[0], m_rtts->getRH().getRTT()[1], m_rtts->getRH().getRTT()[2]);
|
||||
@ -162,7 +162,7 @@ void IrrDriver::renderLights(unsigned pointlightcount, bool hasShadow)
|
||||
if (!World::getWorld() || World::getWorld()->getTrack()->hasShadows())
|
||||
{
|
||||
ScopedGPUTimer timer(irr_driver->getGPUTimer(Q_SUN));
|
||||
if (World::getWorld() && irr_driver->usesShadows() && hasShadow)
|
||||
if (World::getWorld() && CVS->isShadowEnabled() && hasShadow)
|
||||
m_post_processing->renderShadowedSunlight(irr_driver->getSunDirection(), irr_driver->getSunColor(), sun_ortho_matrix, m_rtts->getShadowFBO().getRTT()[0]);
|
||||
else
|
||||
m_post_processing->renderSunlight(irr_driver->getSunDirection(), irr_driver->getSunColor());
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "central_settings.hpp"
|
||||
#include "graphics/IBL.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/shaders.hpp"
|
||||
@ -263,7 +264,7 @@ GLuint generateCubeMapFromTextures(const std::vector<video::ITexture *> &texture
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, result);
|
||||
if (irr_driver->usesTextureCompression())
|
||||
if (CVS->isTextureCompressionEnabled())
|
||||
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_COMPRESSED_SRGB_ALPHA, size, size, 0, GL_BGRA, GL_UNSIGNED_BYTE, (GLvoid*)rgba[i]);
|
||||
else
|
||||
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_SRGB_ALPHA, size, size, 0, GL_BGRA, GL_UNSIGNED_BYTE, (GLvoid*)rgba[i]);
|
||||
|
@ -16,7 +16,7 @@
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "graphics/rtts.hpp"
|
||||
|
||||
#include "central_settings.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
@ -29,7 +29,7 @@ static GLuint generateRTT3D(GLenum target, size_t w, size_t h, size_t d, GLint i
|
||||
GLuint result;
|
||||
glGenTextures(1, &result);
|
||||
glBindTexture(target, result);
|
||||
if (irr_driver->hasARBTextureStorage())
|
||||
if (CVS->isARBTextureStorageUsable())
|
||||
glTexStorage3D(target, mipmaplevel, internalFormat, w, h, d);
|
||||
else
|
||||
glTexImage3D(target, 0, internalFormat, w, h, d, 0, format, type, 0);
|
||||
@ -41,7 +41,7 @@ static GLuint generateRTT(const core::dimension2du &res, GLint internalFormat, G
|
||||
GLuint result;
|
||||
glGenTextures(1, &result);
|
||||
glBindTexture(GL_TEXTURE_2D, result);
|
||||
if (irr_driver->hasARBTextureStorage())
|
||||
if (CVS->isARBTextureStorageUsable())
|
||||
glTexStorage2D(GL_TEXTURE_2D, mipmaplevel, internalFormat, res.Width, res.Height);
|
||||
else
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, res.Width, res.Height, 0, format, type, 0);
|
||||
@ -243,7 +243,7 @@ RTT::RTT(size_t width, size_t height)
|
||||
somevector.push_back(RenderTargetTextures[RTT_LENS_128]);
|
||||
FrameBuffers.push_back(new FrameBuffer(somevector, 128, 128));
|
||||
|
||||
if (UserConfigParams::m_shadows && !irr_driver->needUBOWorkaround())
|
||||
if (CVS->isShadowEnabled())
|
||||
{
|
||||
shadowColorTex = generateRTT3D(GL_TEXTURE_2D_ARRAY, 1024, 1024, 4, GL_R32F, GL_RED, GL_FLOAT, 10);
|
||||
shadowDepthTex = generateRTT3D(GL_TEXTURE_2D_ARRAY, 1024, 1024, 4, GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 1);
|
||||
@ -253,7 +253,7 @@ RTT::RTT(size_t width, size_t height)
|
||||
m_shadow_FBO = new FrameBuffer(somevector, shadowDepthTex, 1024, 1024, true);
|
||||
}
|
||||
|
||||
if (UserConfigParams::m_gi)
|
||||
if (CVS->isGlobalIlluminationEnabled())
|
||||
{
|
||||
//Todo : use "normal" shadowtex
|
||||
RSM_Color = generateRTT(shadowsize0, GL_RGB8, GL_RGB, GL_UNSIGNED_BYTE);
|
||||
@ -291,13 +291,13 @@ RTT::~RTT()
|
||||
{
|
||||
glDeleteTextures(RTT_COUNT, RenderTargetTextures);
|
||||
glDeleteTextures(1, &DepthStencilTexture);
|
||||
if (UserConfigParams::m_shadows && !irr_driver->needUBOWorkaround())
|
||||
if (CVS->isShadowEnabled())
|
||||
{
|
||||
delete m_shadow_FBO;
|
||||
glDeleteTextures(1, &shadowColorTex);
|
||||
glDeleteTextures(1, &shadowDepthTex);
|
||||
}
|
||||
if (UserConfigParams::m_gi)
|
||||
if (CVS->isGlobalIlluminationEnabled())
|
||||
{
|
||||
delete m_RH_FBO;
|
||||
delete m_RSM;
|
||||
|
@ -92,6 +92,7 @@
|
||||
#define SHADER_NAMES
|
||||
|
||||
#include "graphics/callbacks.hpp"
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/gpuparticles.hpp"
|
||||
#include "graphics/shaders.hpp"
|
||||
@ -145,22 +146,22 @@ GLuint LoadShader(const char * file, unsigned type)
|
||||
{
|
||||
GLuint Id = glCreateShader(type);
|
||||
char versionString[20];
|
||||
sprintf(versionString, "#version %d\n", irr_driver->getGLSLVersion());
|
||||
sprintf(versionString, "#version %d\n", CVS->getGLSLVersion());
|
||||
std::string Code = versionString;
|
||||
if (irr_driver->hasVSLayerExtension())
|
||||
if (CVS->isAMDVertexShaderLayerUsable())
|
||||
Code += "#extension GL_AMD_vertex_shader_layer : enable\n";
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
Code += "#extension GL_ARB_bindless_texture : enable\n";
|
||||
Code += "#define Use_Bindless_Texture\n";
|
||||
}
|
||||
std::ifstream Stream(file, std::ios::in);
|
||||
Code += "//" + std::string(file) + "\n";
|
||||
if (irr_driver->needUBOWorkaround())
|
||||
if (!CVS->isARBUniformBufferObjectUsable())
|
||||
Code += "#define UBO_DISABLED\n";
|
||||
if (irr_driver->hasVSLayerExtension())
|
||||
if (CVS->isAMDVertexShaderLayerUsable())
|
||||
Code += "#define VSLayer\n";
|
||||
if (irr_driver->needsRGBBindlessWorkaround())
|
||||
if (CVS->needsRGBBindlessWorkaround())
|
||||
Code += "#define SRGBBindlessFix\n";
|
||||
Code += LoadHeader();
|
||||
if (Stream.is_open())
|
||||
@ -237,7 +238,7 @@ GLuint LoadTFBProgram(const char * vertex_file_path, const char **varyings, unsi
|
||||
{
|
||||
GLuint Program = glCreateProgram();
|
||||
loadAndAttach(Program, GL_VERTEX_SHADER, vertex_file_path);
|
||||
if (irr_driver->getGLSLVersion() < 330)
|
||||
if (CVS->getGLSLVersion() < 330)
|
||||
setAttribute(PARTICLES_SIM, Program);
|
||||
glTransformFeedbackVaryings(Program, varyingscount, varyings, GL_INTERLEAVED_ATTRIBS);
|
||||
glLinkProgram(Program);
|
||||
@ -695,7 +696,7 @@ using namespace UtilShader;
|
||||
|
||||
bool needsUBO()
|
||||
{
|
||||
return irr_driver->needUBOWorkaround();
|
||||
return !CVS->isARBUniformBufferObjectUsable();
|
||||
}
|
||||
|
||||
void setTextureSampler(GLenum tp, GLuint texunit, GLuint tid, GLuint sid)
|
||||
@ -895,7 +896,7 @@ void BindTextureVolume(GLuint TU, GLuint tex)
|
||||
|
||||
unsigned getGLSLVersion()
|
||||
{
|
||||
return irr_driver->getGLSLVersion();
|
||||
return CVS->getGLSLVersion();
|
||||
}
|
||||
|
||||
namespace UtilShader
|
||||
@ -1195,9 +1196,9 @@ namespace MeshShader
|
||||
ShadowShader::ShadowShader()
|
||||
{
|
||||
// Geometry shader needed
|
||||
if (irr_driver->getGLSLVersion() < 150)
|
||||
if (CVS->getGLSLVersion() < 150)
|
||||
return;
|
||||
if (irr_driver->hasVSLayerExtension())
|
||||
if (CVS->isAMDVertexShaderLayerUsable())
|
||||
{
|
||||
Program = LoadProgram(OBJECT,
|
||||
GL_VERTEX_SHADER, file_manager->getAsset("shaders/shadow.vert").c_str(),
|
||||
@ -1247,9 +1248,9 @@ namespace MeshShader
|
||||
InstancedShadowShader::InstancedShadowShader()
|
||||
{
|
||||
// Geometry shader needed
|
||||
if (irr_driver->getGLSLVersion() < 150)
|
||||
if (CVS->getGLSLVersion() < 150)
|
||||
return;
|
||||
if (irr_driver->hasVSLayerExtension())
|
||||
if (CVS->isAMDVertexShaderLayerUsable())
|
||||
{
|
||||
Program = LoadProgram(OBJECT,
|
||||
GL_VERTEX_SHADER, file_manager->getAsset("shaders/utils/getworldmatrix.vert").c_str(),
|
||||
@ -1270,9 +1271,9 @@ namespace MeshShader
|
||||
RefShadowShader::RefShadowShader()
|
||||
{
|
||||
// Geometry shader needed
|
||||
if (irr_driver->getGLSLVersion() < 150)
|
||||
if (CVS->getGLSLVersion() < 150)
|
||||
return;
|
||||
if (irr_driver->hasVSLayerExtension())
|
||||
if (CVS->isAMDVertexShaderLayerUsable())
|
||||
{
|
||||
Program = LoadProgram(OBJECT,
|
||||
GL_VERTEX_SHADER, file_manager->getAsset("shaders/shadow.vert").c_str(),
|
||||
@ -1292,9 +1293,9 @@ namespace MeshShader
|
||||
InstancedRefShadowShader::InstancedRefShadowShader()
|
||||
{
|
||||
// Geometry shader needed
|
||||
if (irr_driver->getGLSLVersion() < 150)
|
||||
if (CVS->getGLSLVersion() < 150)
|
||||
return;
|
||||
if (irr_driver->hasVSLayerExtension())
|
||||
if (CVS->isAMDVertexShaderLayerUsable())
|
||||
{
|
||||
Program = LoadProgram(OBJECT,
|
||||
GL_VERTEX_SHADER, file_manager->getAsset("shaders/utils/getworldmatrix.vert").c_str(),
|
||||
@ -1316,9 +1317,9 @@ namespace MeshShader
|
||||
GrassShadowShader::GrassShadowShader()
|
||||
{
|
||||
// Geometry shader needed
|
||||
if (irr_driver->getGLSLVersion() < 150)
|
||||
if (CVS->getGLSLVersion() < 150)
|
||||
return;
|
||||
if (irr_driver->hasVSLayerExtension())
|
||||
if (CVS->isAMDVertexShaderLayerUsable())
|
||||
{
|
||||
Program = LoadProgram(OBJECT,
|
||||
GL_VERTEX_SHADER, file_manager->getAsset("shaders/shadow_grass.vert").c_str(),
|
||||
@ -1338,9 +1339,9 @@ namespace MeshShader
|
||||
InstancedGrassShadowShader::InstancedGrassShadowShader()
|
||||
{
|
||||
// Geometry shader needed
|
||||
if (irr_driver->getGLSLVersion() < 150)
|
||||
if (CVS->getGLSLVersion() < 150)
|
||||
return;
|
||||
if (irr_driver->hasVSLayerExtension())
|
||||
if (CVS->isAMDVertexShaderLayerUsable())
|
||||
{
|
||||
Program = LoadProgram(OBJECT,
|
||||
GL_VERTEX_SHADER, file_manager->getAsset("shaders/utils/getworldmatrix.vert").c_str(),
|
||||
@ -1674,7 +1675,7 @@ namespace FullScreenShader
|
||||
|
||||
RadianceHintsConstructionShader::RadianceHintsConstructionShader()
|
||||
{
|
||||
if (irr_driver->hasVSLayerExtension())
|
||||
if (CVS->isAMDVertexShaderLayerUsable())
|
||||
{
|
||||
Program = LoadProgram(OBJECT,
|
||||
GL_VERTEX_SHADER, file_manager->getAsset("shaders/slicedscreenquad.vert").c_str(),
|
||||
|
@ -17,7 +17,7 @@
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "graphics/slip_stream.hpp"
|
||||
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
@ -235,7 +235,7 @@ void SlipStream::createMesh(Material* material)
|
||||
} // for j<num_circles-1
|
||||
|
||||
material->setMaterialProperties(&buffer->getMaterial(), buffer);
|
||||
if (!irr_driver->isGLSL())
|
||||
if (!CVS->isGLSL())
|
||||
{
|
||||
buffer->Material.setFlag(video::EMF_BACK_FACE_CULLING, false);
|
||||
buffer->Material.setFlag(video::EMF_COLOR_MATERIAL, true);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "central_settings.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
#include "graphics/stkanimatedmesh.hpp"
|
||||
#include <ISceneManager.h>
|
||||
@ -155,7 +156,7 @@ void STKAnimatedMesh::updateGL()
|
||||
else
|
||||
InitTexturesTransparent(mesh);
|
||||
|
||||
if (irr_driver->hasARB_base_instance())
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
{
|
||||
std::pair<unsigned, unsigned> p = VAOManager::getInstance()->getBase(mb);
|
||||
mesh.vaoBaseVertex = p.first;
|
||||
@ -180,7 +181,7 @@ void STKAnimatedMesh::updateGL()
|
||||
|
||||
size_t size = mb->getVertexCount() * GLmeshes[i].Stride, offset = GLmeshes[i].vaoBaseVertex * GLmeshes[i].Stride;
|
||||
void *buf;
|
||||
if (irr_driver->hasBufferStorageExtension())
|
||||
if (CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
buf = VAOManager::getInstance()->getVBOPtr(mb->getVertexType());
|
||||
buf = (char *)buf + offset;
|
||||
@ -188,7 +189,7 @@ void STKAnimatedMesh::updateGL()
|
||||
else
|
||||
{
|
||||
glBindVertexArray(0);
|
||||
if (irr_driver->hasARB_base_instance())
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindBuffer(GL_ARRAY_BUFFER, VAOManager::getInstance()->getVBO(mb->getVertexType()));
|
||||
else
|
||||
glBindBuffer(GL_ARRAY_BUFFER, GLmeshes[i].vertex_buffer);
|
||||
@ -196,7 +197,7 @@ void STKAnimatedMesh::updateGL()
|
||||
buf = glMapBufferRange(GL_ARRAY_BUFFER, offset, size, bitfield);
|
||||
}
|
||||
memcpy(buf, mb->getVertices(), size);
|
||||
if (!irr_driver->hasBufferStorageExtension())
|
||||
if (!CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "central_settings.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/stkmesh.hpp"
|
||||
@ -286,7 +287,7 @@ SetTexture(GLMesh &mesh, unsigned i, bool isSrgb, const std::string &matname)
|
||||
return;
|
||||
}
|
||||
compressTexture(mesh.textures[i], isSrgb);
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
if (!mesh.TextureHandles[i])
|
||||
mesh.TextureHandles[i] = glGetTextureSamplerHandleARB(getTextureGLuint(mesh.textures[i]), MeshShader::ObjectPass1Shader::getInstance()->SamplersId[0]);
|
||||
@ -359,7 +360,7 @@ void InitTexturesTransparent(GLMesh &mesh)
|
||||
return;
|
||||
}
|
||||
compressTexture(mesh.textures[0], true);
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
if (!mesh.TextureHandles[0])
|
||||
mesh.TextureHandles[0] = glGetTextureSamplerHandleARB(getTextureGLuint(mesh.textures[0]), MeshShader::ObjectPass1Shader::getInstance()->SamplersId[0]);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "central_settings.hpp"
|
||||
#include "stkmeshscenenode.hpp"
|
||||
#include "stkmesh.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
@ -197,7 +198,7 @@ void STKMeshSceneNode::updateGL()
|
||||
else if (!immediate_draw)
|
||||
InitTexturesTransparent(mesh);
|
||||
|
||||
if (!immediate_draw && irr_driver->hasARB_base_instance())
|
||||
if (!immediate_draw && CVS->isARBBaseInstanceUsable())
|
||||
{
|
||||
std::pair<unsigned, unsigned> p = VAOManager::getInstance()->getBase(mb);
|
||||
mesh.vaoBaseVertex = p.first;
|
||||
@ -269,7 +270,7 @@ void STKMeshSceneNode::render()
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
compressTexture(mesh.textures[0], true);
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
if (!mesh.TextureHandles[0])
|
||||
mesh.TextureHandles[0] = glGetTextureSamplerHandleARB(getTextureGLuint(mesh.textures[0]), MeshShader::ObjectPass1Shader::getInstance()->SamplersId[0]);
|
||||
@ -307,7 +308,7 @@ void STKMeshSceneNode::render()
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
GLuint64 DiffuseHandle = glGetTextureSamplerHandleARB(irr_driver->getRenderTargetTexture(RTT_DIFFUSE), MeshShader::ObjectPass2Shader::getInstance()->SamplersId[0]);
|
||||
if (!glIsTextureHandleResidentARB(DiffuseHandle))
|
||||
@ -356,7 +357,7 @@ void STKMeshSceneNode::render()
|
||||
scene::IMeshBuffer* mb = Mesh->getMeshBuffer(i);
|
||||
if (!mb)
|
||||
continue;
|
||||
if (irr_driver->hasARB_base_instance())
|
||||
if (CVS->isARBBaseInstanceUsable())
|
||||
glBindVertexArray(VAOManager::getInstance()->getVAO(video::EVT_STANDARD));
|
||||
else
|
||||
glBindVertexArray(GLmeshes[i].vao);
|
||||
@ -403,7 +404,7 @@ void STKMeshSceneNode::render()
|
||||
tmpcol.getBlue() / 255.0f);
|
||||
|
||||
compressTexture(mesh.textures[0], true);
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
if (!mesh.TextureHandles[0])
|
||||
mesh.TextureHandles[0] = glGetTextureSamplerHandleARB(getTextureGLuint(mesh.textures[0]), MeshShader::TransparentFogShader::getInstance()->SamplersId[0]);
|
||||
@ -433,7 +434,7 @@ void STKMeshSceneNode::render()
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
compressTexture(mesh.textures[0], true);
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
if (!mesh.TextureHandles[0])
|
||||
mesh.TextureHandles[0] = glGetTextureSamplerHandleARB(getTextureGLuint(mesh.textures[0]), MeshShader::TransparentShader::getInstance()->SamplersId[0]);
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "graphics/stkscenemanager.hpp"
|
||||
#include "graphics/stkmesh.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "stkanimatedmesh.hpp"
|
||||
#include "stkmeshscenenode.hpp"
|
||||
#include "utils/ptr_vector.hpp"
|
||||
@ -143,7 +144,7 @@ void FillInstances(const std::unordered_map<scene::IMeshBuffer *, std::vector<st
|
||||
for (; It != E; ++It)
|
||||
{
|
||||
FillInstances_impl<T>(It->second, InstanceBuffer, CommandBuffer, InstanceBufferOffset, CommandBufferOffset, Polycount);
|
||||
if (!irr_driver->useAZDO())
|
||||
if (!CVS->isAZDOEnabled())
|
||||
InstancedList.push_back(It->second.front().first);
|
||||
}
|
||||
}
|
||||
@ -292,7 +293,7 @@ handleSTKCommon(scene::ISceneNode *Node, std::vector<scene::ISceneNode *> *Immed
|
||||
{
|
||||
for (unsigned Mat = 0; Mat < Material::SHADERTYPE_COUNT; ++Mat)
|
||||
{
|
||||
if (irr_driver->hasARB_draw_indirect())
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
{
|
||||
for_in(mesh, node->MeshSolidMaterial[Mat])
|
||||
{
|
||||
@ -369,7 +370,7 @@ handleSTKCommon(scene::ISceneNode *Node, std::vector<scene::ISceneNode *> *Immed
|
||||
continue;
|
||||
for (unsigned Mat = 0; Mat < Material::SHADERTYPE_COUNT; ++Mat)
|
||||
{
|
||||
if (irr_driver->hasARB_draw_indirect())
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
{
|
||||
for_in(mesh, node->MeshSolidMaterial[Mat])
|
||||
{
|
||||
@ -426,7 +427,7 @@ handleSTKCommon(scene::ISceneNode *Node, std::vector<scene::ISceneNode *> *Immed
|
||||
{
|
||||
for (unsigned Mat = 0; Mat < Material::SHADERTYPE_COUNT; ++Mat)
|
||||
{
|
||||
if (irr_driver->hasARB_draw_indirect())
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
{
|
||||
if (Mat == Material::SHADERTYPE_SPLATTING)
|
||||
for_in(mesh, node->MeshSolidMaterial[Mat])
|
||||
@ -524,10 +525,10 @@ template<Material::ShaderType Mat, typename T> static void
|
||||
GenDrawCalls(unsigned cascade, std::vector<GLMesh *> &InstancedList,
|
||||
T *InstanceBuffer, DrawElementsIndirectCommand *CommandBuffer, size_t &InstanceBufferOffset, size_t &CommandBufferOffset, size_t &PolyCount)
|
||||
{
|
||||
if (irr_driver->hasARB_draw_indirect())
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
ShadowPassCmd::getInstance()->Offset[cascade][Mat] = CommandBufferOffset; // Store command buffer offset
|
||||
FillInstances<T>(MeshForShadowPass[Mat][cascade], InstancedList, InstanceBuffer, CommandBuffer, InstanceBufferOffset, CommandBufferOffset, PolyCount);
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
ShadowPassCmd::getInstance()->Size[cascade][Mat] = CommandBufferOffset - ShadowPassCmd::getInstance()->Offset[cascade][Mat];
|
||||
}
|
||||
|
||||
@ -613,7 +614,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
DeferredUpdate[i]->updateGL();
|
||||
PROFILER_POP_CPU_MARKER();
|
||||
|
||||
if (!irr_driver->hasARB_draw_indirect())
|
||||
if (!CVS->supportsIndirectInstancingRendering())
|
||||
return;
|
||||
|
||||
InstanceDataDualTex *InstanceBufferDualTex;
|
||||
@ -626,7 +627,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
DrawElementsIndirectCommand *RSMCmdBuffer;
|
||||
DrawElementsIndirectCommand *GlowCmdBuffer;
|
||||
|
||||
if (irr_driver->hasBufferStorageExtension())
|
||||
if (CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
InstanceBufferDualTex = (InstanceDataDualTex*)VAOManager::getInstance()->getInstanceBufferPtr(InstanceTypeDualTex);
|
||||
InstanceBufferThreeTex = (InstanceDataThreeTex*)VAOManager::getInstance()->getInstanceBufferPtr(InstanceTypeThreeTex);
|
||||
@ -659,7 +660,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
#pragma omp section
|
||||
{
|
||||
size_t offset = 0, current_cmd = 0;
|
||||
if (!irr_driver->hasBufferStorageExtension())
|
||||
if (!CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
glBindBuffer(GL_ARRAY_BUFFER, VAOManager::getInstance()->getInstanceBuffer(InstanceTypeDualTex));
|
||||
InstanceBufferDualTex = (InstanceDataDualTex*)glMapBufferRange(GL_ARRAY_BUFFER, 0, 10000 * sizeof(InstanceDataDualTex), GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);
|
||||
@ -689,7 +690,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
FillInstances(MeshForSolidPass[Material::SHADERTYPE_VEGETATION], ListInstancedMatGrass::getInstance()->SolidPass, InstanceBufferDualTex, CmdBuffer, offset, current_cmd, SolidPoly);
|
||||
SolidPassCmd::getInstance()->Size[Material::SHADERTYPE_VEGETATION] = current_cmd - SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_VEGETATION];
|
||||
|
||||
if (!irr_driver->hasBufferStorageExtension())
|
||||
if (!CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, VAOManager::getInstance()->getInstanceBuffer(InstanceTypeThreeTex));
|
||||
@ -707,7 +708,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
SolidPassCmd::getInstance()->Size[Material::SHADERTYPE_NORMAL_MAP] = current_cmd - SolidPassCmd::getInstance()->Offset[Material::SHADERTYPE_NORMAL_MAP];
|
||||
|
||||
|
||||
if (!irr_driver->hasBufferStorageExtension())
|
||||
if (!CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
glUnmapBuffer(GL_DRAW_INDIRECT_BUFFER);
|
||||
@ -717,7 +718,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
{
|
||||
size_t offset = 0, current_cmd = 0;
|
||||
|
||||
if (!irr_driver->hasBufferStorageExtension())
|
||||
if (!CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
glBindBuffer(GL_ARRAY_BUFFER, VAOManager::getInstance()->getInstanceBuffer(InstanceTypeGlow));
|
||||
GlowInstanceBuffer = (GlowInstanceData*)glMapBufferRange(GL_ARRAY_BUFFER, 0, 10000 * sizeof(InstanceDataDualTex), GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);
|
||||
@ -726,7 +727,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
}
|
||||
|
||||
// Glow
|
||||
if (irr_driver->hasARB_draw_indirect())
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
GlowPassCmd::getInstance()->Offset = offset; // Store command buffer offset
|
||||
|
||||
auto It = MeshForGlowPass.begin(), E = MeshForGlowPass.end();
|
||||
@ -734,14 +735,14 @@ PROFILER_POP_CPU_MARKER();
|
||||
{
|
||||
size_t Polycnt = 0;
|
||||
FillInstances_impl<GlowInstanceData>(It->second, GlowInstanceBuffer, GlowCmdBuffer, offset, current_cmd, Polycnt);
|
||||
if (!irr_driver->useAZDO())
|
||||
if (!CVS->isAZDOEnabled())
|
||||
ListInstancedGlow::getInstance()->push_back(It->second.front().first);
|
||||
}
|
||||
|
||||
if (irr_driver->useAZDO())
|
||||
if (CVS->isAZDOEnabled())
|
||||
GlowPassCmd::getInstance()->Size = current_cmd - GlowPassCmd::getInstance()->Offset;
|
||||
|
||||
if (!irr_driver->hasBufferStorageExtension())
|
||||
if (!CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
glUnmapBuffer(GL_DRAW_INDIRECT_BUFFER);
|
||||
@ -752,7 +753,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
irr_driver->setPhase(SHADOW_PASS);
|
||||
|
||||
size_t offset = 0, current_cmd = 0;
|
||||
if (!irr_driver->hasBufferStorageExtension())
|
||||
if (!CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
glBindBuffer(GL_ARRAY_BUFFER, VAOManager::getInstance()->getInstanceBuffer(InstanceTypeShadow));
|
||||
ShadowInstanceBuffer = (InstanceDataSingleTex*)glMapBufferRange(GL_ARRAY_BUFFER, 0, 10000 * sizeof(InstanceDataDualTex), GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);
|
||||
@ -777,7 +778,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
// Mat Grass
|
||||
GenDrawCalls<Material::SHADERTYPE_VEGETATION>(i, ListInstancedMatGrass::getInstance()->Shadows[i], ShadowInstanceBuffer, ShadowCmdBuffer, offset, current_cmd, ShadowPoly);
|
||||
}
|
||||
if (!irr_driver->hasBufferStorageExtension())
|
||||
if (!CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
glUnmapBuffer(GL_DRAW_INDIRECT_BUFFER);
|
||||
@ -787,7 +788,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
if (!m_rsm_map_available)
|
||||
{
|
||||
size_t offset = 0, current_cmd = 0;
|
||||
if (!irr_driver->hasBufferStorageExtension())
|
||||
if (!CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
glBindBuffer(GL_ARRAY_BUFFER, VAOManager::getInstance()->getInstanceBuffer(InstanceTypeRSM));
|
||||
RSMInstanceBuffer = (InstanceDataSingleTex*)glMapBufferRange(GL_ARRAY_BUFFER, 0, 10000 * sizeof(InstanceDataDualTex), GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);
|
||||
@ -816,7 +817,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
FillInstances(MeshForRSM[Material::SHADERTYPE_NORMAL_MAP], ListInstancedMatNormalMap::getInstance()->RSM, RSMInstanceBuffer, RSMCmdBuffer, offset, current_cmd, MiscPoly);
|
||||
RSMPassCmd::getInstance()->Size[Material::SHADERTYPE_NORMAL_MAP] = current_cmd - RSMPassCmd::getInstance()->Offset[Material::SHADERTYPE_NORMAL_MAP];
|
||||
|
||||
if (!irr_driver->hasBufferStorageExtension())
|
||||
if (!CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
glUnmapBuffer(GL_DRAW_INDIRECT_BUFFER);
|
||||
@ -827,6 +828,6 @@ PROFILER_POP_CPU_MARKER();
|
||||
poly_count[SOLID_NORMAL_AND_DEPTH_PASS] += SolidPoly;
|
||||
poly_count[SHADOW_PASS] += ShadowPoly;
|
||||
|
||||
if (irr_driver->hasBufferStorageExtension())
|
||||
if (CVS->isARBBufferStorageUsable())
|
||||
glMemoryBarrier(GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT);
|
||||
}
|
@ -5,6 +5,7 @@
|
||||
#define HEADER_STKSCENEMANAGER_HPP
|
||||
|
||||
#include "utils/singleton.hpp"
|
||||
#include "central_settings.hpp"
|
||||
#include "gl_headers.hpp"
|
||||
#include "stkmesh.hpp"
|
||||
#include "gpuparticles.hpp"
|
||||
@ -20,7 +21,7 @@ public:
|
||||
{
|
||||
glGenBuffers(1, &drawindirectcmd);
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, drawindirectcmd);
|
||||
if (irr_driver->hasBufferStorageExtension())
|
||||
if (CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
glBufferStorage(GL_DRAW_INDIRECT_BUFFER, 10000 * sizeof(DrawElementsIndirectCommand), 0, GL_MAP_PERSISTENT_BIT | GL_MAP_WRITE_BIT);
|
||||
Ptr = (DrawElementsIndirectCommand *)glMapBufferRange(GL_DRAW_INDIRECT_BUFFER, 0, 10000 * sizeof(DrawElementsIndirectCommand), GL_MAP_PERSISTENT_BIT | GL_MAP_WRITE_BIT);
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "central_settings.hpp"
|
||||
#include "texturemanager.hpp"
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
@ -34,7 +35,7 @@ void compressTexture(irr::video::ITexture *tex, bool srgb, bool premul_alpha)
|
||||
glBindTexture(GL_TEXTURE_2D, getTextureGLuint(tex));
|
||||
|
||||
std::string cached_file;
|
||||
if (irr_driver->usesTextureCompression())
|
||||
if (CVS->isTextureCompressionEnabled())
|
||||
{
|
||||
// Try to retrieve the compressed texture in cache
|
||||
std::string tex_name = irr_driver->getTextureName(tex);
|
||||
@ -70,7 +71,7 @@ void compressTexture(irr::video::ITexture *tex, bool srgb, bool premul_alpha)
|
||||
}
|
||||
}
|
||||
|
||||
if (!irr_driver->usesTextureCompression())
|
||||
if (!CVS->isTextureCompressionEnabled())
|
||||
{
|
||||
if (srgb)
|
||||
internalFormat = (tex->hasAlpha()) ? GL_SRGB_ALPHA : GL_SRGB;
|
||||
@ -88,7 +89,7 @@ void compressTexture(irr::video::ITexture *tex, bool srgb, bool premul_alpha)
|
||||
glGenerateMipmap(GL_TEXTURE_2D);
|
||||
delete[] data;
|
||||
|
||||
if (irr_driver->usesTextureCompression() && !cached_file.empty())
|
||||
if (CVS->isTextureCompressionEnabled() && !cached_file.empty())
|
||||
{
|
||||
// Save the compressed texture in the cache for later use.
|
||||
saveCompressedTexture(cached_file);
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "irr_driver.hpp"
|
||||
#include "stkmesh.hpp"
|
||||
#include "glwrap.hpp"
|
||||
#include "central_settings.hpp"
|
||||
|
||||
VAOManager::VAOManager()
|
||||
{
|
||||
@ -17,7 +18,7 @@ VAOManager::VAOManager()
|
||||
{
|
||||
glGenBuffers(1, &instance_vbo[i]);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, instance_vbo[i]);
|
||||
if (irr_driver->hasBufferStorageExtension())
|
||||
if (CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
glBufferStorage(GL_ARRAY_BUFFER, 10000 * sizeof(InstanceDataDualTex), 0, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT);
|
||||
Ptr[i] = glMapBufferRange(GL_ARRAY_BUFFER, 0, 10000 * sizeof(InstanceDataDualTex), GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT);
|
||||
@ -67,7 +68,7 @@ void VAOManager::regenerateBuffer(enum VTXTYPE tp, size_t newlastvertex, size_t
|
||||
GLuint newVBO;
|
||||
glGenBuffers(1, &newVBO);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, newVBO);
|
||||
if (irr_driver->hasBufferStorageExtension())
|
||||
if (CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
glBufferStorage(GL_ARRAY_BUFFER, RealVBOSize[tp] * getVertexPitch(tp), 0, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT);
|
||||
VBOPtr[tp] = glMapBufferRange(GL_ARRAY_BUFFER, 0, RealVBOSize[tp] * getVertexPitch(tp), GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT);
|
||||
@ -94,7 +95,7 @@ void VAOManager::regenerateBuffer(enum VTXTYPE tp, size_t newlastvertex, size_t
|
||||
GLuint newIBO;
|
||||
glGenBuffers(1, &newIBO);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, newIBO);
|
||||
if (irr_driver->hasBufferStorageExtension())
|
||||
if (CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
glBufferStorage(GL_ELEMENT_ARRAY_BUFFER, RealIBOSize[tp] * sizeof(u16), 0, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT);
|
||||
IBOPtr[tp] = glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, 0, RealIBOSize[tp] * sizeof(u16), GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT);
|
||||
@ -287,7 +288,7 @@ void VAOManager::append(scene::IMeshBuffer *mb, VTXTYPE tp)
|
||||
size_t old_idx_cnt = last_index[tp];
|
||||
|
||||
regenerateBuffer(tp, old_vtx_cnt + mb->getVertexCount(), old_idx_cnt + mb->getIndexCount());
|
||||
if (irr_driver->hasBufferStorageExtension())
|
||||
if (CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
void *tmp = (char*)VBOPtr[tp] + old_vtx_cnt * getVertexPitch(tp);
|
||||
memcpy(tmp, mb->getVertices(), mb->getVertexCount() * getVertexPitch(tp));
|
||||
@ -297,7 +298,7 @@ void VAOManager::append(scene::IMeshBuffer *mb, VTXTYPE tp)
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vbo[tp]);
|
||||
glBufferSubData(GL_ARRAY_BUFFER, old_vtx_cnt * getVertexPitch(tp), mb->getVertexCount() * getVertexPitch(tp), mb->getVertices());
|
||||
}
|
||||
if (irr_driver->hasBufferStorageExtension())
|
||||
if (CVS->isARBBufferStorageUsable())
|
||||
{
|
||||
void *tmp = (char*)IBOPtr[tp] + old_idx_cnt * sizeof(u16);
|
||||
memcpy(tmp, mb->getIndices(), mb->getIndexCount() * sizeof(u16));
|
||||
|
@ -16,6 +16,7 @@
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/widgets/model_view_widget.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
@ -155,7 +156,7 @@ void ModelViewWidget::update(float delta)
|
||||
if (fabsf(angle - m_rotation_target) < 2.0f) m_rotation_mode = ROTATE_OFF;
|
||||
}
|
||||
|
||||
if (!irr_driver->isGLSL())
|
||||
if (!CVS->isGLSL())
|
||||
return;
|
||||
|
||||
if (m_rtt_provider == NULL)
|
||||
|
@ -18,7 +18,7 @@
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "karts/kart.hpp"
|
||||
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "audio/music_manager.hpp"
|
||||
#include "audio/sfx_manager.hpp"
|
||||
#include "audio/sfx_base.hpp"
|
||||
@ -2705,7 +2705,7 @@ void Kart::setOnScreenText(const wchar_t *text)
|
||||
// is started without splash screen (since "Loading" is shown even in this
|
||||
// case). A smaller font would be better
|
||||
|
||||
if (irr_driver->isGLSL())
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
gui::ScalableFont* font = GUIEngine::getFont() ? GUIEngine::getFont() : GUIEngine::getTitleFont();
|
||||
new STKTextBillboard(text, font,
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "config/stk_config.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/lod_node.hpp"
|
||||
#include "graphics/mesh_tools.hpp"
|
||||
@ -343,7 +344,7 @@ scene::ISceneNode* KartModel::attachModel(bool animated_models, bool always_anim
|
||||
|
||||
node = irr_driver->addAnimatedMesh(m_mesh, "kartmesh");
|
||||
// as animated mesh are not cheap to render use frustum box culling
|
||||
if (irr_driver->isGLSL())
|
||||
if (CVS->isGLSL())
|
||||
node->setAutomaticCulling(scene::EAC_OFF);
|
||||
else
|
||||
node->setAutomaticCulling(scene::EAC_FRUSTUM_BOX);
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "guiengine/widgets/spinner_widget.hpp"
|
||||
#include "states_screens/options_screen_video.hpp"
|
||||
#include "utils/translation.hpp"
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
|
||||
#include <IGUIEnvironment.h>
|
||||
@ -84,7 +85,7 @@ void CustomVideoSettingsDialog::beforeAddingWidgets()
|
||||
shadows->addLabel(_("Disabled")); // 0
|
||||
shadows->addLabel(_("low")); // 1
|
||||
shadows->addLabel(_("high")); // 2
|
||||
if (!irr_driver->needUBOWorkaround())
|
||||
if (CVS->supportsShadows())
|
||||
shadows->setValue(UserConfigParams::m_shadows);
|
||||
else
|
||||
shadows->setValue(0);
|
||||
@ -96,7 +97,7 @@ void CustomVideoSettingsDialog::beforeAddingWidgets()
|
||||
getWidget<CheckBoxWidget>("glow")->setState(UserConfigParams::m_glow);
|
||||
getWidget<CheckBoxWidget>("ssao")->setState(UserConfigParams::m_ssao);
|
||||
getWidget<CheckBoxWidget>("bloom")->setState(UserConfigParams::m_bloom);
|
||||
if (irr_driver->supportTextureCompression())
|
||||
if (CVS->isEXTTextureCompressionS3TCUsable())
|
||||
{
|
||||
getWidget<CheckBoxWidget>("texture_compression")->setState(UserConfigParams::m_texture_compression);
|
||||
}
|
||||
@ -107,7 +108,7 @@ void CustomVideoSettingsDialog::beforeAddingWidgets()
|
||||
cb_tex_cmp->setDeactivated();
|
||||
}
|
||||
|
||||
if (!irr_driver->supportGeometryShader())
|
||||
if (!CVS->supportsGlobalIllumination())
|
||||
{
|
||||
shadows->setDeactivated();
|
||||
getWidget<CheckBoxWidget>("global_illumination")->setDeactivated();
|
||||
@ -129,7 +130,7 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s
|
||||
UserConfigParams::m_motionblur =
|
||||
advanced_pipeline && getWidget<CheckBoxWidget>("motionblur")->getState();
|
||||
|
||||
if (advanced_pipeline && irr_driver->supportGeometryShader())
|
||||
if (advanced_pipeline && CVS->supportsShadows())
|
||||
{
|
||||
UserConfigParams::m_shadows =
|
||||
getWidget<SpinnerWidget>("shadows")->getValue();
|
||||
@ -149,7 +150,7 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s
|
||||
advanced_pipeline && getWidget<CheckBoxWidget>("lightshaft")->getState();
|
||||
|
||||
UserConfigParams::m_gi =
|
||||
advanced_pipeline && irr_driver->supportGeometryShader() &&
|
||||
advanced_pipeline && CVS->supportsGlobalIllumination() &&
|
||||
getWidget<CheckBoxWidget>("global_illumination")->getState();
|
||||
|
||||
UserConfigParams::m_glow =
|
||||
@ -244,7 +245,7 @@ void CustomVideoSettingsDialog::updateActivation()
|
||||
getWidget<CheckBoxWidget>("bloom")->setDeactivated();
|
||||
}
|
||||
|
||||
if (!irr_driver->supportGeometryShader())
|
||||
if (!CVS->supportsShadows() && !CVS->supportsGlobalIllumination())
|
||||
{
|
||||
getWidget<SpinnerWidget>("shadows")->setDeactivated();
|
||||
getWidget<CheckBoxWidget>("global_illumination")->setDeactivated();
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
#include <IMesh.h>
|
||||
#include <ICameraSceneNode.h>
|
||||
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/callbacks.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
@ -992,7 +992,7 @@ void QuadGraph::makeMiniMap(const core::dimension2du &dimension,
|
||||
|
||||
RTT* newRttProvider = NULL;
|
||||
IrrDriver::RTTProvider* oldRttProvider = NULL;
|
||||
if (irr_driver->isGLSL())
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
m_new_rtt = newRttProvider = new RTT(dimension.Width, dimension.Height);
|
||||
}
|
||||
@ -1079,7 +1079,7 @@ void QuadGraph::makeMiniMap(const core::dimension2du &dimension,
|
||||
video::ITexture* texture = NULL;
|
||||
FrameBuffer* frame_buffer = NULL;
|
||||
|
||||
if (irr_driver->isGLSL())
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
frame_buffer = newRttProvider->render(camera, GUIEngine::getLatestDt());
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "config/user_config.hpp"
|
||||
#include "graphics/camera.hpp"
|
||||
#include "graphics/CBatchingMesh.hpp"
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "graphics/glwrap.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
#include "graphics/lod_node.hpp"
|
||||
@ -1129,7 +1130,7 @@ bool Track::loadMainTrack(const XMLNode &root)
|
||||
|
||||
assert(GUIEngine::getHighresDigitFont() != NULL);
|
||||
|
||||
if (irr_driver->isGLSL())
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
gui::ScalableFont* font = GUIEngine::getHighresDigitFont();
|
||||
STKTextBillboard* tb = new STKTextBillboard(msg.c_str(), font,
|
||||
@ -1765,7 +1766,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
|
||||
// It's important to execute this BEFORE the code that creates the skycube,
|
||||
// otherwise the skycube node could be modified to have fog enabled, which
|
||||
// we don't want
|
||||
if (m_use_fog && !UserConfigParams::m_camera_debug && !irr_driver->isGLSL())
|
||||
if (m_use_fog && !UserConfigParams::m_camera_debug && !CVS->isGLSL())
|
||||
{
|
||||
/* NOTE: if LINEAR type, density does not matter, if EXP or EXP2, start
|
||||
and end do not matter */
|
||||
@ -1839,7 +1840,7 @@ void Track::loadTrackModel(bool reverse_track, unsigned int mode_id)
|
||||
const video::SColorf tmpf(m_sun_diffuse_color);
|
||||
m_sun = irr_driver->addLight(m_sun_position, 0., 0., tmpf.r, tmpf.g, tmpf.b, true);
|
||||
|
||||
if (!irr_driver->isGLSL())
|
||||
if (!CVS->isGLSL())
|
||||
{
|
||||
scene::ILightSceneNode *sun = (scene::ILightSceneNode *) m_sun;
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
#include "tracks/track_object_presentation.hpp"
|
||||
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "audio/sfx_base.hpp"
|
||||
#include "audio/sfx_buffer.hpp"
|
||||
#include "challenges/unlock_manager.hpp"
|
||||
@ -777,7 +777,7 @@ TrackObjectPresentationLight::TrackObjectPresentationLight(const XMLNode& xml_no
|
||||
m_distance = 20.f * m_energy;
|
||||
xml_node.get("distance", &m_distance);
|
||||
|
||||
if (irr_driver->isGLSL())
|
||||
if (CVS->isGLSL())
|
||||
{
|
||||
m_node = irr_driver->addLight(m_init_xyz, m_energy, m_distance, colorf.r, colorf.g, colorf.b, false, parent);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user