Comments (4)
I had a go at this (but not the sRGB conversion): https://github.com/gaborigloi/glium_graphics/tree/latest-graphics, this compiles with the latest piston2d-graphics.
To upgrade, most of the time I just followed what the opengl_graphics backend does.
I also updated piston-texture to the latest version.
I noticed two things:
-
The definition of alpha blending in Piston is different from alpha blending in glium for the alpha channel.
piston2d-graphics saysnew_dest_alpha = src_alpha + dest_alpha
, but what glium does is
new_dest_alpha = src_alpha * src_alpha + dest_alpha * (1 - src_alpha)
.
Therefore I could not useglium::Blend::alpha_blending()
, had to construct the Blend manually. -
For
graphics::draw_state::Blend::Invert
, I used this blending:new_dest_color = (ref_color - dst_color) * src_color
,but the equation in the rustdoc of
Invert
is different, it saysnew_dest_color = ref_color - src_color
.
Also, I'm not sure what formatting to use, I'm still new to Rust. Should I just run rustfmt to format the code, or is the current formatting ok?
from glium_graphics.
Opened a pull request: #112
from glium_graphics.
I think piston-graphics used the alpha equation from Gfx, but after doing some research it seems neither Glium or Gfx use the correct one. Opened PistonDevelopers/graphics#1042
from glium_graphics.
For now, we could use new_dest_alpha = src_alpha + dest_alpha
.
from glium_graphics.
Related Issues (20)
- Change `Texture` to struct tuple
- Add support for `TextureSettings`
- Add support for `Rgba8Texture::update`
- Implement texture filtering
- Notes on window.rs
- Switch from freetype-rs to rusttype HOT 3
- Make `GliumWindow` use similar design to `PistonWindow` HOT 1
- Make `GlyphCache::new` take `P: AsRef<Path>`
- Rationale for `GliumWindow` design
- Make `Glium2d` take closure with generic return type
- Optimize colored graphics
- Memory leak HOT 1
- Use it within 3D game HOT 3
- Font Artifacts
- GlyphCache constructor should take in-memory font
- pistoncore-glutin_window dependency should be optional HOT 1
- image dependency should be optional
- Add support for clamp to border (waiting for Glium 0.26.0) HOT 1
- srgb hardcoded to true
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glium_graphics.