Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
bc449ca3
Commit
bc449ca3
authored
Aug 28, 2006
by
Stefan Dösinger
Committed by
Alexandre Julliard
Aug 29, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Apply the half pixel correction for shaders too.
parent
20d98e81
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
7 deletions
+28
-7
vertexshader.c
dlls/wined3d/vertexshader.c
+28
-7
No files found.
dlls/wined3d/vertexshader.c
View file @
bc449ca3
...
...
@@ -735,8 +735,18 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
}
/* Write the final position.
* Account for any inverted textures (render to texture case) by reversing the y coordinate
* (this is handled in drawPrim() when it sets the MODELVIEW and PROJECTION matrices) */
*
* OpenGL coordinates specify the center of the pixel while d3d coords specify
* the corner. For that reason a translation is done with the projection matrix,
* which sets the offsets to move in the w coords of the matrix(see glTranslate manpage)
* Add the w coordinates to x and y, this avoids the need for a full matrix
* multiplication. The matrix is set up in drawprim.c, primitiveInitState.
*/
shader_addline
(
&
buffer
,
"gl_Position.x = gl_Position.x + gl_ProjectionMatrix[3][0];
\n
"
);
shader_addline
(
&
buffer
,
"gl_Position.y = gl_Position.y + gl_ProjectionMatrix[3][1];
\n
"
);
/* Account for any inverted textures (render to texture case) by reversing the y coordinate
* (this is handled in drawPrim() when it sets the MODELVIEW and PROJECTION matrices)
*/
shader_addline
(
&
buffer
,
"gl_Position.y = gl_Position.y * gl_ProjectionMatrix[1][1];
\n
"
);
shader_addline
(
&
buffer
,
"}
\n\0
"
);
...
...
@@ -763,7 +773,8 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
shader_generate_arb_declarations
(
(
IWineD3DBaseShader
*
)
This
,
reg_maps
,
&
buffer
,
&
GLINFO_LOCATION
);
/* We need the projection matrix to correctly render upside-down objects (render to texture) */
shader_addline
(
&
buffer
,
"PARAM PROJECTION = state.matrix.projection.row[1];
\n
"
);
shader_addline
(
&
buffer
,
"PARAM PROJECTIONX = state.matrix.projection.row[0];
\n
"
);
shader_addline
(
&
buffer
,
"PARAM PROJECTIONY = state.matrix.projection.row[1];
\n
"
);
if
(
reg_maps
->
fog
)
{
This
->
usesFog
=
1
;
...
...
@@ -777,11 +788,21 @@ static VOID IWineD3DVertexShaderImpl_GenerateShader(
if
(
reg_maps
->
fog
)
shader_addline
(
&
buffer
,
"MAX result.fogcoord, TMP_FOG, 0.0;
\n
"
);
/* Write the final position.
* Account for any inverted textures (render to texture case) by reversing the y coordinate
* (this is handled in drawPrim() when it sets the MODELVIEW and PROJECTION matrices) */
shader_addline
(
&
buffer
,
"MOV result.position, TMP_OUT;
\n
"
);
shader_addline
(
&
buffer
,
"MUL result.position.y, TMP_OUT.y, PROJECTION.y;
\n
"
);
/* Write the final position.
*
* OpenGL coordinates specify the center of the pixel while d3d coords specify
* the corner. For that reason a translation is done with the projection matrix,
* which sets the offsets to move in the w coords of the matrix(see glTranslate manpage)
* Add the w coordinates to x and y, this avoids the need for a full matrix
* multiplication. The matrix is set up in drawprim.c, primitiveInitState.
*/
shader_addline
(
&
buffer
,
"ADD result.position.x, TMP_OUT.x, PROJECTIONX.w;
\n
"
);
shader_addline
(
&
buffer
,
"ADD result.position.y, TMP_OUT.y, PROJECTIONY.w;
\n
"
);
/* Account for any inverted textures (render to texture case) by reversing the y coordinate
* (this is handled in drawPrim() when it sets the MODELVIEW and PROJECTION matrices)
*/
shader_addline
(
&
buffer
,
"MUL result.position.y, TMP_OUT.y, PROJECTIONY.y;
\n
"
);
shader_addline
(
&
buffer
,
"END
\n\0
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment