mirror of https://github.com/xemu-project/xemu.git
nv2a: Scale point sprites by surface scaling factor
This commit is contained in:
parent
52c670141a
commit
5778854dbd
|
@ -3845,6 +3845,8 @@ static void pgraph_bind_shaders(PGRAPHState *pg)
|
|||
ShaderState state;
|
||||
memset(&state, 0, sizeof(ShaderState));
|
||||
|
||||
state.surface_scale_factor = pg->surface_scale_factor;
|
||||
|
||||
state.compressed_attrs = pg->compressed_attrs;
|
||||
|
||||
/* register combiner stuff */
|
||||
|
|
|
@ -663,10 +663,12 @@ GLSL_DEFINE(materialEmissionColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_CM_COL) ".xyz
|
|||
" oPts.x = 1/sqrt(%f + %f*d_e + %f*d_e*d_e) + %f;\n",
|
||||
state.point_params[0], state.point_params[1], state.point_params[2],
|
||||
state.point_params[6]);
|
||||
mstring_append_fmt(body, " oPts.x = min(oPts.x*%f + %f, 64.0);\n",
|
||||
state.point_params[3], state.point_params[7]);
|
||||
mstring_append_fmt(body, " oPts.x = min(oPts.x*%f + %f, 64.0) * %d;\n",
|
||||
state.point_params[3], state.point_params[7],
|
||||
state.surface_scale_factor);
|
||||
} else {
|
||||
mstring_append_fmt(body, " oPts.x = %f;\n", state.point_size);
|
||||
mstring_append_fmt(body, " oPts.x = %f * %d;\n", state.point_size,
|
||||
state.surface_scale_factor);
|
||||
}
|
||||
|
||||
mstring_append(body, " vtx.inv_w = 1.0 / oPos.w;\n");
|
||||
|
|
|
@ -55,6 +55,8 @@ enum MaterialColorSource {
|
|||
};
|
||||
|
||||
typedef struct ShaderState {
|
||||
unsigned int surface_scale_factor;
|
||||
|
||||
PshState psh;
|
||||
uint16_t compressed_attrs;
|
||||
|
||||
|
|
Loading…
Reference in New Issue