MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Draw

Method Draw

Source/Engine/Level/Actors/Sky.cpp:86–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void Sky::Draw(RenderContext& renderContext)
87{
88 if (HasContentLoaded() && EnumHasAnyFlags(renderContext.View.Flags, ViewFlags::Sky))
89 {
90 // Ensure to have pipeline state cache created
91 if (_psSky == nullptr)
92 {
93 const auto shader = _shader->GetShader();
94
95 // Create pipeline states
96 if (_psSky == nullptr)
97 {
98 _psSky = GPUDevice::Instance->CreatePipelineState();
99
100 GPUPipelineState::Description psDesc = GPUPipelineState::Description::Default;
101 psDesc.VS = shader->GetVS("VS");
102 psDesc.PS = shader->GetPS("PS_Sky");
103 psDesc.CullMode = CullMode::Inverted;
104 psDesc.DepthWriteEnable = false;
105 psDesc.DepthClipEnable = false;
106 psDesc.DepthFunc = ComparisonFunc::LessEqual;
107
108 if (_psSky->Init(psDesc))
109 {
110 LOG(Warning, "Cannot create graphics pipeline state object for '{0}'.", ToString());
111 }
112 }
113 }
114
115 // Register for the sky and fog pass
116 renderContext.List->Sky = this;
117 //if(renderContext.View.Flags & ViewFlags::Fog) != 0)
118 //renderContext.List->AtmosphericFog = this; // TODO: finish atmosphere fog
119 }
120}
121
122void Sky::Serialize(SerializeStream& stream, const void* otherObj)
123{

Callers

nothing calls this directly

Calls 6

EnumHasAnyFlagsFunction · 0.85
ToStringFunction · 0.50
GetShaderMethod · 0.45
CreatePipelineStateMethod · 0.45
GetPSMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected