Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drawing sprites with custom alpha values #115

Open
xFrednet opened this issue Nov 20, 2019 · 3 comments
Open

Drawing sprites with custom alpha values #115

xFrednet opened this issue Nov 20, 2019 · 3 comments
Labels
feature New feature or request question Further information is requested
Milestone

Comments

@xFrednet
Copy link

Good morning,

I have a small question about texture rendering. I want to create a fading effect where a texture get more transparent the more you zoom in to it. Sadly I can't find a function for that. Is it currently possible to draw a texture with a set alpha value?

I've also taken a look at some other tickets and I found this one: #1. Would it maybe be possible to add a fading effect with the color attribute if it would be implemented?

Keep up the good work this is an awesome crate :)

@hecrj
Copy link
Owner

hecrj commented Nov 20, 2019

Hey @xFrednet, thank you!

I've also taken a look at some other tickets and I found this one: #1. Would it maybe be possible to add a fading effect with the color attribute if it would be implemented?

That is correct. This is very basic functionality that is currently missing. It should be quite easy to implement, but I haven't got to it because adding color and rotation to each quad instance will potentially affect performance and I would like to explore different implementations.

@hecrj hecrj added feature New feature or request question Further information is requested labels Nov 20, 2019
@hecrj hecrj added this to the 0.4.0 milestone Nov 20, 2019
@xFrednet
Copy link
Author

Thank you for the quick response @hecrj. I was hoping that to hear something like that :).

Just out of interest what is the current state on the implementation? Have you already explored some ways?

@hecrj
Copy link
Owner

hecrj commented Nov 22, 2019

@xFrednet I haven't really started. I am currently focusing heavily on iced. I will come back to Coffee soon! Most likely once the new winit minor version is properly released.

The easiest way to implement this is to change the quad pipelines in the different graphics backends. Specifically, the instance definitions here and here. Then, it should be a matter of updating the shaders, doing a bit of compiler-driven development and exposing the new attributes in theQuad struct.

@hecrj hecrj modified the milestones: 0.4.0, 0.5.0 May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants