DXGL r299 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r298
|
r299
|
r300
>
Date:
01:47, 4 January 2013
Author:
admin
Status:
new
Tags:
Comment:
Make vertex fog compile. (still broken)
Modified paths:
/ddraw/shadergen.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/shadergen.cpp
—
—
@@ -1,5 +1,5 @@
2
2
// DXGL
3
-// Copyright (C) 2012 William Feely
3
+// Copyright (C) 2012-2013 William Feely
4
4
5
5
// This library is free software; you can redistribute it and/or
6
6
// modify it under the terms of the GNU Lesser General Public
—
—
@@ -35,7 +35,7 @@
36
36
int current_genshader;
37
37
38
38
/* Bits in Shader ID:
39
-Bits 0-1 - Shading mode: 00=flat 01=gouraud 11=phong 10=flat per-pixel VS/FS
39
+Bits 0-1 - Shading mode: 00=flat 01=gouraud 11=phong 10=flat per-pixel GL/VS/FS
40
40
Bit 2 - Alpha test enable FS
41
41
Bits 3-5 - Alpha test function: FS
42
42
000=never 001=less 010=equal 011=lessequal
—
—
@@ -80,9 +80,9 @@
81
81
Bits 37-38: Texture coordinate flags VS
82
82
Bits 39-40: U Texture address GL
83
83
Bits 41-42: V Texture address GL
84
-Bits 43-45: Texture magnification filter GL/FS
85
-Bits 46-47: Texture minification filter GL/FS
86
-Bits 48-49: Texture mip filter GL/FS
84
+Bits 43-45: Texture magnification filter GL/FS?
85
+Bits 46-47: Texture minification filter GL/FS?
86
+Bits 48-49: Texture mip filter GL/FS?
87
87
Bit 50: Enable texture coordinate transform VS
88
88
Bits 51-52: Number of texcoord dimensions VS
89
89
Bit 53: Projected texcoord VS
—
—
@@ -305,10 +305,10 @@
306
306
static const char op_fogcoordrange[] = "vec4 eyepos = gl_ModelViewMatrix*gl_Vertex;\n\
307
307
vec3 eyepos3 = eyepos.xyz / eyepos.w;\n\
308
308
gl_FragFogCoord = sqrt((eyepos3.x * eyepos3.x) + (eyepos3.y * eyepos3.y) + (eyepos3.z * eyepos3.z));\n";
309
-static const char op_foglinear[] = "fogfactor = (gl_Fog.end - gl_FogFragCoord) / (gl_Fog.end - glFog.start);\n";
310
-static const char op_fogexp[] = "fogfactor = 1 / exp(gl_FogFragCoord * gl_Fog.density);\n";
311
-static const char op_fogexp2[] = "fogfactor = 1 / exp(gl_FogFragCoord * gl_FogFragCoord *\n\
312
-gl_Fog.density * gl_Fog.density)\n";
309
+static const char op_foglinear[] = "fogfactor = (gl_Fog.end - gl_FogFragCoord) / (gl_Fog.end - gl_Fog.start);\n";
310
+static const char op_fogexp[] = "fogfactor = 1.0 / exp(gl_FogFragCoord * gl_Fog.density);\n";
311
+static const char op_fogexp2[] = "fogfactor = 1.0 / exp(gl_FogFragCoord * gl_FogFragCoord *\n\
312
+gl_Fog.density * gl_Fog.density);\n";
313
313
static const char op_fogclamp[] = "fogfactor = clamp(fogfactor,0.0,1.0);\n";
314
314
static const char op_fogblend[] = "color = mix(color,gl_Fog.color,fogfactor);\n";
315
315
—
—
@@ -394,6 +394,7 @@
395
395
int count;
396
396
int numlights;
397
397
int vertexfog,pixelfog;
398
+ vertexfog = pixelfog = 0;
398
399
if((id>>61)&1)
399
400
{
400
401
vertexfog = (id>>8)&3;
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