MCPcopy Create free account
hub / github.com/NazaraEngine/NazaraEngine / Initialize

Method Initialize

src/Nazara/Graphics/DeferredRenderTechnique.cpp:572–705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

570 */
571
572 bool DeferredRenderTechnique::Initialize()
573 {
574 const char vertexSource_Basic[] =
575 "#version 140\n"
576
577 "in vec3 VertexPosition;\n"
578 "uniform mat4 WorldViewProjMatrix;\n"
579
580 "void main()\n"
581 "{\n"
582 "gl_Position = WorldViewProjMatrix * vec4(VertexPosition, 1.0);\n"
583 "}\n";
584
585 const char vertexSource_PostProcess[] =
586 "#version 140\n"
587
588 "in vec3 VertexPosition;\n"
589
590 "void main()\n"
591 "{\n"
592 "gl_Position = vec4(VertexPosition, 1.0);"
593 "}\n";
594
595 ShaderStage basicVertexStage(ShaderStageType_Vertex);
596 if (!basicVertexStage.IsValid())
597 {
598 NazaraError("Failed to create basic vertex shader");
599 return false;
600 }
601
602 basicVertexStage.SetSource(vertexSource_Basic, sizeof(vertexSource_Basic));
603
604 if (!basicVertexStage.Compile())
605 {
606 NazaraError("Failed to compile basic vertex shader");
607 return false;
608 }
609
610
611 ShaderStage ppVertexStage(ShaderStageType_Vertex);
612 if (!ppVertexStage.IsValid())
613 {
614 NazaraError("Failed to create vertex shader");
615 return false;
616 }
617
618 ppVertexStage.SetSource(vertexSource_PostProcess, sizeof(vertexSource_PostProcess));
619
620 if (!ppVertexStage.Compile())
621 {
622 NazaraError("Failed to compile vertex shader");
623 return false;
624 }
625
626
627 String error;
628 Shader* shader;
629

Callers 1

SetPassMethod · 0.45

Calls 6

RegisterDeferredShaderFunction · 0.85
SetSourceMethod · 0.80
CompileMethod · 0.80
SendIntegerMethod · 0.80
GetUniformLocationMethod · 0.80
IsValidMethod · 0.45

Tested by

no test coverage detected