Index: ddraw/glDirect3D.cpp |
— | — | @@ -35,7 +35,8 @@ |
36 | 36 | { //dpcLineCaps
|
37 | 37 | sizeof(D3DPRIMCAPS),
|
38 | 38 | D3DPMISCCAPS_CULLCCW | D3DPMISCCAPS_CULLCW | D3DPMISCCAPS_CULLNONE, // dwMiscCaps
|
39 | | - D3DPRASTERCAPS_SUBPIXEL | D3DPRASTERCAPS_ZTEST, //dwRasterCaps
|
| 39 | + D3DPRASTERCAPS_SUBPIXEL | D3DPRASTERCAPS_ZTEST | D3DPRASTERCAPS_FOGRANGE | D3DPRASTERCAPS_FOGTABLE |
|
| 40 | + D3DPRASTERCAPS_FOGVERTEX, //dwRasterCaps
|
40 | 41 | D3DPCMPCAPS_LESSEQUAL, //dwZCmpCaps
|
41 | 42 | D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR | D3DPBLENDCAPS_INVSRCCOLOR |
|
42 | 43 | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA | D3DPBLENDCAPS_DESTALPHA |
|
— | — | @@ -47,7 +48,7 @@ |
48 | 49 | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA | D3DPBLENDCAPS_BOTHINVSRCALPHA, //dwDestBlendCaps
|
49 | 50 | D3DPCMPCAPS_ALWAYS | D3DPCMPCAPS_EQUAL | D3DPCMPCAPS_GREATER | D3DPCMPCAPS_GREATEREQUAL |
|
50 | 51 | D3DPCMPCAPS_LESS | D3DPCMPCAPS_LESSEQUAL | D3DPCMPCAPS_NEVER | D3DPCMPCAPS_NOTEQUAL, //dwAlphaCmpCaps
|
51 | | - D3DPSHADECAPS_ALPHAGOURAUDBLEND | D3DPSHADECAPS_COLORGOURAUDRGB, //dwShadeCaps
|
| 52 | + D3DPSHADECAPS_ALPHAGOURAUDBLEND | D3DPSHADECAPS_COLORGOURAUDRGB | D3DPSHADECAPS_FOGGOURAUD, //dwShadeCaps
|
52 | 53 | D3DPTEXTURECAPS_ALPHA | D3DPTEXTURECAPS_PERSPECTIVE, //dwTextureCaps
|
53 | 54 | D3DPTFILTERCAPS_NEAREST | D3DPTFILTERCAPS_LINEAR | D3DPTFILTERCAPS_MIPNEAREST |
|
54 | 55 | D3DPTFILTERCAPS_MIPLINEAR | D3DPTFILTERCAPS_LINEARMIPNEAREST | D3DPTFILTERCAPS_LINEARMIPLINEAR |
|
— | — | @@ -63,7 +64,8 @@ |
64 | 65 | { //dpcTriCaps
|
65 | 66 | sizeof(D3DPRIMCAPS),
|
66 | 67 | D3DPMISCCAPS_CULLCCW | D3DPMISCCAPS_CULLCW | D3DPMISCCAPS_CULLNONE, // dwMiscCaps
|
67 | | - D3DPRASTERCAPS_SUBPIXEL | D3DPRASTERCAPS_ZTEST, //dwRasterCaps
|
| 68 | + D3DPRASTERCAPS_SUBPIXEL | D3DPRASTERCAPS_ZTEST | D3DPRASTERCAPS_FOGRANGE | D3DPRASTERCAPS_FOGTABLE |
|
| 69 | + D3DPRASTERCAPS_FOGVERTEX, //dwRasterCaps
|
68 | 70 | D3DPCMPCAPS_LESSEQUAL, //dwZCmpCaps
|
69 | 71 | D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR | D3DPBLENDCAPS_INVSRCCOLOR |
|
70 | 72 | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA | D3DPBLENDCAPS_DESTALPHA |
|
— | — | @@ -75,7 +77,7 @@ |
76 | 78 | D3DPBLENDCAPS_SRCALPHASAT | D3DPBLENDCAPS_BOTHSRCALPHA | D3DPBLENDCAPS_BOTHINVSRCALPHA, //dwDestBlendCaps
|
77 | 79 | D3DPCMPCAPS_ALWAYS | D3DPCMPCAPS_EQUAL | D3DPCMPCAPS_GREATER | D3DPCMPCAPS_GREATEREQUAL |
|
78 | 80 | D3DPCMPCAPS_LESS | D3DPCMPCAPS_LESSEQUAL | D3DPCMPCAPS_NEVER | D3DPCMPCAPS_NOTEQUAL, //dwAlphaCmpCaps
|
79 | | - D3DPSHADECAPS_ALPHAGOURAUDBLEND | D3DPSHADECAPS_COLORGOURAUDRGB, //dwShadeCaps
|
| 81 | + D3DPSHADECAPS_ALPHAGOURAUDBLEND | D3DPSHADECAPS_COLORGOURAUDRGB | D3DPSHADECAPS_FOGGOURAUD, //dwShadeCaps
|
80 | 82 | D3DPTEXTURECAPS_ALPHA | D3DPTEXTURECAPS_PERSPECTIVE, //dwTextureCaps
|
81 | 83 | D3DPTFILTERCAPS_NEAREST | D3DPTFILTERCAPS_LINEAR | D3DPTFILTERCAPS_MIPNEAREST |
|
82 | 84 | D3DPTFILTERCAPS_MIPLINEAR | D3DPTFILTERCAPS_LINEARMIPNEAREST | D3DPTFILTERCAPS_LINEARMIPLINEAR |
|
— | — | @@ -116,7 +118,7 @@ |
117 | 119 | IID_IDirect3DHALDevice, //deviceGUID
|
118 | 120 | 0, //wMaxUserClipPlanes
|
119 | 121 | 0, //wMaxVertexBlendMatrices
|
120 | | - D3DVTXPCAPS_DIRECTIONALLIGHTS|D3DVTXPCAPS_POSITIONALLIGHTS, //dwVertexProcessingCaps
|
| 122 | + D3DVTXPCAPS_DIRECTIONALLIGHTS|D3DVTXPCAPS_POSITIONALLIGHTS|D3DVTXPCAPS_VERTEXFOG, //dwVertexProcessingCaps
|
121 | 123 | 0,0,0,0 //dwReserved1 through dwReserved4
|
122 | 124 | };
|
123 | 125 |
|
Index: ddraw/shadergen.cpp |
— | — | @@ -315,6 +315,7 @@ |
316 | 316 | gl_Fog.density * gl_Fog.density);\n";
|
317 | 317 | static const char op_fogclamp[] = "fogfactor = clamp(fogfactor,0.0,1.0);\n";
|
318 | 318 | static const char op_fogblend[] = "color = mix(gl_Fog.color,color,fogfactor);\n";
|
| 319 | +static const char op_fogassign[] = "color = gl_Fog.color;\n";
|
319 | 320 |
|
320 | 321 | // Functions
|
321 | 322 | static const char func_dirlight[] = "void DirLight(in Light light)\n\
|
— | — | @@ -1015,6 +1016,7 @@ |
1016 | 1017 | fsrc->append(op_fogclamp);
|
1017 | 1018 | fsrc->append(op_fogblend);
|
1018 | 1019 | }
|
| 1020 | + if(((id>>61)&1) && !vertexfog && !pixelfog) fsrc->append(op_fogassign);
|
1019 | 1021 | fsrc->append(op_colorfragout);
|
1020 | 1022 | fsrc->append(mainend);
|
1021 | 1023 | #ifdef _DEBUG
|