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
213f7d9f
Commit
213f7d9f
authored
Apr 30, 2015
by
Matteo Bruni
Committed by
Alexandre Julliard
May 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Implement WINED3D_LIGHT_PARALLELPOINT support in the GLSL ffp.
parent
e35f8266
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
4 deletions
+25
-4
light.c
dlls/ddraw/light.c
+0
-3
device.c
dlls/wined3d/device.c
+8
-1
glsl_shader.c
dlls/wined3d/glsl_shader.c
+17
-0
No files found.
dlls/ddraw/light.c
View file @
213f7d9f
...
@@ -175,9 +175,6 @@ static HRESULT WINAPI d3d_light_SetLight(IDirect3DLight *iface, D3DLIGHT *data)
...
@@ -175,9 +175,6 @@ static HRESULT WINAPI d3d_light_SetLight(IDirect3DLight *iface, D3DLIGHT *data)
if
((
!
data
->
dltType
)
||
(
data
->
dltType
>
D3DLIGHT_PARALLELPOINT
))
if
((
!
data
->
dltType
)
||
(
data
->
dltType
>
D3DLIGHT_PARALLELPOINT
))
return
DDERR_INVALIDPARAMS
;
return
DDERR_INVALIDPARAMS
;
if
(
data
->
dltType
==
D3DLIGHT_PARALLELPOINT
)
FIXME
(
"D3DLIGHT_PARALLELPOINT not implemented.
\n
"
);
/* Translate D3DLIGHT2 structure to D3DLIGHT7. */
/* Translate D3DLIGHT2 structure to D3DLIGHT7. */
light7
->
dltType
=
data
->
dltType
;
light7
->
dltType
=
data
->
dltType
;
light7
->
dcvDiffuse
=
data
->
dcvColor
;
light7
->
dcvDiffuse
=
data
->
dcvColor
;
...
...
dlls/wined3d/device.c
View file @
213f7d9f
...
@@ -1455,7 +1455,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
...
@@ -1455,7 +1455,6 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
{
{
case
WINED3D_LIGHT_POINT
:
case
WINED3D_LIGHT_POINT
:
case
WINED3D_LIGHT_SPOT
:
case
WINED3D_LIGHT_SPOT
:
case
WINED3D_LIGHT_PARALLELPOINT
:
case
WINED3D_LIGHT_GLSPOT
:
case
WINED3D_LIGHT_GLSPOT
:
/* Incorrect attenuation values can cause the gl driver to crash.
/* Incorrect attenuation values can cause the gl driver to crash.
* Happens with Need for speed most wanted. */
* Happens with Need for speed most wanted. */
...
@@ -1467,6 +1466,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
...
@@ -1467,6 +1466,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
break
;
break
;
case
WINED3D_LIGHT_DIRECTIONAL
:
case
WINED3D_LIGHT_DIRECTIONAL
:
case
WINED3D_LIGHT_PARALLELPOINT
:
/* Ignores attenuation */
/* Ignores attenuation */
break
;
break
;
...
@@ -1582,6 +1582,13 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
...
@@ -1582,6 +1582,13 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
/* FIXME: Range */
/* FIXME: Range */
break
;
break
;
case
WINED3D_LIGHT_PARALLELPOINT
:
object
->
position
.
x
=
light
->
position
.
x
;
object
->
position
.
y
=
light
->
position
.
y
;
object
->
position
.
z
=
light
->
position
.
z
;
object
->
position
.
w
=
1
.
0
f
;
break
;
default:
default:
FIXME
(
"Unrecognized light type %#x.
\n
"
,
light
->
type
);
FIXME
(
"Unrecognized light type %#x.
\n
"
,
light
->
type
);
}
}
...
...
dlls/wined3d/glsl_shader.c
View file @
213f7d9f
...
@@ -1186,6 +1186,11 @@ static void shader_glsl_ffp_vertex_light_uniform(const struct wined3d_context *c
...
@@ -1186,6 +1186,11 @@ static void shader_glsl_ffp_vertex_light_uniform(const struct wined3d_context *c
GL_EXTCALL
(
glUniform3fv
(
prog
->
vs
.
light_location
[
light
].
direction
,
1
,
&
vec4
.
x
));
GL_EXTCALL
(
glUniform3fv
(
prog
->
vs
.
light_location
[
light
].
direction
,
1
,
&
vec4
.
x
));
break
;
break
;
case
WINED3D_LIGHT_PARALLELPOINT
:
multiply_vector_matrix
(
&
vec4
,
&
light_info
->
position
,
view
);
GL_EXTCALL
(
glUniform4fv
(
prog
->
vs
.
light_location
[
light
].
position
,
1
,
&
vec4
.
x
));
break
;
default:
default:
FIXME
(
"Unrecognized light type %#x.
\n
"
,
light_info
->
OriginalParms
.
type
);
FIXME
(
"Unrecognized light type %#x.
\n
"
,
light_info
->
OriginalParms
.
type
);
}
}
...
@@ -5538,6 +5543,18 @@ static void shader_glsl_ffp_vertex_lighting(struct wined3d_string_buffer *buffer
...
@@ -5538,6 +5543,18 @@ static void shader_glsl_ffp_vertex_lighting(struct wined3d_string_buffer *buffer
" * ffp_light[%u].specular;
\n
"
,
i
);
" * ffp_light[%u].specular;
\n
"
,
i
);
break
;
break
;
case
WINED3D_LIGHT_PARALLELPOINT
:
shader_addline
(
buffer
,
"ambient += ffp_light[%u].ambient.xyz;
\n
"
,
i
);
if
(
!
settings
->
normal
)
break
;
shader_addline
(
buffer
,
"dir = normalize(ffp_light[%u].position.xyz);
\n
"
,
i
);
shader_addline
(
buffer
,
"diffuse += clamp(dot(dir, normal), 0.0, 1.0)"
" * ffp_light[%u].diffuse.xyz;
\n
"
,
i
);
shader_addline
(
buffer
,
"t = dot(normal, normalize(dir - normalize(ec_pos.xyz)));
\n
"
);
shader_addline
(
buffer
,
"if (t > 0.0) specular += pow(t, ffp_material.shininess)"
" * ffp_light[%u].specular;
\n
"
,
i
);
break
;
default:
default:
if
(
light_type
)
if
(
light_type
)
FIXME
(
"Unhandled light type %#x.
\n
"
,
light_type
);
FIXME
(
"Unhandled light type %#x.
\n
"
,
light_type
);
...
...
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