Esempio n. 1
0
// 描画.
void UnityChanApp::RenderInternal(izanagi::graph::CGraphicsDevice* device)
{
    izanagi::sample::CSampleCamera& camera = GetCamera();

    // シェーダパラメータセット
    {
        const izanagi::math::SMatrix44& mtxW2C = camera.GetParam().mtxW2C;
        _SetShaderParam(m_Shd, "g_mW2C", &mtxW2C, sizeof(mtxW2C));
    }

    // 描画
    m_RenderGraph->Render(
        device,
        m_Renderer,
        m_MdlRenderHandler);


    if (device->Begin2D()) {
        izanagi::CDebugFont* debugFont = GetDebugFont();
        debugFont->Begin(device, 0, izanagi::CDebugFont::FONT_SIZE * 2);

        IZ_FLOAT t = m_Timeline.GetTime();

        debugFont->DBPrint(
            device,
            "(%s) [%.3f] \n",
            anmFileName[posAnm], t);

        debugFont->End();

        device->End2D();
    }
}
Esempio n. 2
0
void Settings::SetDebugFont(QFont font)
{
  if (GetDebugFont() != font)
  {
    GetQSettings().setValue(QStringLiteral("debugger/font"), font);

    emit DebugFontChanged(font);
  }
}
Esempio n. 3
0
// 描画.
void CSampleRunner::RenderInternal(izanagi::graph::CGraphicsDevice* device)
{
    izanagi::CDebugFont* debugFont = GetDebugFont();

    device->Begin2D();

    debugFont->Begin(device);

    IZ_UINT cursorPos = 0;

    debugFont->DBPrint(
        device,
        CursorLeft + Column * m_ColumnIdx,
        Top + Size * m_RowIdx + Diff,
        0xffffffff,
        ">");

    for (IZ_UINT y = 0; y < m_InfoList.size(); y++) {
        for (IZ_UINT i = 0; i < Range; i++) {
            IZ_UINT idx = y * Range + i;

            if (idx >= m_InfoNum) {
                break;
            }

            const ExeInfo& info = m_InfoList[y][i];

            debugFont->DBPrint(
                device,
                Left + Column * y,
                Top + Size * i + Diff,
                0xffffffff,
                "%s",
                info.tag.c_str());
        }
    }

    debugFont->End();

    device->End2D();
}
Esempio n. 4
0
// 描画.
void FoveatedRenderingApp::RenderInternal(izanagi::graph::CGraphicsDevice* device)
{
    if (m_canFoveated) {
        FoveatedRender(device);
    }
    else {
        DefaultRender(device);
    }

    if (device->Begin2D()) {
        izanagi::CDebugFont* debugFont = GetDebugFont();

        debugFont->Begin(device, 0, izanagi::CDebugFont::FONT_SIZE * 2);

        debugFont->DBPrint(
            device,
            "%s\n",
            m_canFoveated ? "Foveated" : "Default");

        debugFont->End();

        device->End2D();
    }
}
Esempio n. 5
0
// 描画.
void StereoCameraApp::RenderInternal(izanagi::graph::CGraphicsDevice* device)
{
    izanagi::sample::CSampleCamera& camera = GetCamera();

    static IZ_INT texIdx[] = {
        1,
        3,
        4,
    };

    static IZ_CHAR* name[] = {
        "Cube",
        "Latitude-Longitude",
        "Angular",
    };

    device->SetRenderState(
        izanagi::graph::E_GRAPH_RS_CULLMODE,
        izanagi::graph::E_GRAPH_CULL_NONE);

    device->SetTexture(0, m_Img->GetTexture(texIdx[m_Idx]));

    device->SetShaderProgram(m_shd);

    auto hL2W = m_shd->GetHandleByName("g_mL2W");
    m_shd->SetMatrix(device, hL2W, m_L2W);

#if 1
    izanagi::HmdInfo info;
    izanagi::FovPort fov;

    // a typical DK1 half-FOV is 46 degrees inwards, 53 degrees outwards
    // https://developer.oculusvr.com/forums/viewtopic.php?p=111699#p111699

    // Left
    {
        izanagi::StereoCamera::setFov(
            izanagi::StereoCamera::Eye::Left,
            46, 53,
            90,
            fov);

        device->SetViewport(
            izanagi::graph::SViewport(
            0, 0,
            SCREEN_WIDTH / 2, SCREEN_HEIGHT));

        izanagi::CVectorCamera cameraL;

        izanagi::StereoCamera::getCamera(
            izanagi::StereoCamera::Eye::Left,
            info,
            fov,
            cameraL,
            camera);

        auto mtxW2C = cameraL.GetParam().mtxW2C;

        auto hW2C = m_shd->GetHandleByName("g_mW2C");
        m_shd->SetMatrix(device, hW2C, mtxW2C);

        auto hEye = m_shd->GetHandleByName("g_vEye");
        m_shd->SetVector(device, hEye, cameraL.GetParam().pos);

        m_Cube->Render(device);
    }

    // Right
    {
        izanagi::StereoCamera::setFov(
            izanagi::StereoCamera::Eye::Right,
            46, 53,
            90,
            fov);

        device->SetViewport(
            izanagi::graph::SViewport(
            SCREEN_WIDTH / 2, 0,
            SCREEN_WIDTH / 2, SCREEN_HEIGHT));

        izanagi::CVectorCamera cameraR;

        izanagi::StereoCamera::getCamera(
            izanagi::StereoCamera::Eye::Right,
            info,
            fov,
            cameraR,
            camera);

        auto mtxW2C = cameraR.GetParam().mtxW2C;

        auto hW2C = m_shd->GetHandleByName("g_mW2C");
        m_shd->SetMatrix(device, hW2C, mtxW2C);

        auto hEye = m_shd->GetHandleByName("g_vEye");
        m_shd->SetVector(device, hEye, cameraR.GetParam().pos);

        m_Cube->Render(device);
    }

    device->SetViewport(
        izanagi::graph::SViewport(
        0, 0,
        SCREEN_WIDTH, SCREEN_HEIGHT));
#else
    auto mtxW2C = camera.GetParam().mtxW2C;

    auto hW2C = m_shd->GetHandleByName("g_mW2C");
    m_shd->SetMatrix(device, hW2C, mtxW2C);

    auto hEye = m_shd->GetHandleByName("g_vEye");
    m_shd->SetVector(device, hEye, camera.GetParam().pos);

    m_Cube->Render(device);
#endif

    if (device->Begin2D()) {
        izanagi::CDebugFont* debugFont = GetDebugFont();

        debugFont->Begin(device, 0, izanagi::CDebugFont::FONT_SIZE * 2);

        debugFont->DBPrint(
            device, 
            "%s\n",
            name[m_Idx]);

        debugFont->End();

        device->End2D();
    }
}