mirror of https://github.com/aap/librw.git
stencil clear
This commit is contained in:
parent
8c00f787cb
commit
5ef54dcb78
|
@ -1170,6 +1170,8 @@ clearCamera(Camera *cam, RGBA *col, uint32 mode)
|
||||||
mode |= D3DCLEAR_TARGET;
|
mode |= D3DCLEAR_TARGET;
|
||||||
if(mode & Camera::CLEARZ)
|
if(mode & Camera::CLEARZ)
|
||||||
mode |= D3DCLEAR_ZBUFFER;
|
mode |= D3DCLEAR_ZBUFFER;
|
||||||
|
if(mode & Camera::CLEARSTENCIL)
|
||||||
|
mode |= D3DCLEAR_STENCIL;
|
||||||
D3DCOLOR c = D3DCOLOR_RGBA(col->red, col->green, col->blue, col->alpha);
|
D3DCOLOR c = D3DCOLOR_RGBA(col->red, col->green, col->blue, col->alpha);
|
||||||
|
|
||||||
RECT r;
|
RECT r;
|
||||||
|
|
|
@ -273,6 +273,8 @@ int32 lightingCB_Shader(Atomic *atomic);
|
||||||
// for VS
|
// for VS
|
||||||
void uploadMatrices(void); // no world transform
|
void uploadMatrices(void); // no world transform
|
||||||
void uploadMatrices(Matrix *worldMat);
|
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
|
int32 uploadLights(WorldLights *lightData); // called by lightingCB_Shader
|
||||||
|
|
||||||
extern void *im2dOverridePS;
|
extern void *im2dOverridePS;
|
||||||
|
|
|
@ -1206,6 +1206,8 @@ clearCamera(Camera *cam, RGBA *col, uint32 mode)
|
||||||
mask |= GL_COLOR_BUFFER_BIT;
|
mask |= GL_COLOR_BUFFER_BIT;
|
||||||
if(mode & Camera::CLEARZ)
|
if(mode & Camera::CLEARZ)
|
||||||
mask |= GL_DEPTH_BUFFER_BIT;
|
mask |= GL_DEPTH_BUFFER_BIT;
|
||||||
|
if(mode & Camera::CLEARSTENCIL)
|
||||||
|
mask |= GL_STENCIL_BUFFER_BIT;
|
||||||
glDepthMask(GL_TRUE);
|
glDepthMask(GL_TRUE);
|
||||||
glClear(mask);
|
glClear(mask);
|
||||||
glDepthMask(rwStateCache.zwrite);
|
glDepthMask(rwStateCache.zwrite);
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
#include "rwgl3impl.h"
|
#include "rwgl3impl.h"
|
||||||
|
|
||||||
|
int renderpassfudge = 2;
|
||||||
|
|
||||||
namespace rw {
|
namespace rw {
|
||||||
namespace gl3 {
|
namespace gl3 {
|
||||||
|
|
||||||
|
@ -65,6 +67,8 @@ drawInst_GSemu(InstanceDataHeader *header, InstanceData *inst)
|
||||||
void
|
void
|
||||||
drawInst(InstanceDataHeader *header, InstanceData *inst)
|
drawInst(InstanceDataHeader *header, InstanceData *inst)
|
||||||
{
|
{
|
||||||
|
if(getAlphaBlend() == renderpassfudge)
|
||||||
|
return;
|
||||||
if(rw::GetRenderState(rw::GSALPHATEST))
|
if(rw::GetRenderState(rw::GSALPHATEST))
|
||||||
drawInst_GSemu(header, inst);
|
drawInst_GSemu(header, inst);
|
||||||
else
|
else
|
||||||
|
|
|
@ -723,7 +723,7 @@ struct Camera
|
||||||
PLUGINBASE
|
PLUGINBASE
|
||||||
enum { ID = 4 };
|
enum { ID = 4 };
|
||||||
enum { PERSPECTIVE = 1, PARALLEL };
|
enum { PERSPECTIVE = 1, PARALLEL };
|
||||||
enum { CLEARIMAGE = 0x1, CLEARZ = 0x2};
|
enum { CLEARIMAGE = 0x1, CLEARZ = 0x2, CLEARSTENCIL = 0x4 };
|
||||||
// return value of frustumTestSphere
|
// return value of frustumTestSphere
|
||||||
enum { SPHEREOUTSIDE, SPHEREBOUNDARY, SPHEREINSIDE };
|
enum { SPHEREOUTSIDE, SPHEREBOUNDARY, SPHEREINSIDE };
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue