Fix shadows rendering in reflection probes

This commit is contained in:
Wojtek Figat
2024-07-24 13:43:53 +02:00
parent e9144ff834
commit b2e228c090
4 changed files with 30 additions and 18 deletions

View File

@@ -126,10 +126,10 @@ void RenderBuffers::SetUseAlpha(bool value)
_useAlpha = value;
}
const RenderBuffers::CustomBuffer* RenderBuffers::FindCustomBuffer(const StringView& name) const
const RenderBuffers::CustomBuffer* RenderBuffers::FindCustomBuffer(const StringView& name, bool withLinked) const
{
if (LinkedCustomBuffers)
return LinkedCustomBuffers->FindCustomBuffer(name);
if (LinkedCustomBuffers && withLinked)
return LinkedCustomBuffers->FindCustomBuffer(name, withLinked);
for (const CustomBuffer* e : CustomBuffers)
{
if (e->Name == name)

View File

@@ -167,20 +167,20 @@ public:
/// </summary>
API_PROPERTY() void SetUseAlpha(bool value);
const CustomBuffer* FindCustomBuffer(const StringView& name) const;
const CustomBuffer* FindCustomBuffer(const StringView& name, bool withLinked = true) const;
template<class T>
const T* FindCustomBuffer(const StringView& name) const
const T* FindCustomBuffer(const StringView& name, bool withLinked = true) const
{
return (const T*)FindCustomBuffer(name);
return (const T*)FindCustomBuffer(name, withLinked);
}
template<class T>
T* GetCustomBuffer(const StringView& name)
T* GetCustomBuffer(const StringView& name, bool withLinked = true)
{
if (LinkedCustomBuffers)
return LinkedCustomBuffers->GetCustomBuffer<T>(name);
CustomBuffer* result = (CustomBuffer*)FindCustomBuffer(name);
if (LinkedCustomBuffers && withLinked)
return LinkedCustomBuffers->GetCustomBuffer<T>(name, withLinked);
CustomBuffer* result = (CustomBuffer*)FindCustomBuffer(name, withLinked);
if (!result)
{
result = New<T>();