stencil clear

This commit is contained in:
aap 2020-11-04 16:21:24 +01:00
parent 8c00f787cb
commit 5ef54dcb78
5 changed files with 11 additions and 1 deletions

View File

@ -1170,6 +1170,8 @@ clearCamera(Camera *cam, RGBA *col, uint32 mode)
mode |= D3DCLEAR_TARGET;
if(mode & Camera::CLEARZ)
mode |= D3DCLEAR_ZBUFFER;
if(mode & Camera::CLEARSTENCIL)
mode |= D3DCLEAR_STENCIL;
D3DCOLOR c = D3DCOLOR_RGBA(col->red, col->green, col->blue, col->alpha);
RECT r;

View File

@ -273,6 +273,8 @@ int32 lightingCB_Shader(Atomic *atomic);
// for VS
void uploadMatrices(void); // no world transform
void uploadMatrices(Matrix *worldMat);
void setAmbient(const RGBAf &color);
void setNumLights(int numDir, int numPoint, int numSpot);
int32 uploadLights(WorldLights *lightData); // called by lightingCB_Shader
extern void *im2dOverridePS;

View File

@ -1206,6 +1206,8 @@ clearCamera(Camera *cam, RGBA *col, uint32 mode)
mask |= GL_COLOR_BUFFER_BIT;
if(mode & Camera::CLEARZ)
mask |= GL_DEPTH_BUFFER_BIT;
if(mode & Camera::CLEARSTENCIL)
mask |= GL_STENCIL_BUFFER_BIT;
glDepthMask(GL_TRUE);
glClear(mask);
glDepthMask(rwStateCache.zwrite);

View File

@ -16,6 +16,8 @@
#include "rwgl3impl.h"
int renderpassfudge = 2;
namespace rw {
namespace gl3 {
@ -65,6 +67,8 @@ drawInst_GSemu(InstanceDataHeader *header, InstanceData *inst)
void
drawInst(InstanceDataHeader *header, InstanceData *inst)
{
if(getAlphaBlend() == renderpassfudge)
return;
if(rw::GetRenderState(rw::GSALPHATEST))
drawInst_GSemu(header, inst);
else

View File

@ -723,7 +723,7 @@ struct Camera
PLUGINBASE
enum { ID = 4 };
enum { PERSPECTIVE = 1, PARALLEL };
enum { CLEARIMAGE = 0x1, CLEARZ = 0x2};
enum { CLEARIMAGE = 0x1, CLEARZ = 0x2, CLEARSTENCIL = 0x4 };
// return value of frustumTestSphere
enum { SPHEREOUTSIDE, SPHEREBOUNDARY, SPHEREINSIDE };