mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 14:30:35 +02:00
Merge pull request #4018 from samcake/temp0
Moving the shaders used in Model.cpp from resources folder into the built-in executable
This commit is contained in:
commit
860098585c
17 changed files with 304 additions and 307 deletions
|
@ -36,7 +36,25 @@
|
|||
#include "Model.h"
|
||||
|
||||
#include "model_vert.h"
|
||||
#include "model_shadow_vert.h"
|
||||
#include "model_normal_map_vert.h"
|
||||
#include "model_lightmap_vert.h"
|
||||
#include "model_lightmap_normal_map_vert.h"
|
||||
#include "skin_model_vert.h"
|
||||
#include "skin_model_shadow_vert.h"
|
||||
#include "skin_model_normal_map_vert.h"
|
||||
|
||||
#include "model_frag.h"
|
||||
#include "model_shadow_frag.h"
|
||||
#include "model_normal_map_frag.h"
|
||||
#include "model_normal_specular_map_frag.h"
|
||||
#include "model_specular_map_frag.h"
|
||||
#include "model_lightmap_frag.h"
|
||||
#include "model_lightmap_normal_map_frag.h"
|
||||
#include "model_lightmap_normal_specular_map_frag.h"
|
||||
#include "model_lightmap_specular_map_frag.h"
|
||||
#include "model_translucent_frag.h"
|
||||
|
||||
|
||||
#define GLBATCH( call ) batch._##call
|
||||
//#define GLBATCH( call ) call
|
||||
|
@ -237,106 +255,69 @@ void Model::init() {
|
|||
if (!_program.isLinked()) {
|
||||
_program.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
|
||||
_program.addShaderFromSourceCode(QGLShader::Fragment, model_frag);
|
||||
|
||||
initProgram(_program, _locations);
|
||||
|
||||
_normalMapProgram.addShaderFromSourceFile(QGLShader::Vertex,
|
||||
PathUtils::resourcesPath() + "shaders/model_normal_map.vert");
|
||||
_normalMapProgram.addShaderFromSourceFile(QGLShader::Fragment,
|
||||
PathUtils::resourcesPath() + "shaders/model_normal_map.frag");
|
||||
|
||||
_normalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_normal_map_vert);
|
||||
_normalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_map_frag);
|
||||
initProgram(_normalMapProgram, _normalMapLocations);
|
||||
|
||||
_specularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
|
||||
_specularMapProgram.addShaderFromSourceFile(QGLShader::Fragment,
|
||||
PathUtils::resourcesPath() + "shaders/model_specular_map.frag");
|
||||
|
||||
_specularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_specular_map_frag);
|
||||
initProgram(_specularMapProgram, _specularMapLocations);
|
||||
|
||||
_normalSpecularMapProgram.addShaderFromSourceFile(QGLShader::Vertex,
|
||||
PathUtils::resourcesPath() + "shaders/model_normal_map.vert");
|
||||
_normalSpecularMapProgram.addShaderFromSourceFile(QGLShader::Fragment,
|
||||
PathUtils::resourcesPath() + "shaders/model_normal_specular_map.frag");
|
||||
|
||||
_normalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_normal_map_vert);
|
||||
_normalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_specular_map_frag);
|
||||
initProgram(_normalSpecularMapProgram, _normalSpecularMapLocations);
|
||||
|
||||
_translucentProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
|
||||
_translucentProgram.addShaderFromSourceFile(QGLShader::Fragment,
|
||||
PathUtils::resourcesPath() + "shaders/model_translucent.frag");
|
||||
|
||||
_translucentProgram.addShaderFromSourceCode(QGLShader::Fragment, model_translucent_frag);
|
||||
initProgram(_translucentProgram, _translucentLocations);
|
||||
|
||||
// Lightmap
|
||||
_lightmapProgram.addShaderFromSourceFile(QGLShader::Vertex, PathUtils::resourcesPath() + "shaders/model_lightmap.vert");
|
||||
_lightmapProgram.addShaderFromSourceFile(QGLShader::Fragment, PathUtils::resourcesPath() + "shaders/model_lightmap.frag");
|
||||
|
||||
_lightmapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_vert);
|
||||
_lightmapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_frag);
|
||||
initProgram(_lightmapProgram, _lightmapLocations);
|
||||
|
||||
_lightmapNormalMapProgram.addShaderFromSourceFile(QGLShader::Vertex,
|
||||
PathUtils::resourcesPath() + "shaders/model_lightmap_normal_map.vert");
|
||||
_lightmapNormalMapProgram.addShaderFromSourceFile(QGLShader::Fragment,
|
||||
PathUtils::resourcesPath() + "shaders/model_lightmap_normal_map.frag");
|
||||
|
||||
_lightmapNormalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_normal_map_vert);
|
||||
_lightmapNormalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_normal_map_frag);
|
||||
initProgram(_lightmapNormalMapProgram, _lightmapNormalMapLocations);
|
||||
|
||||
_lightmapSpecularMapProgram.addShaderFromSourceFile(QGLShader::Vertex,
|
||||
PathUtils::resourcesPath() + "shaders/model_lightmap.vert");
|
||||
_lightmapSpecularMapProgram.addShaderFromSourceFile(QGLShader::Fragment,
|
||||
PathUtils::resourcesPath() + "shaders/model_lightmap_specular_map.frag");
|
||||
|
||||
_lightmapSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_vert);
|
||||
_lightmapSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_specular_map_frag);
|
||||
initProgram(_lightmapSpecularMapProgram, _lightmapSpecularMapLocations);
|
||||
|
||||
_lightmapNormalSpecularMapProgram.addShaderFromSourceFile(QGLShader::Vertex,
|
||||
PathUtils::resourcesPath() + "shaders/model_lightmap_normal_map.vert");
|
||||
_lightmapNormalSpecularMapProgram.addShaderFromSourceFile(QGLShader::Fragment,
|
||||
PathUtils::resourcesPath() + "shaders/model_lightmap_normal_specular_map.frag");
|
||||
|
||||
_lightmapNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_lightmap_normal_map_vert);
|
||||
_lightmapNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_lightmap_normal_specular_map_frag);
|
||||
initProgram(_lightmapNormalSpecularMapProgram, _lightmapNormalSpecularMapLocations);
|
||||
// end lightmap
|
||||
|
||||
|
||||
_shadowProgram.addShaderFromSourceFile(QGLShader::Vertex, PathUtils::resourcesPath() + "shaders/model_shadow.vert");
|
||||
_shadowProgram.addShaderFromSourceFile(QGLShader::Fragment,
|
||||
PathUtils::resourcesPath() + "shaders/model_shadow.frag");
|
||||
_shadowProgram.addShaderFromSourceCode(QGLShader::Vertex, model_shadow_vert);
|
||||
_shadowProgram.addShaderFromSourceCode(QGLShader::Fragment, model_shadow_frag);
|
||||
|
||||
_skinProgram.addShaderFromSourceFile(QGLShader::Vertex, PathUtils::resourcesPath() + "shaders/skin_model.vert");
|
||||
_skinProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_vert);
|
||||
_skinProgram.addShaderFromSourceCode(QGLShader::Fragment, model_frag);
|
||||
|
||||
initSkinProgram(_skinProgram, _skinLocations);
|
||||
|
||||
_skinNormalMapProgram.addShaderFromSourceFile(QGLShader::Vertex,
|
||||
PathUtils::resourcesPath() + "shaders/skin_model_normal_map.vert");
|
||||
_skinNormalMapProgram.addShaderFromSourceFile(QGLShader::Fragment,
|
||||
PathUtils::resourcesPath() + "shaders/model_normal_map.frag");
|
||||
|
||||
_skinNormalMapProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_normal_map_vert);
|
||||
_skinNormalMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_map_frag);
|
||||
initSkinProgram(_skinNormalMapProgram, _skinNormalMapLocations);
|
||||
|
||||
_skinSpecularMapProgram.addShaderFromSourceFile(QGLShader::Vertex,
|
||||
PathUtils::resourcesPath() + "shaders/skin_model.vert");
|
||||
_skinSpecularMapProgram.addShaderFromSourceFile(QGLShader::Fragment,
|
||||
PathUtils::resourcesPath() + "shaders/model_specular_map.frag");
|
||||
|
||||
_skinSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, model_vert);
|
||||
_skinSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_specular_map_frag);
|
||||
initSkinProgram(_skinSpecularMapProgram, _skinSpecularMapLocations);
|
||||
|
||||
_skinNormalSpecularMapProgram.addShaderFromSourceFile(QGLShader::Vertex,
|
||||
PathUtils::resourcesPath() + "shaders/skin_model_normal_map.vert");
|
||||
_skinNormalSpecularMapProgram.addShaderFromSourceFile(QGLShader::Fragment,
|
||||
PathUtils::resourcesPath() + "shaders/model_normal_specular_map.frag");
|
||||
|
||||
_skinNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_normal_map_vert);
|
||||
_skinNormalSpecularMapProgram.addShaderFromSourceCode(QGLShader::Fragment, model_normal_specular_map_frag);
|
||||
initSkinProgram(_skinNormalSpecularMapProgram, _skinNormalSpecularMapLocations);
|
||||
|
||||
_skinShadowProgram.addShaderFromSourceFile(QGLShader::Vertex,
|
||||
PathUtils::resourcesPath() + "shaders/skin_model_shadow.vert");
|
||||
_skinShadowProgram.addShaderFromSourceFile(QGLShader::Fragment,
|
||||
PathUtils::resourcesPath() + "shaders/model_shadow.frag");
|
||||
|
||||
_skinShadowProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_shadow_vert);
|
||||
_skinShadowProgram.addShaderFromSourceCode(QGLShader::Fragment, model_shadow_frag);
|
||||
initSkinProgram(_skinShadowProgram, _skinShadowLocations);
|
||||
|
||||
_skinTranslucentProgram.addShaderFromSourceFile(QGLShader::Vertex,
|
||||
PathUtils::resourcesPath() + "shaders/skin_model.vert");
|
||||
_skinTranslucentProgram.addShaderFromSourceFile(QGLShader::Fragment,
|
||||
PathUtils::resourcesPath() + "shaders/model_translucent.frag");
|
||||
|
||||
_skinTranslucentProgram.addShaderFromSourceCode(QGLShader::Vertex, skin_model_vert);
|
||||
_skinTranslucentProgram.addShaderFromSourceCode(QGLShader::Fragment, model_translucent_frag);
|
||||
initSkinProgram(_skinTranslucentProgram, _skinTranslucentLocations);
|
||||
}
|
||||
}
|
||||
|
|
5
interface/resources/shaders/model_lightmap.frag → libraries/render-utils/src/model_lightmap.slf
Normal file → Executable file
5
interface/resources/shaders/model_lightmap.frag → libraries/render-utils/src/model_lightmap.slf
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_lightmap.frag
|
||||
// fragment shader
|
5
interface/resources/shaders/model_lightmap.vert → libraries/render-utils/src/model_lightmap.slv
Normal file → Executable file
5
interface/resources/shaders/model_lightmap.vert → libraries/render-utils/src/model_lightmap.slv
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_lightmap.vert
|
||||
// vertex shader
|
5
interface/resources/shaders/model_lightmap_normal_map.frag → libraries/render-utils/src/model_lightmap_normal_map.slf
Normal file → Executable file
5
interface/resources/shaders/model_lightmap_normal_map.frag → libraries/render-utils/src/model_lightmap_normal_map.slf
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_lightmap_normal_map.frag
|
||||
// fragment shader
|
5
interface/resources/shaders/model_lightmap_normal_map.vert → libraries/render-utils/src/model_lightmap_normal_map.slv
Normal file → Executable file
5
interface/resources/shaders/model_lightmap_normal_map.vert → libraries/render-utils/src/model_lightmap_normal_map.slv
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_lightmap_normal_map.vert
|
||||
// vertex shader
|
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_lightmap_normal_specular_map.frag
|
||||
// fragment shader
|
5
interface/resources/shaders/model_lightmap_specular_map.frag → libraries/render-utils/src/model_lightmap_specular_map.slf
Normal file → Executable file
5
interface/resources/shaders/model_lightmap_specular_map.frag → libraries/render-utils/src/model_lightmap_specular_map.slf
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_lightmap_specular_map.frag
|
||||
// fragment shader
|
5
interface/resources/shaders/model_normal_map.frag → libraries/render-utils/src/model_normal_map.slf
Normal file → Executable file
5
interface/resources/shaders/model_normal_map.frag → libraries/render-utils/src/model_normal_map.slf
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_normal_map.frag
|
||||
// fragment shader
|
5
interface/resources/shaders/model_normal_map.vert → libraries/render-utils/src/model_normal_map.slv
Normal file → Executable file
5
interface/resources/shaders/model_normal_map.vert → libraries/render-utils/src/model_normal_map.slv
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model.vert
|
||||
// vertex shader
|
5
interface/resources/shaders/model_normal_specular_map.frag → libraries/render-utils/src/model_normal_specular_map.slf
Normal file → Executable file
5
interface/resources/shaders/model_normal_specular_map.frag → libraries/render-utils/src/model_normal_specular_map.slf
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_normal_specular_map.frag
|
||||
// fragment shader
|
5
interface/resources/shaders/model_shadow.frag → libraries/render-utils/src/model_shadow.slf
Normal file → Executable file
5
interface/resources/shaders/model_shadow.frag → libraries/render-utils/src/model_shadow.slf
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_shadow.frag
|
||||
// fragment shader
|
5
interface/resources/shaders/model_shadow.vert → libraries/render-utils/src/model_shadow.slv
Normal file → Executable file
5
interface/resources/shaders/model_shadow.vert → libraries/render-utils/src/model_shadow.slv
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_shadow.vert
|
||||
// vertex shader
|
5
interface/resources/shaders/model_specular_map.frag → libraries/render-utils/src/model_specular_map.slf
Normal file → Executable file
5
interface/resources/shaders/model_specular_map.frag → libraries/render-utils/src/model_specular_map.slf
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_specular_map.frag
|
||||
// fragment shader
|
5
interface/resources/shaders/model_translucent.frag → libraries/render-utils/src/model_translucent.slf
Normal file → Executable file
5
interface/resources/shaders/model_translucent.frag → libraries/render-utils/src/model_translucent.slf
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// model_translucent.frag
|
||||
// fragment shader
|
5
interface/resources/shaders/skin_model.vert → libraries/render-utils/src/skin_model.slv
Normal file → Executable file
5
interface/resources/shaders/skin_model.vert → libraries/render-utils/src/skin_model.slv
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// skin_model.vert
|
||||
// vertex shader
|
5
interface/resources/shaders/skin_model_normal_map.vert → libraries/render-utils/src/skin_model_normal_map.slv
Normal file → Executable file
5
interface/resources/shaders/skin_model_normal_map.vert → libraries/render-utils/src/skin_model_normal_map.slv
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// skin_model_normal_map.vert
|
||||
// vertex shader
|
5
interface/resources/shaders/skin_model_shadow.vert → libraries/render-utils/src/skin_model_shadow.slv
Normal file → Executable file
5
interface/resources/shaders/skin_model_shadow.vert → libraries/render-utils/src/skin_model_shadow.slv
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
|||
#version 120
|
||||
|
||||
<@include Config.slh@>
|
||||
<$VERSION_HEADER$>
|
||||
// Generated on <$_SCRIBE_DATE$>
|
||||
//
|
||||
// skin_model_shadow.vert
|
||||
// vertex shader
|
Loading…
Reference in a new issue