Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
9bcd58f3
Commit
9bcd58f3
authored
Sep 10, 2011
by
Stefan Dösinger
Committed by
Alexandre Julliard
Sep 15, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Disable range fog with per-pixel fog.
parent
e28041c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
21 deletions
+30
-21
state.c
dlls/wined3d/state.c
+30
-21
No files found.
dlls/wined3d/state.c
View file @
9bcd58f3
...
...
@@ -898,6 +898,7 @@ static void state_stencilwrite(struct wined3d_context *context, const struct win
static
void
state_fog_vertexpart
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
const
struct
wined3d_gl_info
*
gl_info
=
context
->
gl_info
;
TRACE
(
"context %p, state %p, state_id %#x.
\n
"
,
context
,
state
,
state_id
);
if
(
!
state
->
render_states
[
WINED3DRS_FOGENABLE
])
...
...
@@ -912,6 +913,13 @@ static void state_fog_vertexpart(struct wined3d_context *context, const struct w
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT)"
);
context
->
fog_coord
=
FALSE
;
}
/* Range fog is only used with per-vertex fog in d3d */
if
(
gl_info
->
supported
[
NV_FOG_DISTANCE
])
{
glFogi
(
GL_FOG_DISTANCE_MODE_NV
,
GL_EYE_PLANE_ABSOLUTE_NV
);
checkGLcall
(
"glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_PLANE_ABSOLUTE_NV)"
);
}
return
;
}
...
...
@@ -926,13 +934,33 @@ static void state_fog_vertexpart(struct wined3d_context *context, const struct w
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FOG_COORDINATE_EXT)"
);
context
->
fog_coord
=
TRUE
;
}
}
else
{
}
else
{
/* Otherwise, use the fragment depth */
if
(
context
->
fog_coord
)
{
glFogi
(
GL_FOG_COORDINATE_SOURCE_EXT
,
GL_FRAGMENT_DEPTH_EXT
);
checkGLcall
(
"glFogi(GL_FOG_COORDINATE_SOURCE_EXT, GL_FRAGMENT_DEPTH_EXT)"
);
context
->
fog_coord
=
FALSE
;
}
if
(
state
->
render_states
[
WINED3DRS_RANGEFOGENABLE
])
{
if
(
gl_info
->
supported
[
NV_FOG_DISTANCE
])
{
glFogi
(
GL_FOG_DISTANCE_MODE_NV
,
GL_EYE_RADIAL_NV
);
checkGLcall
(
"glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_RADIAL_NV)"
);
}
else
{
WARN
(
"Range fog enabled, but not supported by this GL implementation.
\n
"
);
}
}
else
if
(
gl_info
->
supported
[
NV_FOG_DISTANCE
])
{
glFogi
(
GL_FOG_DISTANCE_MODE_NV
,
GL_EYE_PLANE_ABSOLUTE_NV
);
checkGLcall
(
"glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_PLANE_ABSOLUTE_NV)"
);
}
}
}
...
...
@@ -1137,24 +1165,6 @@ void state_fog_fragpart(struct wined3d_context *context, const struct wined3d_st
}
}
static
void
state_rangefog_w
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
if
(
state
->
render_states
[
WINED3DRS_RANGEFOGENABLE
])
WARN
(
"Range fog enabled, but not supported by this GL implementation.
\n
"
);
}
static
void
state_rangefog
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
if
(
state
->
render_states
[
WINED3DRS_RANGEFOGENABLE
])
{
glFogi
(
GL_FOG_DISTANCE_MODE_NV
,
GL_EYE_RADIAL_NV
);
checkGLcall
(
"glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_RADIAL_NV)"
);
}
else
{
glFogi
(
GL_FOG_DISTANCE_MODE_NV
,
GL_EYE_PLANE_ABSOLUTE_NV
);
checkGLcall
(
"glFogi(GL_FOG_DISTANCE_MODE_NV, GL_EYE_PLANE_ABSOLUTE_NV)"
);
}
}
void
state_fogcolor
(
struct
wined3d_context
*
context
,
const
struct
wined3d_state
*
state
,
DWORD
state_id
)
{
float
col
[
4
];
...
...
@@ -5376,8 +5386,7 @@ const struct StateEntryTemplate ffp_vertexstate_template[] = {
{
STATE_RENDER
(
WINED3DRS_FOGENABLE
),
{
STATE_RENDER
(
WINED3DRS_FOGENABLE
),
state_fog_vertexpart
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3DRS_FOGTABLEMODE
),
{
STATE_RENDER
(
WINED3DRS_FOGENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3DRS_FOGVERTEXMODE
),
{
STATE_RENDER
(
WINED3DRS_FOGENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3DRS_RANGEFOGENABLE
),
{
STATE_RENDER
(
WINED3DRS_RANGEFOGENABLE
),
state_rangefog
},
NV_FOG_DISTANCE
},
{
STATE_RENDER
(
WINED3DRS_RANGEFOGENABLE
),
{
STATE_RENDER
(
WINED3DRS_RANGEFOGENABLE
),
state_rangefog_w
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3DRS_RANGEFOGENABLE
),
{
STATE_RENDER
(
WINED3DRS_FOGENABLE
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3DRS_CLIPPING
),
{
STATE_RENDER
(
WINED3DRS_CLIPPING
),
state_clipping
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3DRS_CLIPPLANEENABLE
),
{
STATE_RENDER
(
WINED3DRS_CLIPPING
),
NULL
},
WINED3D_GL_EXT_NONE
},
{
STATE_RENDER
(
WINED3DRS_LIGHTING
),
{
STATE_RENDER
(
WINED3DRS_LIGHTING
),
state_lighting
},
WINED3D_GL_EXT_NONE
},
...
...
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