Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finishing touches #478

Merged
merged 3 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion OVP/D3D9Client/AtmoControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ ScatterParams::ScatterParams() :
wboost ( 0.0 ),
zcolor (1.0f, 1.0f, 0.9f),
hcolor (1.0f, 0.7f, 0.0f),
acolor (0.9f, 0.9f, 1.0f)
acolor (0.9f, 0.9f, 1.0f),
suni (1.0)
{
}

Expand Down
2 changes: 1 addition & 1 deletion OVP/D3D9Client/D3D9TextMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ D3D9Text::D3D9Text(LPDIRECT3DDEVICE9 pDevice) :
rotation (),
scaling (1.0f),
charset (ANSI_CHARSET),
first (32),
first (0),
halign (),
valign (),
pDev (pDevice),
Expand Down
23 changes: 23 additions & 0 deletions OVP/D3D9Client/Mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1927,10 +1927,21 @@ void D3D9Mesh::Render(const LPD3DXMATRIX pW, int iTech, LPDIRECT3DCUBETEXTURE9 *
pDev->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW);
}

DWORD dwMSAA;

if (bOIT) {
pDev->GetRenderState(D3DRS_MULTISAMPLEANTIALIAS, &dwMSAA);
pDev->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, 0);
}

pDev->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, Grp[g].VertOff, 0, Grp[g].nVert, Grp[g].IdexOff, Grp[g].nFace);

Grp[g].bRendered = true;

if (bOIT && dwMSAA) {
pDev->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, dwMSAA);
}

if (Grp[g].bDualSided) {
pDev->SetRenderState(D3DRS_ZWRITEENABLE, 1);
}
Expand Down Expand Up @@ -2189,8 +2200,20 @@ void D3D9Mesh::RenderSimplified(const LPD3DXMATRIX pW, LPDIRECT3DCUBETEXTURE9 *p
// Start rendering -------------------------------------------------------------------------------------------
//
FX->CommitChanges();

DWORD dwMSAA = 0;

if (bOIT) {
pDev->GetRenderState(D3DRS_MULTISAMPLEANTIALIAS, &dwMSAA);
pDev->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, 0);
}

pDev->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, Grp[g].VertOff, 0, Grp[g].nVert, Grp[g].IdexOff, Grp[g].nFace);
Grp[g].bRendered = true;

if (bOIT && dwMSAA) {
pDev->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, dwMSAA);
}
}

if (CurrentShader != 0xFFFF) HR(FX->EndPass());
Expand Down
2 changes: 1 addition & 1 deletion OVP/D3D9Client/VPlanet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ bool vPlanet::Render(LPDIRECT3DDEVICE9 dev)

SetupEclipse();

if (surfmgr2 && scn->GetRenderPass() == RENDERPASS_MAINSCENE) UpdateScatter();
if (scn->GetRenderPass() == RENDERPASS_MAINSCENE) UpdateScatter();

if (ringmgr) {
ringmgr->Render(dev, mWorld, false);
Expand Down
2 changes: 1 addition & 1 deletion OVP/D3D9Client/VPlanetAtmo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ void vPlanet::UpdateScatter()

dwSctFrame = scn->GetFrameId();

if (HasAtmosphere())
if (HasAtmosphere() && surfmgr2)
{
if (!pSunColor) D3DXCreateTexture(pDev, 4*Qc, Qc/2, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A16B16G16R16F, D3DPOOL_DEFAULT, &pSunColor);
if (!pRaySkyView) D3DXCreateTexture(pDev, Qc * 2, Qc, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A16B16G16R16F, D3DPOOL_DEFAULT, &pRaySkyView);
Expand Down
Loading