Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tales of MajEyal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Otowa Kotori
Tales of MajEyal
Commits
17c2162c
Commit
17c2162c
authored
10 years ago
by
DarkGod
Browse files
Options
Downloads
Patches
Plain Diff
Fixed volumetric aura shader for OSX
parent
c2ab4598
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
game/modules/tome/data/gfx/shaders/volumetric_aura.frag
+14
-8
14 additions, 8 deletions
game/modules/tome/data/gfx/shaders/volumetric_aura.frag
with
14 additions
and
8 deletions
game/modules/tome/data/gfx/shaders/volumetric_aura.frag
+
14
−
8
View file @
17c2162c
...
...
@@ -20,15 +20,17 @@ vec4 Uberblend(vec4 col0, vec4 col1)
void
main
(
void
)
{
vec2
radius
=
vec2
(
0
.
5
,
0
.
5
)
-
gl_TexCoord
[
0
].
xy
;
float
outerScale
=
0
.
95
+
sin
(
tick
/
1000
.
0
f
)
*
0
.
05
;
float
outerScale
=
0
.
95
+
sin
(
tick
/
1000
.
0
)
*
0
.
05
;
float
innerScale
=
0
.
5
;
float
shininess
=
10
.
0
;
float
shininess
=
35
.
0
;
float
density
=
20
.
0
;
vec4
resultColor
=
vec4
(
0
.
0
,
0
.
0
,
0
.
0
,
0
.
0
);
float
density
=
50
.
1
;
float
absorb
=
1
.
0
;
//sampleShine * len - simple
//sampleShine * int[0, len](exp(-l*sampleAbsorb*)*dl ) = sampleShine * (1 - exp(-sampleAbsorb * len))/sampleAbsorb
vec3
emittedColor
=
vec3
(
0
.
0
,
0
.
0
,
0
.
0
);
float
absorb
=
1
.
0
;
for
(
int
i
=
0
;
i
<
samplesCount
;
i
++
)
{
float
scale
=
outerScale
-
float
(
i
)
/
float
(
samplesCount
)
*
(
outerScale
-
innerScale
);
...
...
@@ -39,14 +41,18 @@ void main(void)
float
sampleLen
=
1
.
0
/
float
(
samplesCount
);
float
layerMult
=
float
(
i
)
/
float
(
samplesCount
);
float
shininessMult
=
absorb
/
density
*
(
1
.
0
-
exp
(
-
density
*
sampleLen
));
float
shininessMult
=
0
.
0
;
float
sampleDensity
=
density
*
sampleColor
.
a
*
layerMult
;
shininessMult
=
absorb
*
(
1
.
0
-
exp
(
-
sampleDensity
*
sampleLen
))
/
(
sampleDensity
+
1e-5
);
//shininessMult = absorb * sampleLen;
emittedColor
+=
sampleColor
.
rgb
*
(
1
.
0
-
pow
(
1
.
0
-
sampleColor
.
a
,
1
.
0
))
*
shininess
*
layerMult
*
shininessMult
;
emittedColor
+=
sampleColor
.
rgb
*
(
1
.
0
-
pow
(
1
.
0
-
sampleColor
.
a
,
1
.
0
))
*
shininess
*
sampleLen
*
layerMult
;
//shininessMult;
absorb
*=
exp
(
-
sampleLen
*
density
*
sampleColor
.
a
*
layerMult
);
absorb
*=
exp
(
-
sampleLen
*
sampleDensity
);
}
float
shininessOpacity
=
0
.
0
;
gl_FragColor
=
vec4
(
emittedColor
.
rgb
,
1
.
0
-
absorb
+
(
emittedColor
.
r
+
emittedColor
.
g
+
emittedColor
.
b
)
*
shininessOpacity
);
gl_FragColor
.
a
*=
gl_Color
.
a
;
}
...
...
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