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

Method Bind

Source/Engine/Renderer/Editor/LODPreview.cpp:45–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45void LODPreviewMaterialShader::Bind(BindParameters& params)
46{
47 // Find the LOD that produced this draw call
48 int32 lodIndex = 0;
49 auto& drawCall = *params.DrawCall;
50 const ModelLOD* drawCallModelLod;
51 if (GBufferPass::IndexBufferToModelLOD.TryGet(drawCall.Geometry.IndexBuffer, drawCallModelLod))
52 {
53 lodIndex = drawCallModelLod->GetLODIndex();
54 }
55
56 // Bind
57 const Color colors[MODEL_MAX_LODS] = {
58 Color::White,
59 Color::Red,
60 Color::Orange,
61 Color::Yellow,
62 Color::Green,
63 Color::Blue,
64 };
65 const Color color(colors[lodIndex]);
66 _material->SetParameterValue(TEXT("Color"), Variant(color));
67 _material->Bind(params);
68}
69
70#endif

Callers 10

RunPostFxPassMethod · 0.45
RunMaterialPostFxPassMethod · 0.45
ExecuteDrawCallsMethod · 0.45
InitAtmospherePreComputeFunction · 0.45
RenderMethod · 0.45
DrawPostFxMaterialMethod · 0.45
DrawDecalsMethod · 0.45
GenerateFunction · 0.45
RenderMethod · 0.45
DrawBatchFunction · 0.45

Calls 3

VariantFunction · 0.50
TryGetMethod · 0.45
SetParameterValueMethod · 0.45

Tested by

no test coverage detected