INNER CODE UNIT · C++

MipLevel

DiligentGraphics/DiligentFX · Components/src/EnvMapRenderer.cpp:291

    const float        MipLevel        = std::max(0.f, std::min(Attribs.MipLevel, MipCount - 1.f));
    const float        SphereMapWidth  = std::max(std::floor(static_cast<float>(EnvMapDesc.Width) * Attribs.SphereMapUVScaleBias.x + 0.5f), 1.f);
    const float        SphereMapHeight = std::max(std::floor(static_cast<float>(EnvMapDesc.Height) * Attribs.SphereMapUVScaleBias.y + 0.5f), 1.f);
    const float2       EnvironmentRotation{std::cos(Attribs.Yaw), std::sin(Attribs.Yaw)};

    if (m_ShaderAttribs)
    {
        if (std::memcmp(&m_ShaderAttribs->ToneMapping, &ToneMapping, sizeof(ToneMapping)) != 0 ||
            m_ShaderAttribs->AverageLogLum != Attribs.AverageLogLum ||
            m_ShaderAttribs->MipLevel != MipLevel ||
            m_ShaderAttribs->Alpha != Attribs.Alpha ||
            m_ShaderAttribs->Scale != float4{Attribs.Scale, 1} ||
            m_ShaderAttribs->SphereMapUVScaleBias != Attribs.SphereMapUVScaleBias ||
            m_ShaderAttribs->SphereMapSlice != Attribs.SphereMapSlice ||
            m_ShaderAttribs->SphereMapRow0IsNegativeY != static_cast<Int32>(Attribs.SphereMapRow0IsNegativeY) ||
            m_ShaderAttribs->SphereMapWidth != SphereMapWidth ||
            m_ShaderAttribs->SphereMapHeight != SphereMapHeight ||
            m_ShaderAttribs->EnvMapMipCount != MipCount ||

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…