Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kayak UI 0.11
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Microhacks
Bevy Forks
Kayak UI 0.11
Commits
60f92a8f
Commit
60f92a8f
authored
3 years ago
by
StarArawn
Browse files
Options
Downloads
Patches
Plain Diff
Fixed up shader.
parent
8ea62832
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bevy_kayak_ui/src/render/unified/font/extract.rs
+1
-1
1 addition, 1 deletion
bevy_kayak_ui/src/render/unified/font/extract.rs
bevy_kayak_ui/src/render/unified/shader.wgsl
+1
-13
1 addition, 13 deletions
bevy_kayak_ui/src/render/unified/shader.wgsl
with
2 additions
and
14 deletions
bevy_kayak_ui/src/render/unified/font/extract.rs
+
1
−
1
View file @
60f92a8f
...
...
@@ -55,7 +55,7 @@ pub fn extract_texts(
let
chars_layouts
=
font
.get_layout
(
CoordinateSystem
::
PositiveYDown
,
Alignment
::
Start
,
Vec2
::
new
(
layout
.posx
,
layout
.posy
),
Vec2
::
new
(
layout
.posx
,
layout
.posy
+
font_size
),
Vec2
::
new
(
layout
.width
,
layout
.height
),
content
,
font_size
*
1.2
,
...
...
This diff is collapsed.
Click to expand it.
bevy_kayak_ui/src/render/unified/shader.wgsl
+
1
−
13
View file @
60f92a8f
...
...
@@ -93,19 +93,7 @@ fn fragment(in: VertexOutput) -> [[location(0)]] vec4<f32> {
var msdf_unit = vec2<f32>(px_range, px_range) / vec2<f32>(f32(tex_dimensions.x), f32(tex_dimensions.y));
var x = textureSample(font_texture, font_sampler, vec2<f32>(in.uv.x, 1.0 - in.uv.y), i32(in.uv.z));
var v = max(min(x.r, x.g), min(max(x.r, x.g), x.b));
var c = v; //remap(v);
// var v2 = c / fwidth( c );
// var a = clamp( v2 + RADIUS, 0.0, 1.0 );
// var a = smoothStep(
// max(RADIUS - 0.5, 0.0),
// RADIUS + 0.5,
// c);
// var w = fwidth(c);
// var a = smoothStep(0.5 - w, 0.5 + w, c);
var sig_dist = (c - 0.5) * dot(msdf_unit, 0.5 / fwidth(in.uv.xy));
var sig_dist = (v - 0.5) * dot(msdf_unit, 0.5 / fwidth(in.uv.xy));
var a = clamp(sig_dist + 0.5, 0.0, 1.0);
return vec4<f32>(in.color.rgb, 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