DXGL r286 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r285
|
r286
|
r287
>
Date:
01:42, 15 December 2012
Author:
admin
Status:
new
Tags:
Comment:
Adjust shader float-to-int calculation.
Fix DX5 blend state incorrectly enabled on DX6/DX7
Modified paths:
/ddraw/glDirect3DDevice.cpp
(modified) (
history
)
/ddraw/shadergen.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirect3DDevice.cpp
—
—
@@ -57,7 +57,7 @@
58
58
D3DFILTER_NEAREST, //texturemin
59
59
D3DBLEND_ONE, //srcblend
60
60
D3DBLEND_ZERO, //destblend 20
61
- D3DTBLEND_MODULATE, //texturemapblend
61
+ 0, //texturemapblend
62
62
D3DCULL_CCW, //cullmode
63
63
D3DCMP_LESSEQUAL, //zfunc
64
64
0, //alpharef
—
—
@@ -1703,7 +1703,7 @@
1704
1704
SetRenderState(D3DRENDERSTATE_WRAPV,FALSE);
1705
1705
SetRenderState(D3DRENDERSTATE_TEXTUREMAG,D3DFILTER_NEAREST);
1706
1706
SetRenderState(D3DRENDERSTATE_TEXTUREMIN,D3DFILTER_NEAREST);
1707
- //SetRenderState(D3DRENDERSTATE_TEXTUREMAPBLEND,D3DTBLEND_MODULATE);
1707
+ SetRenderState(D3DRENDERSTATE_TEXTUREMAPBLEND,D3DTBLEND_MODULATE);
1708
1708
SetRenderState(D3DRENDERSTATE_SPECULARENABLE,TRUE);
1709
1709
}
1710
1710
Index: ddraw/shadergen.cpp
—
—
@@ -276,7 +276,7 @@
277
277
static const char op_normalpassthru[] = "N = gl_NormalMatrix*nxyz;\n";
278
278
static const char op_passthru[] = "gl_Position = vec4(((xyz.x/rhw)/(width/2.0))-1.0,((xyz.y/rhw)/(height/2.0))-1.0,(xyz.z/rhw),1.0/rhw);\n";
279
279
static const char op_resetcolor[] = "diffuse = specular = vec4(0.0);\n\
280
-ambient = ambientcolor / 255.0;\n";
280
+ambient = ambientcolor / 255.5;\n";
281
281
static const char op_dirlight[] = "DirLight(lightX);\n";
282
282
static const char op_pointlight[] = "PointLight(lightX);\n";
283
283
static const char op_spotlight[] = "SpotLight(lightX);\n";
—
—
@@ -899,22 +899,22 @@
900
900
fsrc->append("discard;\n");
901
901
break;
902
902
case 1:
903
- fsrc->append("if(int(color.a * 255.0) >= alpharef) discard;");
903
+ fsrc->append("if(int(color.a * 255.5) >= alpharef) discard;");
904
904
break;
905
905
case 2:
906
- fsrc->append("if(int(color.a * 255.0) != alpharef) discard;");
906
+ fsrc->append("if(int(color.a * 255.5) != alpharef) discard;");
907
907
break;
908
908
case 3:
909
- fsrc->append("if(int(color.a * 255.0) > alpharef) discard;");
909
+ fsrc->append("if(int(color.a * 255.5) > alpharef) discard;");
910
910
break;
911
911
case 4:
912
- fsrc->append("if(int(color.a * 255.0) <= alpharef) discard;");
912
+ fsrc->append("if(int(color.a * 255.5) <= alpharef) discard;");
913
913
break;
914
914
case 5:
915
- fsrc->append("if(int(color.a * 255.0) == alpharef) discard;");
915
+ fsrc->append("if(int(color.a * 255.5) == alpharef) discard;");
916
916
break;
917
917
case 6:
918
- fsrc->append("if(int(color.a * 255.0) < alpharef) discard;");
918
+ fsrc->append("if(int(color.a * 255.5) < alpharef) discard;");
919
919
break;
920
920
case 7:
921
921
default:
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version