fix: lighting & use lut texture

This commit is contained in:
Samuliak 2024-07-04 09:37:28 +02:00
parent 3e9d2a852c
commit c5bdb28ca1
4 changed files with 65 additions and 19 deletions

View file

@ -105,7 +105,7 @@ inline MTL::PrimitiveType toMTLPrimitiveType(PrimType primType) {
Helpers::warn("Triangle fans are not supported on Metal, using triangles instead");
return MTL::PrimitiveTypeTriangle;
case PrimType::GeometryPrimitive:
Helpers::warn("Geometry primitives are not yet, using triangles instead");
//Helpers::warn("Geometry primitives are not yet, using triangles instead");
return MTL::PrimitiveTypeTriangle;
}
}

View file

@ -46,8 +46,10 @@ class RendererMTL final : public Renderer {
Metal::DepthStencilCache depthStencilCache;
Metal::VertexBufferCache vertexBufferCache;
// Helpers
MTL::SamplerState* basicSampler;
// Objects
MTL::SamplerState* nearestSampler;
MTL::SamplerState* linearSampler;
MTL::Texture* lightLUTTextureArray;
// Pipelines
MTL::RenderPipelineState* displayPipeline;
@ -100,4 +102,5 @@ class RendererMTL final : public Renderer {
Metal::Texture& getTexture(Metal::Texture& tex);
void setupTextureEnvState(MTL::RenderCommandEncoder* encoder);
void bindTexturesToSlots(MTL::RenderCommandEncoder* encoder);
void updateLightingLUT();
};