DXGL r112 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r111‎ | r112 | r113 >
Date:21:58, 4 March 2012
Author:admin
Status:new
Tags:
Comment:
Get basic transforms working in D3D. Remember, matrix multiplication is NOT commutative.
Modified paths:
  • /Help/configuration.htm (modified) (history)
  • /ddraw/glRenderer.cpp (modified) (history)
  • /ddraw/shadergen.cpp (modified) (history)

Diff [purge]

Index: Help/configuration.htm
@@ -62,7 +62,7 @@
6363 If checked, adds additional, mostly low resolution, display modes to the list generated by IDirectDraw::EnumDisplayModes. Only works if
6464 "Video mode" is not set to "Change desktop resolution."
6565 <h2><a name="alldepths" />Support All Color Depths</h2>
66 - If checked, adds 8, 15, 16, 24, and 32-bit color modes if not listed by the system. Windows Developer Preview (Windows 8) users should check this box.
 66+ If checked, adds 8, 15, 16, 24, and 32-bit color modes if not listed by the system. Windows 8 users should check this box.
6767 <h2><a name="scaler" />Scaling method</h2>
6868 Selects the filter to use for scaling the output when the resolution is different than the desktop resolution,
6969 as well as for blitting operations. The following methods are available:
Index: ddraw/glRenderer.cpp
@@ -1169,7 +1169,7 @@
11701170 loc = glGetUniformLocation(prog,"view");
11711171 glUniformMatrix4fv(loc,1,false,device->matView);
11721172 loc = glGetUniformLocation(prog,"projection");
1173 - glUniformMatrix4fv(loc,1,true,device->matProjection);
 1173+ glUniformMatrix4fv(loc,1,false,device->matProjection);
11741174 loc = glGetUniformLocation(prog,"normalmat");
11751175 glUniformMatrix4fv(loc,1,true,device->matNormal);
11761176 loc = glGetUniformLocation(prog,"material.diffuse");
Index: ddraw/shadergen.cpp
@@ -222,8 +222,8 @@
223223 static const char var_color[] = "vec4 color;\n";
224224 static const char var_xyzw[] = "vec4 xyzw;\n";
225225 // Operations
226 -static const char op_transform[] = "xyzw = vec4(xyz[0],xyz[1],xyz[2],1);\n\
227 -gl_Position = ((world*view)*projection)*xyzw;\n";
 226+static const char op_transform[] = "xyzw = vec4(xyz,1);\n\
 227+gl_Position = (projection*(view*world))*xyzw;\n";
228228 static const char op_passthru[] = "gl_Position = xyzw;\n";
229229 static const char op_resetcolor[] = "diffuse = specular = ambient = vec4(0.0);\n";
230230 static const char op_dirlight[] = "DirLight(lightX);\n";
@@ -231,8 +231,8 @@
232232 static const char op_colorout[] = "vec4 color = (material.diffuse * diffuse) + (material.ambient * ambient) + \n\
233233 (material.specular * specular) + material.emissive;\n\
234234 gl_FrontColor = color;\n";
235 -static const char op_colorfragout[] = "gl_FragColor = color;";
236 -static const char op_fragpassthru[] = "color = gl_Color;";
 235+static const char op_colorfragout[] = "gl_FragColor = color;\n";
 236+static const char op_fragpassthru[] = "color = gl_Color;\n";
237237
238238 // Functions
239239 static const char func_dirlight[] = "void DirLight(in Light light)\n\