Do not build shadow shader without gs support.
This commit is contained in:
parent
ae3cf30070
commit
f3e2da881a
@ -137,6 +137,8 @@ RTT::RTT()
|
||||
drv->setRenderTarget(0, false, false);
|
||||
|
||||
drv->endScene();
|
||||
if (irr_driver->getGLSLVersion() < 150)
|
||||
return;
|
||||
glGenFramebuffers(1, &shadowFBO);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, shadowFBO);
|
||||
glGenTextures(1, &shadowColorTex);
|
||||
|
@ -1001,6 +1001,12 @@ namespace MeshShader
|
||||
|
||||
void ShadowShader::init()
|
||||
{
|
||||
// Geometry shader needed
|
||||
if (irr_driver->getGLSLVersion() < 150)
|
||||
{
|
||||
attrib_position = -1;
|
||||
return;
|
||||
}
|
||||
Program = LoadProgram(file_manager->getAsset("shaders/shadow.vert").c_str(), file_manager->getAsset("shaders/shadow.geom").c_str(), file_manager->getAsset("shaders/white.frag").c_str());
|
||||
attrib_position = glGetAttribLocation(Program, "Position");
|
||||
uniform_MVP = glGetUniformLocation(Program, "ModelViewProjectionMatrix");
|
||||
@ -1025,6 +1031,13 @@ namespace MeshShader
|
||||
|
||||
void RefShadowShader::init()
|
||||
{
|
||||
// Geometry shader needed
|
||||
if (irr_driver->getGLSLVersion() < 150)
|
||||
{
|
||||
attrib_position = -1;
|
||||
attrib_texcoord = -1;
|
||||
return;
|
||||
}
|
||||
Program = LoadProgram(file_manager->getAsset("shaders/shadow.vert").c_str(), file_manager->getAsset("shaders/shadow.geom").c_str(), file_manager->getAsset("shaders/object_unlit.frag").c_str());
|
||||
attrib_position = glGetAttribLocation(Program, "Position");
|
||||
attrib_texcoord = glGetAttribLocation(Program, "Texcoord");
|
||||
|
@ -55,6 +55,8 @@ TransparentMaterial MaterialTypeToTransparentMaterial(video::E_MATERIAL_TYPE typ
|
||||
|
||||
GLuint createVAO(GLuint vbo, GLuint idx, GLuint attrib_position, GLuint attrib_texcoord, GLuint attrib_second_texcoord, GLuint attrib_normal, GLuint attrib_tangent, GLuint attrib_bitangent, GLuint attrib_color, size_t stride)
|
||||
{
|
||||
if (attrib_position == -1)
|
||||
return 0;
|
||||
GLuint vao;
|
||||
glGenVertexArrays(1, &vao);
|
||||
glBindVertexArray(vao);
|
||||
|
Loading…
x
Reference in New Issue
Block a user