mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
ref_soft: Remove R_ConcatTransform, try fix transparent bmodels origin
This commit is contained in:
parent
25860f6263
commit
6879c1f097
33
r_bsp.c
33
r_bsp.c
@ -48,6 +48,35 @@ static mvertex_t *pfrontenter, *pfrontexit;
|
|||||||
static qboolean makeclippededge;
|
static qboolean makeclippededge;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
================
|
||||||
|
R_ConcatRotations
|
||||||
|
================
|
||||||
|
*/
|
||||||
|
void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3])
|
||||||
|
{
|
||||||
|
out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] +
|
||||||
|
in1[0][2] * in2[2][0];
|
||||||
|
out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] +
|
||||||
|
in1[0][2] * in2[2][1];
|
||||||
|
out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] +
|
||||||
|
in1[0][2] * in2[2][2];
|
||||||
|
out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] +
|
||||||
|
in1[1][2] * in2[2][0];
|
||||||
|
out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] +
|
||||||
|
in1[1][2] * in2[2][1];
|
||||||
|
out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] +
|
||||||
|
in1[1][2] * in2[2][2];
|
||||||
|
out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] +
|
||||||
|
in1[2][2] * in2[2][0];
|
||||||
|
out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] +
|
||||||
|
in1[2][2] * in2[2][1];
|
||||||
|
out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] +
|
||||||
|
in1[2][2] * in2[2][2];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -952,7 +981,7 @@ void R_DrawBrushModel(cl_entity_t *pent)
|
|||||||
|
|
||||||
if (pmodel->nummodelsurfaces == 0)
|
if (pmodel->nummodelsurfaces == 0)
|
||||||
return; // clip brush only
|
return; // clip brush only
|
||||||
#if 0
|
#if 1
|
||||||
// FIXME: use bounding-box-based frustum clipping info?
|
// FIXME: use bounding-box-based frustum clipping info?
|
||||||
RotatedBBox (pmodel->mins, pmodel->maxs,
|
RotatedBBox (pmodel->mins, pmodel->maxs,
|
||||||
RI.currententity->angles, mins, maxs);
|
RI.currententity->angles, mins, maxs);
|
||||||
@ -969,6 +998,7 @@ void R_DrawBrushModel(cl_entity_t *pent)
|
|||||||
VectorCopy (RI.currententity->origin, r_entorigin);
|
VectorCopy (RI.currententity->origin, r_entorigin);
|
||||||
VectorSubtract (r_origin, r_entorigin, modelorg);
|
VectorSubtract (r_origin, r_entorigin, modelorg);
|
||||||
//VectorSubtract (r_origin, RI.currententity->origin, modelorg);
|
//VectorSubtract (r_origin, RI.currententity->origin, modelorg);
|
||||||
|
|
||||||
r_pcurrentvertbase = pmodel->vertexes;
|
r_pcurrentvertbase = pmodel->vertexes;
|
||||||
|
|
||||||
// calculate dynamic lighting for bmodel
|
// calculate dynamic lighting for bmodel
|
||||||
@ -989,6 +1019,7 @@ void R_DrawBrushModel(cl_entity_t *pent)
|
|||||||
#endif
|
#endif
|
||||||
psurf = &pmodel->surfaces[pmodel->firstmodelsurface];
|
psurf = &pmodel->surfaces[pmodel->firstmodelsurface];
|
||||||
numsurfaces = pmodel->nummodelsurfaces;
|
numsurfaces = pmodel->nummodelsurfaces;
|
||||||
|
//R_TransformFrustum ();
|
||||||
|
|
||||||
for (i=0 ; i<numsurfaces ; i++, psurf++)
|
for (i=0 ; i<numsurfaces ; i++, psurf++)
|
||||||
{
|
{
|
||||||
|
@ -1308,11 +1308,6 @@ void D_FlushCaches( qboolean newmap );
|
|||||||
//
|
//
|
||||||
void Draw_Fill (int x, int y, int w, int h, int c);
|
void Draw_Fill (int x, int y, int w, int h, int c);
|
||||||
|
|
||||||
//
|
|
||||||
// r_main.c
|
|
||||||
//
|
|
||||||
void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// r_misc.c
|
// r_misc.c
|
||||||
//
|
//
|
||||||
@ -1329,8 +1324,6 @@ void R_RenderFace (msurface_t *fa, int clipflags);
|
|||||||
//
|
//
|
||||||
// r_main.c
|
// r_main.c
|
||||||
//
|
//
|
||||||
void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]);
|
|
||||||
|
|
||||||
|
|
||||||
void R_RenderTriangle( finalvert_t *fv1 , finalvert_t *fv2, finalvert_t *fv3 );
|
void R_RenderTriangle( finalvert_t *fv1 , finalvert_t *fv2, finalvert_t *fv3 );
|
||||||
void R_SetupFinalVert( finalvert_t *fv, float x, float y, float z, int light, int s, int t );
|
void R_SetupFinalVert( finalvert_t *fv, float x, float y, float z, int light, int s, int t );
|
||||||
|
65
r_main.c
65
r_main.c
@ -139,68 +139,6 @@ int r_numallocatededges;
|
|||||||
|
|
||||||
float r_aliasuvscale = 1.0;
|
float r_aliasuvscale = 1.0;
|
||||||
|
|
||||||
/*
|
|
||||||
================
|
|
||||||
R_ConcatRotations
|
|
||||||
================
|
|
||||||
*/
|
|
||||||
void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3])
|
|
||||||
{
|
|
||||||
out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] +
|
|
||||||
in1[0][2] * in2[2][0];
|
|
||||||
out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] +
|
|
||||||
in1[0][2] * in2[2][1];
|
|
||||||
out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] +
|
|
||||||
in1[0][2] * in2[2][2];
|
|
||||||
out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] +
|
|
||||||
in1[1][2] * in2[2][0];
|
|
||||||
out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] +
|
|
||||||
in1[1][2] * in2[2][1];
|
|
||||||
out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] +
|
|
||||||
in1[1][2] * in2[2][2];
|
|
||||||
out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] +
|
|
||||||
in1[2][2] * in2[2][0];
|
|
||||||
out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] +
|
|
||||||
in1[2][2] * in2[2][1];
|
|
||||||
out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] +
|
|
||||||
in1[2][2] * in2[2][2];
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
================
|
|
||||||
R_ConcatTransforms
|
|
||||||
================
|
|
||||||
*/
|
|
||||||
void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4])
|
|
||||||
{
|
|
||||||
out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] +
|
|
||||||
in1[0][2] * in2[2][0];
|
|
||||||
out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] +
|
|
||||||
in1[0][2] * in2[2][1];
|
|
||||||
out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] +
|
|
||||||
in1[0][2] * in2[2][2];
|
|
||||||
out[0][3] = in1[0][0] * in2[0][3] + in1[0][1] * in2[1][3] +
|
|
||||||
in1[0][2] * in2[2][3] + in1[0][3];
|
|
||||||
out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] +
|
|
||||||
in1[1][2] * in2[2][0];
|
|
||||||
out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] +
|
|
||||||
in1[1][2] * in2[2][1];
|
|
||||||
out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] +
|
|
||||||
in1[1][2] * in2[2][2];
|
|
||||||
out[1][3] = in1[1][0] * in2[0][3] + in1[1][1] * in2[1][3] +
|
|
||||||
in1[1][2] * in2[2][3] + in1[1][3];
|
|
||||||
out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] +
|
|
||||||
in1[2][2] * in2[2][0];
|
|
||||||
out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] +
|
|
||||||
in1[2][2] * in2[2][1];
|
|
||||||
out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] +
|
|
||||||
in1[2][2] * in2[2][2];
|
|
||||||
out[2][3] = in1[2][0] * in2[0][3] + in1[2][1] * in2[1][3] +
|
|
||||||
in1[2][2] * in2[2][3] + in1[2][3];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int R_RankForRenderMode( int rendermode )
|
static int R_RankForRenderMode( int rendermode )
|
||||||
{
|
{
|
||||||
switch( rendermode )
|
switch( rendermode )
|
||||||
@ -1743,6 +1681,9 @@ void R_BeginFrame( qboolean clearScene )
|
|||||||
// GL_RebuildLightmaps();
|
// GL_RebuildLightmaps();
|
||||||
D_FlushCaches( false );
|
D_FlushCaches( false );
|
||||||
//glConfig.softwareGammaUpdate = false;
|
//glConfig.softwareGammaUpdate = false;
|
||||||
|
// next frame will be restored gamma
|
||||||
|
ClearBits( vid_brightness->flags, FCVAR_CHANGED );
|
||||||
|
ClearBits( vid_gamma->flags, FCVAR_CHANGED );
|
||||||
}
|
}
|
||||||
|
|
||||||
R_Set2DMode( true );
|
R_Set2DMode( true );
|
||||||
|
5
r_poly.c
5
r_poly.c
@ -1057,13 +1057,14 @@ void R_BuildPolygonFromSurface(msurface_t *fa)
|
|||||||
vec = RI.currentmodel->vertexes[r_pedge->v[1]].position;
|
vec = RI.currentmodel->vertexes[r_pedge->v[1]].position;
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorCopy (vec, pverts[i] );
|
VectorAdd (vec, r_entorigin, pverts[i] );
|
||||||
|
//VectorCopy( vec, pverts[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorCopy( fa->texinfo->vecs[0], r_polydesc.vright );
|
VectorCopy( fa->texinfo->vecs[0], r_polydesc.vright );
|
||||||
VectorCopy( fa->texinfo->vecs[1], r_polydesc.vup );
|
VectorCopy( fa->texinfo->vecs[1], r_polydesc.vup );
|
||||||
VectorCopy( fa->plane->normal, r_polydesc.vpn );
|
VectorCopy( fa->plane->normal, r_polydesc.vpn );
|
||||||
VectorCopy( r_origin, r_polydesc.viewer_position );
|
VectorCopy( modelorg, r_polydesc.viewer_position );
|
||||||
|
|
||||||
|
|
||||||
if ( fa->flags & SURF_PLANEBACK )
|
if ( fa->flags & SURF_PLANEBACK )
|
||||||
|
@ -122,7 +122,8 @@ void R_SetUpWorldTransform (void)
|
|||||||
|
|
||||||
// memcpy( aliasworldtransform, rotationmatrix, sizeof( aliastransform ) );
|
// memcpy( aliasworldtransform, rotationmatrix, sizeof( aliastransform ) );
|
||||||
|
|
||||||
R_ConcatTransforms (viewmatrix, aliasworldtransform, aliastransform);
|
//R_ConcatTransforms (viewmatrix, aliasworldtransform, aliastransform);
|
||||||
|
Matrix3x4_ConcatTransforms(aliastransform, viewmatrix, aliasworldtransform );
|
||||||
|
|
||||||
aliasworldtransform[0][3] = 0;
|
aliasworldtransform[0][3] = 0;
|
||||||
aliasworldtransform[1][3] = 0;
|
aliasworldtransform[1][3] = 0;
|
||||||
@ -194,7 +195,8 @@ void R_AliasSetUpTransform (void)
|
|||||||
|
|
||||||
// memcpy( aliasworldtransform, rotationmatrix, sizeof( aliastransform ) );
|
// memcpy( aliasworldtransform, rotationmatrix, sizeof( aliastransform ) );
|
||||||
|
|
||||||
R_ConcatTransforms (viewmatrix, aliasworldtransform, aliastransform);
|
//R_ConcatTransforms (viewmatrix, aliasworldtransform, aliastransform);
|
||||||
|
Matrix3x4_ConcatTransforms(aliastransform, viewmatrix, aliasworldtransform );
|
||||||
|
|
||||||
aliasworldtransform[0][3] = RI.currententity->origin[0];
|
aliasworldtransform[0][3] = RI.currententity->origin[0];
|
||||||
aliasworldtransform[1][3] = RI.currententity->origin[1];
|
aliasworldtransform[1][3] = RI.currententity->origin[1];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user