Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

[WIP] Implement UI pass for rendy #1527

Closed
wants to merge 19 commits into from
Closed

Conversation

happenslol
Copy link
Member

This is the tracking PR for porting the UI pass over to the new renderer.

amethyst_rendy/src/pass/ui.rs Outdated Show resolved Hide resolved
amethyst_rendy/src/pass/mod.rs Outdated Show resolved Hide resolved

// TODO(happens): Can we just use the TextureId here? We need
// `Debug` on this and `Hash` on palette::Srgba
// cached_color_textures: HashMap<palette::Srgba, Texture<B>>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the UI shaders accept the texture and a tint, then mixes them together. That means you don't need a texture per color. You can preload a static single-pixel white texture (probably in a lazy_static) and just use it for all "solid color" cases with the color being used as a tint.

Copy link
Contributor

@AnneKitsune AnneKitsune left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Progress looks good :)

@@ -24,26 +24,31 @@ use crate::{
///
/// Will fail with error 'No resource with the given id' if the InputBundle is not added.
#[derive(new)]
pub struct UiBundle<A = String, B = String, C = NoCustomUi, W = u32, G = ()> {
pub struct UiBundle<R, I, T, A = String, B = String, C = NoCustomUi, W = u32, G = ()> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs docs lol

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the entire bundle.rs and prefab.rs need to be updated, there is a metric ton of generics now and I didn't want to update it until I'm through with it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no way we can reduce those?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Frizi just did a major refactor to use boxed trait objects instead of generics for this, since it has practically no performance impact and makes this code readable again =P This means that this will continue once he is done with that.

// Required for text editing. You want the cursor image to blink.
builder.add(BlinkSystem, "blink_system", &[]);
// builder.add(BlinkSystem, "blink_system", &[]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are in ui already?

@Frizi
Copy link
Member

Frizi commented May 17, 2019

@Frizi Frizi closed this May 17, 2019
@torkleyy torkleyy deleted the implement-rendy-ui-pass branch May 23, 2019 11:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants