mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
GPU: Generate normals for curves with lighting.
Improves #12354. This needs to happen even if the vertex has no normals.
This commit is contained in:
parent
9e7625c74b
commit
cba6a63058
@ -73,10 +73,6 @@ void ComputeVertexShaderID(VShaderID *id_out, u32 vertType, bool useHWTransform)
|
||||
|
||||
bool doBezier = gstate_c.bezier;
|
||||
bool doSpline = gstate_c.spline;
|
||||
// These are the original vertType's values (normalized will always have colors, etc.)
|
||||
bool hasColorTess = (gstate.vertType & GE_VTYPE_COL_MASK) != 0 && (doBezier || doSpline);
|
||||
bool hasTexcoordTess = (gstate.vertType & GE_VTYPE_TC_MASK) != 0 && (doBezier || doSpline);
|
||||
bool hasNormalTess = (gstate.vertType & GE_VTYPE_NRM_MASK) != 0 && (doBezier || doSpline);
|
||||
|
||||
bool enableFog = gstate.isFogEnabled() && !isModeThrough && !gstate.isModeClear();
|
||||
bool lmode = gstate.isUsingSecondaryColor() && gstate.isLightingEnabled() && !isModeThrough;
|
||||
@ -138,9 +134,12 @@ void ComputeVertexShaderID(VShaderID *id_out, u32 vertType, bool useHWTransform)
|
||||
if (g_Config.bHardwareTessellation) {
|
||||
id.SetBit(VS_BIT_BEZIER, doBezier);
|
||||
id.SetBit(VS_BIT_SPLINE, doSpline);
|
||||
id.SetBit(VS_BIT_HAS_COLOR_TESS, hasColorTess);
|
||||
id.SetBit(VS_BIT_HAS_TEXCOORD_TESS, hasTexcoordTess);
|
||||
id.SetBit(VS_BIT_HAS_NORMAL_TESS, hasNormalTess);
|
||||
if (doBezier || doSpline) {
|
||||
// These are the original vertType's values (normalized will always have colors, etc.)
|
||||
id.SetBit(VS_BIT_HAS_COLOR_TESS, (gstate.vertType & GE_VTYPE_COL_MASK) != 0);
|
||||
id.SetBit(VS_BIT_HAS_TEXCOORD_TESS, (gstate.vertType & GE_VTYPE_TC_MASK) != 0);
|
||||
id.SetBit(VS_BIT_HAS_NORMAL_TESS, (gstate.vertType & GE_VTYPE_NRM_MASK) != 0 || gstate.isLightingEnabled());
|
||||
}
|
||||
id.SetBit(VS_BIT_NORM_REVERSE_TESS, gstate.isPatchNormalsReversed());
|
||||
}
|
||||
}
|
||||
|
@ -403,6 +403,7 @@ public:
|
||||
vert.nrm *= -1.0f;
|
||||
} else {
|
||||
vert.nrm.SetZero();
|
||||
vert.nrm.z = 1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -417,7 +418,7 @@ public:
|
||||
|
||||
static void Tessellate(OutputBuffers &output, const Surface &surface, const ControlPoints &points, const Weight2D &weights, u32 origVertType) {
|
||||
const bool params[] = {
|
||||
(origVertType & GE_VTYPE_NRM_MASK) != 0,
|
||||
(origVertType & GE_VTYPE_NRM_MASK) != 0 || gstate.isLightingEnabled(),
|
||||
(origVertType & GE_VTYPE_COL_MASK) != 0,
|
||||
(origVertType & GE_VTYPE_TC_MASK) != 0,
|
||||
cpu_info.bSSE4_1,
|
||||
|
Loading…
Reference in New Issue
Block a user