Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
85af4c7b
Commit
85af4c7b
authored
12 years ago
by
Graham Madarasz (Graham)
Browse files
Options
Downloads
Patches
Plain Diff
For MAINT-576 fix water shader visual issues in non-deferred Review: DaveP
parent
019c7566
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/app_settings/shaders/class1/environment/waterV.glsl
+7
-6
7 additions, 6 deletions
...wview/app_settings/shaders/class1/environment/waterV.glsl
with
7 additions
and
6 deletions
indra/newview/app_settings/shaders/class1/environment/waterV.glsl
+
7
−
6
View file @
85af4c7b
...
@@ -28,6 +28,7 @@ uniform mat4 modelview_projection_matrix;
...
@@ -28,6 +28,7 @@ uniform mat4 modelview_projection_matrix;
ATTRIBUTE
vec3
position
;
ATTRIBUTE
vec3
position
;
void
calcAtmospherics
(
vec3
inPositionEye
);
void
calcAtmospherics
(
vec3
inPositionEye
);
uniform
vec2
d1
;
uniform
vec2
d1
;
...
@@ -48,35 +49,35 @@ float wave(vec2 v, float t, float f, vec2 d, float s)
...
@@ -48,35 +49,35 @@ float wave(vec2 v, float t, float f, vec2 d, float s)
void
main
()
void
main
()
{
{
//transform vertex
//transform vertex
vec4
pos
=
vec4
(
position
.
xyz
,
1
.
0
);
mat4
modelViewProj
=
modelview_projection_matrix
;
mat4
modelViewProj
=
modelview_projection_matrix
;
vec4
oPosition
;
vec4
oPosition
;
//get view vector
//get view vector
vec3
oEyeVec
;
vec3
oEyeVec
;
oEyeVec
.
xyz
=
pos
ition
.
xyz
-
eyeVec
;
oEyeVec
.
xyz
=
pos
.
xyz
-
eyeVec
;
float
d
=
length
(
oEyeVec
.
xy
);
float
d
=
length
(
oEyeVec
.
xy
);
float
ld
=
min
(
d
,
2560
.
0
);
float
ld
=
min
(
d
,
2560
.
0
);
vec3
lpos
=
position
;
pos
.
xy
=
eyeVec
.
xy
+
oEyeVec
.
xy
/
d
*
ld
;
lpos
.
xy
=
eyeVec
.
xy
+
oEyeVec
.
xy
/
d
*
ld
;
view
.
xyz
=
oEyeVec
;
view
.
xyz
=
oEyeVec
;
d
=
clamp
(
ld
/
1536
.
0
-
0
.
5
,
0
.
0
,
1
.
0
);
d
=
clamp
(
ld
/
1536
.
0
-
0
.
5
,
0
.
0
,
1
.
0
);
d
*=
d
;
d
*=
d
;
oPosition
=
vec4
(
l
pos
,
1
.
0
);
oPosition
=
vec4
(
pos
ition
,
1
.
0
);
oPosition
.
z
=
mix
(
oPosition
.
z
,
max
(
eyeVec
.
z
*
0
.
75
,
0
.
0
),
d
);
oPosition
.
z
=
mix
(
oPosition
.
z
,
max
(
eyeVec
.
z
*
0
.
75
,
0
.
0
),
d
);
oPosition
=
modelViewProj
*
oPosition
;
oPosition
=
modelViewProj
*
oPosition
;
refCoord
.
xyz
=
oPosition
.
xyz
+
vec3
(
0
,
0
,
0
.
2
);
refCoord
.
xyz
=
oPosition
.
xyz
+
vec3
(
0
,
0
,
0
.
2
);
//get wave position parameter (create sweeping horizontal waves)
//get wave position parameter (create sweeping horizontal waves)
vec3
v
=
l
pos
;
vec3
v
=
pos
.
xyz
;
v
.
x
+=
(
cos
(
v
.
x
*
0
.
08
/*+time*0.01*/
)
+
sin
(
v
.
y
*
0
.
02
))
*
6
.
0
;
v
.
x
+=
(
cos
(
v
.
x
*
0
.
08
/*+time*0.01*/
)
+
sin
(
v
.
y
*
0
.
02
))
*
6
.
0
;
//push position for further horizon effect.
//push position for further horizon effect.
vec4
pos
;
pos
.
xyz
=
oEyeVec
.
xyz
*
(
waterHeight
/
oEyeVec
.
z
);
pos
.
xyz
=
oEyeVec
.
xyz
*
(
waterHeight
/
oEyeVec
.
z
);
pos
.
w
=
1
.
0
;
pos
.
w
=
1
.
0
;
pos
=
modelview_matrix
*
pos
;
pos
=
modelview_matrix
*
pos
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment