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

Add UI framework #441

Merged
merged 31 commits into from Nov 1, 2017

Conversation

Projects
None yet
6 participants
@Xaeroxe
Member

Xaeroxe commented Oct 22, 2017

Work done in this PR:

  • Add UiTransform Component
  • Add UiImage component
  • Add font loading
  • Add UiText component
  • Add UiDraw pass
amethyst_ui/src/pass.rs
+const FRAG_SRC: &[u8] = include_bytes!("frag.glsl");
+
+#[derive(Copy, Clone)]
+#[allow(dead_code)] // This is used by the shaders

This comment has been minimized.

@torkleyy

torkleyy Oct 22, 2017

Member

Don't we need C layout then?

@torkleyy

torkleyy Oct 22, 2017

Member

Don't we need C layout then?

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 22, 2017

Member

Yes, thank you

@Xaeroxe

Xaeroxe Oct 22, 2017

Member

Yes, thank you

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 22, 2017

Member

Added.

@Xaeroxe

Xaeroxe Oct 22, 2017

Member

Added.

+///
+/// TODO: Eventually this should be either replaced by a citrine type, or citrine may just
+/// populate it.
+pub struct UiTransform {

This comment has been minimized.

@torkleyy

torkleyy Oct 22, 2017

Member

Maybe we should limit this to the size and take the position from Transform?

@torkleyy

torkleyy Oct 22, 2017

Member

Maybe we should limit this to the size and take the position from Transform?

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 22, 2017

Member

I feel it's probably important to keep the concepts separate as this is in pixels, whereas Transform uses unspecified units.

@Xaeroxe

Xaeroxe Oct 22, 2017

Member

I feel it's probably important to keep the concepts separate as this is in pixels, whereas Transform uses unspecified units.

This comment has been minimized.

@torkleyy

torkleyy Oct 22, 2017

Member

Okay, true. But if we already have that advantage, we should really do

pub enum Dimension {
    /// In pixels
    Absolute(f32),
    /// Multiplied with window width / height
    Relative(f32),
}
@torkleyy

torkleyy Oct 22, 2017

Member

Okay, true. But if we already have that advantage, we should really do

pub enum Dimension {
    /// In pixels
    Absolute(f32),
    /// Multiplied with window width / height
    Relative(f32),
}

This comment has been minimized.

@torkleyy

torkleyy Oct 22, 2017

Member

Also, I think Bounds would be more accurate.

@torkleyy

torkleyy Oct 22, 2017

Member

Also, I think Bounds would be more accurate.

This comment has been minimized.

@Aceeri

Aceeri Oct 22, 2017

Member

I'm thinking amethyst_ui might just be glue between citrine and our renderer, this could probably be replaced by just using Position and Bounds components and hooking those up to the amethyst renderer.

@Aceeri

Aceeri Oct 22, 2017

Member

I'm thinking amethyst_ui might just be glue between citrine and our renderer, this could probably be replaced by just using Position and Bounds components and hooking those up to the amethyst renderer.

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 22, 2017

Member

@torkleyy I was mostly just trying to sidestep the design decisions we talked about on gitter before. This structure's purpose is to be replaced, it's meant to be slightly sub-optimal.

@Xaeroxe

Xaeroxe Oct 22, 2017

Member

@torkleyy I was mostly just trying to sidestep the design decisions we talked about on gitter before. This structure's purpose is to be replaced, it's meant to be slightly sub-optimal.

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Oct 22, 2017

Member

Example doesn't work yet, probably have to fix my broken shaders.

Member

Xaeroxe commented Oct 22, 2017

Example doesn't work yet, probably have to fix my broken shaders.

- light,
- ): (
- Option<Fetch<'a, Camera>>,
+ (active, camera, ambient, mesh_storage, tex_storage, material_defaults,

This comment has been minimized.

@torkleyy

torkleyy Oct 23, 2017

Member

I'm not sure about this formatting, but well

@torkleyy

torkleyy Oct 23, 2017

Member

I'm not sure about this formatting, but well

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 23, 2017

Member

That formatting was merged in from @Rhuagh 's PR, but I still have more code to write here so I'll give it a rustfmt pass again.

@Xaeroxe

Xaeroxe Oct 23, 2017

Member

That formatting was merged in from @Rhuagh 's PR, but I still have more code to write here so I'll give it a rustfmt pass again.

This comment has been minimized.

@Rhuagh

Rhuagh Oct 23, 2017

Member

That's weird. It shouldn't do that

@Rhuagh

Rhuagh Oct 23, 2017

Member

That's weird. It shouldn't do that

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Oct 25, 2017

Member

So what's the current status of this PR @Xaeroxe ?

Member

torkleyy commented Oct 25, 2017

So what's the current status of this PR @Xaeroxe ?

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Oct 25, 2017

Member

Still requires additional work, I won't have time to work on it for a few days though.

Member

Xaeroxe commented Oct 25, 2017

Still requires additional work, I won't have time to work on it for a few days though.

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Oct 25, 2017

Member

(If anyone wants to push this to completion I gladly accept PRs on my PR)

Member

Xaeroxe commented Oct 25, 2017

(If anyone wants to push this to completion I gladly accept PRs on my PR)

Xaeroxe and others added some commits Oct 21, 2017

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Oct 28, 2017

Member

Z-ordering tested and works 👍
Had to add resizing to blend targets to fix resize issue.

I'm now starting work on a text component.

Member

Xaeroxe commented Oct 28, 2017

Z-ordering tested and works 👍
Had to add resizing to blend targets to fix resize issue.

I'm now starting work on a text component.

Xaeroxe added some commits Oct 28, 2017

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Oct 29, 2017

Member

Text component is ready. This is still super rough around the edges, font loading in particular is kind of hairy, but it does indeed work!

image

Member

Xaeroxe commented Oct 29, 2017

Text component is ready. This is still super rough around the edges, font loading in particular is kind of hairy, but it does indeed work!

image

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Oct 29, 2017

Member

image

Pong now displays score :D Font loading has also been drastically simplified.

Member

Xaeroxe commented Oct 29, 2017

image

Pong now displays score :D Font loading has also been drastically simplified.

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Oct 29, 2017

Member

Broken by upstream changes, fixing now.

Member

Xaeroxe commented Oct 29, 2017

Broken by upstream changes, fixing now.

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Oct 29, 2017

Member

So while there's a lot of things I want to add here and there's many improvements to be made, this is useful in its current form, so I'm going to remove the WIP. We can merge this as is, and I'll work on adding the features I want in subsequent PRs.

Member

Xaeroxe commented Oct 29, 2017

So while there's a lot of things I want to add here and there's many improvements to be made, this is useful in its current form, so I'm going to remove the WIP. We can merge this as is, and I'll work on adding the features I want in subsequent PRs.

@Xaeroxe Xaeroxe changed the title from [WIP] UI to Add UI framework Oct 29, 2017

Xaeroxe added some commits Oct 29, 2017

Xaeroxe added some commits Oct 29, 2017

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Oct 30, 2017

Member

Since we've determined we don't want to fix pass initialization until the gfx-hal rewrite is complete

r? @Rhuagh @torkleyy @Aceeri

Member

Xaeroxe commented Oct 30, 2017

Since we've determined we don't want to fix pass initialization until the gfx-hal rewrite is complete

r? @Rhuagh @torkleyy @Aceeri

@Aceeri

This comment has been minimized.

Show comment
Hide comment
@Aceeri

Aceeri Oct 30, 2017

Member

@Xaeroxe Do we want to keep the placeholder position component for now and just integrate the citrine Position one later?

Member

Aceeri commented Oct 30, 2017

@Xaeroxe Do we want to keep the placeholder position component for now and just integrate the citrine Position one later?

+
+/// UI bundle
+///
+/// Will register all necessary components and systems needed for UI, along with any resources.

This comment has been minimized.

@torkleyy

torkleyy Oct 30, 2017

Member

We should really list the stuff here. (I know this hasn't been done in the past)

@torkleyy

torkleyy Oct 30, 2017

Member

We should really list the stuff here. (I know this hasn't been done in the past)

amethyst_ui/src/pass.rs
+use specs::{Entities, Entity, Fetch, Join, ParJoin, ReadStorage};
+
+use super::*;
+use amethyst_renderer::{Mesh, MeshHandle};

This comment has been minimized.

@torkleyy

torkleyy Oct 30, 2017

Member

Could we move all the amethyst_renderer imports to the top?

@torkleyy

torkleyy Oct 30, 2017

Member

Could we move all the amethyst_renderer imports to the top?

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 30, 2017

Member

Yes

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Oct 30, 2017

Member

I'll give this a full review tomorrow.

Member

torkleyy commented Oct 30, 2017

I'll give this a full review tomorrow.

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Oct 30, 2017

Member

@Aceeri Probably yes, since citrine has a little ways to go before integrating into here and this is better than the nothing we have in Amethyst right now.

Member

Xaeroxe commented Oct 30, 2017

@Aceeri Probably yes, since citrine has a little ways to go before integrating into here and this is better than the nothing we have in Amethyst right now.

@Aceeri

Aceeri approved these changes Oct 31, 2017

Awesome stuff! Now I just need to get off my ass and start working on the layout stuff again.

amethyst_renderer/src/system.rs
@@ -164,6 +163,7 @@ where
{
fn run_now(&mut self, res: &'a Resources) {
self.do_asset_loading(AssetLoadingData::<'a>::fetch(res, 0));
+ self.do_window_management(WindowData::<'a>::fetch(res, 0));
self.do_render(RenderData::<'a, P>::fetch(res, 0));

This comment has been minimized.

@Aceeri

Aceeri Oct 31, 2017

Member

Minor nitpicking but these methods should probably just be render and manage_window or something. do_... seems redundant given they are methods.

@Aceeri

Aceeri Oct 31, 2017

Member

Minor nitpicking but these methods should probably just be render and manage_window or something. do_... seems redundant given they are methods.

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

I was just following the convention set from before, but sure I can do that.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

I was just following the convention set from before, but sure I can do that.

@torkleyy torkleyy self-requested a review Oct 31, 2017

@torkleyy

Great work @Xaeroxe ! I looked into it very closely, which is why you'll have 26 comments to address now 😬

amethyst_ui/src/text.rs
+ type Storage = DenseVecStorage<Self>;
+}
+
+/// This system renders `UiTex`t.

This comment has been minimized.

@torkleyy

torkleyy Oct 31, 2017

Member

"UiText"

@torkleyy

torkleyy Oct 31, 2017

Member

"UiText"

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

pahaha thanks

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

pahaha thanks

amethyst_ui/src/transform.rs
+ ///
+ /// Do not try and replace this while the inner function is being called. Whatever you put
+ /// here would be overwritten.
+ pub resize_fn: Option<Box<FnMut(&mut UiTransform, (f32, f32)) + Send + Sync>>,

This comment has been minimized.

@torkleyy

torkleyy Oct 31, 2017

Member

It might be worth considering to move this into a separate component. Additionally, maybe we can make it an enum which includes standard strategies? Except @Aceeri provides some citrine stuff handling it, that is.

@torkleyy

torkleyy Oct 31, 2017

Member

It might be worth considering to move this into a separate component. Additionally, maybe we can make it an enum which includes standard strategies? Except @Aceeri provides some citrine stuff handling it, that is.

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

That's not a bad idea @torkleyy , thanks!

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

That's not a bad idea @torkleyy , thanks!

examples/04_pong/pong.rs
+ resize_fn: None,
+ };
+ let p2_size_fn = |transform: &mut UiTransform, (width, _height)| {
+ transform.x = (width / 2.) + 100. - transform.width / 2.;

This comment has been minimized.

@torkleyy

torkleyy Oct 31, 2017

Member

Yeah, this isn't very nice. I guess some sort of basic layouting would be nice; not suggesting to do it in this PR though.

@torkleyy

torkleyy Oct 31, 2017

Member

Yeah, this isn't very nice. I guess some sort of basic layouting would be nice; not suggesting to do it in this PR though.

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

Personally I like how flexible this approach is and how easy it makes prototyping but this particular implementation did end up kind of hairy.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

Personally I like how flexible this approach is and how easy it makes prototyping but this particular implementation did end up kind of hairy.

examples/04_pong/systems/winner.rs
@@ -34,10 +37,20 @@ impl<'s> System<'s> for WinnerSystem {
let did_hit = if ball_x <= ball.radius {
// Right player scored on the left side.
score_board.score_right += 1;
+ for (transform, text) in (&ui_transform, &mut text).join() {
+ if "P2" == transform.id {

This comment has been minimized.

@torkleyy

torkleyy Oct 31, 2017

Member

Entities should be used for this. While having a name for entities (which I btw. planned to implement in Specs: you would be able to just do world.create_entity().name("Blah") then) is nice, I don't think we should recommend it for component identification purposes.

@torkleyy

torkleyy Oct 31, 2017

Member

Entities should be used for this. While having a name for entities (which I btw. planned to implement in Specs: you would be able to just do world.create_entity().name("Blah") then) is nice, I don't think we should recommend it for component identification purposes.

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

I guess I like the getElementById from JavaScript and I was trying to mimic that here. It's nice being able to just keep things in your head and request for static values rather than having to store the entity, but storing the entity is also more efficient, so I'll go with that.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

I guess I like the getElementById from JavaScript and I was trying to mimic that here. It's nice being able to just keep things in your head and request for static values rather than having to store the entity, but storing the entity is also more efficient, so I'll go with that.

+
+const SPHERE_COLOUR: [f32; 4] = [0.0, 0.0, 1.0, 1.0]; // blue
+const AMBIENT_LIGHT_COLOUR: Rgba = Rgba(0.01, 0.01, 0.01, 1.0); // near-black
+const POINT_LIGHT_COLOUR: Rgba = Rgba(1.0, 1.0, 1.0, 1.0); // white

This comment has been minimized.

@torkleyy

torkleyy Oct 31, 2017

Member

Just a note, I think the Rgba structure is redundant.

@torkleyy

torkleyy Oct 31, 2017

Member

Just a note, I think the Rgba structure is redundant.

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

This was copy pasted from the sphere example, should I change it there too?

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

This was copy pasted from the sphere example, should I change it there too?

This comment has been minimized.

@torkleyy

torkleyy Oct 31, 2017

Member

No, it's not related to this PR.

@torkleyy

torkleyy Oct 31, 2017

Member

No, it's not related to this PR.

amethyst_ui/src/pass.rs
+ let proj_vec = vec2(
+ 2. / screen_dimensions.width(),
+ -2. / screen_dimensions.height(),
+ ).extend(-2.)

This comment has been minimized.

@torkleyy

torkleyy Oct 31, 2017

Member

This is confusing to me.

@torkleyy

torkleyy Oct 31, 2017

Member

This is confusing to me.

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

Yeah I'm not sure using extend here was the best idea, so I'll fix this.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

Yeah I'm not sure using extend here was the best idea, so I'll fix this.

This comment has been minimized.

@Rhuagh

Rhuagh Oct 31, 2017

Member

Move it to the shader imho, (the extend part)

@Rhuagh

Rhuagh Oct 31, 2017

Member

Move it to the shader imho, (the extend part)

+ vertex.position *= vec4(dimension, 1, 1);
+ vertex.position += vec4(coord, 0, 0);
+ vertex.position *= proj_vec;
+ vertex.position += vec4(-1, 1, 0, 0);

This comment has been minimized.

@torkleyy

torkleyy Oct 31, 2017

Member

Why aren't you just using a matrix?

@torkleyy

torkleyy Oct 31, 2017

Member

Why aren't you just using a matrix?

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

This is more efficient, less multiplying by 1 and adding 0.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

This is more efficient, less multiplying by 1 and adding 0.

This comment has been minimized.

@torkleyy

torkleyy Oct 31, 2017

Member

I'm not sure if we can measure GPU performance in terms of how often a multiplication is happening, but rather how typical and thus optimized it is for a certain situation. So I don't know what's more efficient here, it's just unconventional.

@torkleyy

torkleyy Oct 31, 2017

Member

I'm not sure if we can measure GPU performance in terms of how often a multiplication is happening, but rather how typical and thus optimized it is for a certain situation. So I don't know what's more efficient here, it's just unconventional.

This comment has been minimized.

@Rhuagh

Rhuagh Oct 31, 2017

Member

Vec4 operations are gonna be faster than s matrix for the most part

@Rhuagh

Rhuagh Oct 31, 2017

Member

Vec4 operations are gonna be faster than s matrix for the most part

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

So I did this because @omni-viral and @Rhuagh told me the projection matrix was excessive.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

So I did this because @omni-viral and @Rhuagh told me the projection matrix was excessive.

This comment has been minimized.

@Rhuagh

Rhuagh Oct 31, 2017

Member

You can even reduce it further using vec2 and swizzle operators if you want.

@Rhuagh

Rhuagh Oct 31, 2017

Member

You can even reduce it further using vec2 and swizzle operators if you want.

amethyst_ui/src/pass.rs
+ if let Some(mesh) = mesh_storage.get(unit_mesh) {
+ let vbuf = match mesh.buffer(PosTex::ATTRIBUTES) {
+ Some(vbuf) => vbuf.clone(),
+ None => continue,

This comment has been minimized.

@torkleyy

torkleyy Oct 31, 2017

Member

If there's no unit_mesh, we can just return.

@torkleyy

torkleyy Oct 31, 2017

Member

If there's no unit_mesh, we can just return.

This comment has been minimized.

@torkleyy

torkleyy Oct 31, 2017

Member

The same applies for the check above, let's return and decrease the indention.

@torkleyy

torkleyy Oct 31, 2017

Member

The same applies for the check above, let's return and decrease the indention.

+ &mut self.text
+ }
+
+ /// The RGBA color with a maximum of 1.0 and a minimum of 0.0 for each channel of the text.

This comment has been minimized.

@torkleyy

torkleyy Oct 31, 2017

Member

Thanks for the clarification!

@torkleyy

torkleyy Oct 31, 2017

Member

Thanks for the clarification!

amethyst_ui/src/text.rs
+ );
+
+ fn run(&mut self, (transform, mut text, loader, tex_storage, font_storage): Self::SystemData) {
+ for (transform, text) in (&transform, &mut text).join() {

This comment has been minimized.

@torkleyy

torkleyy Oct 31, 2017

Member

I'm not sure if this is a more general problem, but if a text doesn't have a transform, it will be silently ignored. No need to fix it here, just wanted to note.

@torkleyy

torkleyy Oct 31, 2017

Member

I'm not sure if this is a more general problem, but if a text doesn't have a transform, it will be silently ignored. No need to fix it here, just wanted to note.

This comment has been minimized.

@torkleyy

torkleyy Oct 31, 2017

Member

Please filter and flat_map this, otherwise the indention is too much.

@torkleyy

torkleyy Oct 31, 2017

Member

Please filter and flat_map this, otherwise the indention is too much.

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
Member

Xaeroxe commented Oct 31, 2017

amethyst_ui/src/pass.rs
+ // Populate and update the draw order cache.
+ // TODO: Replace all of this with code taking advantage of specs::TrackedStorage.
+ // TrackedStorage doesn't exist yet but it will in a later version of specs.
+ cached_draw_order.retain(|&(_z, entity)| {

This comment has been minimized.

@Rhuagh

Rhuagh Oct 31, 2017

Member

Is it really worth it to cache this data and not just recalculate it per frame ? The loop below is best case n^2, because position will potentially go through all items in the cache, plus a sort that's n*log(n). Wouldn't it be faster to use binary_search_by and do insertion sort and create the list from scratch every frame? That would be a guaranteed n*log(n).

@Rhuagh

Rhuagh Oct 31, 2017

Member

Is it really worth it to cache this data and not just recalculate it per frame ? The loop below is best case n^2, because position will potentially go through all items in the cache, plus a sort that's n*log(n). Wouldn't it be faster to use binary_search_by and do insertion sort and create the list from scratch every frame? That would be a guaranteed n*log(n).

This comment has been minimized.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

@Rhuagh Yeah you're right this eventually turned out to be not quite what was desired. I have a couple ideas on how to fix it though. First is to introduce a private AtomicBool to the UiTransform indicating if it was added to the cache or not, taking our n^2 operation down to just n.

Caching the sorting is valuable imo because sorting an already sorted collection is very cheap.

@Xaeroxe

Xaeroxe Oct 31, 2017

Member

@Rhuagh Yeah you're right this eventually turned out to be not quite what was desired. I have a couple ideas on how to fix it though. First is to introduce a private AtomicBool to the UiTransform indicating if it was added to the cache or not, taking our n^2 operation down to just n.

Caching the sorting is valuable imo because sorting an already sorted collection is very cheap.

This comment has been minimized.

@Rhuagh

Rhuagh Oct 31, 2017

Member

I agree, it's just when the cache update is more expensive than rebuilding the whole thing I get suspicious :P TrackedStorage and insertion sort on z would turn it into nlogn worst case

@Rhuagh

Rhuagh Oct 31, 2017

Member

I agree, it's just when the cache update is more expensive than rebuilding the whole thing I get suspicious :P TrackedStorage and insertion sort on z would turn it into nlogn worst case

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Oct 31, 2017

Member

r? @Rhuagh

I've tightened up the caching a lot, it uses bitset to be much more efficient now.

Member

Xaeroxe commented Oct 31, 2017

r? @Rhuagh

I've tightened up the caching a lot, it uses bitset to be much more efficient now.

@Rhuagh

Rhuagh approved these changes Oct 31, 2017

@Rhuagh

This comment has been minimized.

Show comment
Hide comment
@Rhuagh

Rhuagh Oct 31, 2017

Member

Much better, thanks

Member

Rhuagh commented Oct 31, 2017

Much better, thanks

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Nov 1, 2017

Member

@torkleyy After adding the new and improved cache I've determined TrackedStorage would actually be a detriment here instead of an advantage as the new cache is actually faster, (mostly because it takes advantage of things we can only do with this particular setup)

Member

Xaeroxe commented Nov 1, 2017

@torkleyy After adding the new and improved cache I've determined TrackedStorage would actually be a detriment here instead of an advantage as the new cache is actually faster, (mostly because it takes advantage of things we can only do with this particular setup)

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Nov 1, 2017

Member

You are cloning ui_transform's bitset 3 times, I think you could reduce that to 1.

You are cloning ui_transform's bitset 3 times, I think you could reduce that to 1.

@torkleyy

This comment has been minimized.

Show comment
Hide comment
@torkleyy

torkleyy Nov 1, 2017

Member

What I don't like about FlaggedStorage is that components get flagged on iteration, not on change. That's my main motivation for TrackedStorage.

What I don't like about FlaggedStorage is that components get flagged on iteration, not on change. That's my main motivation for TrackedStorage.

@torkleyy

I commented on the commit which changes the caching, otherwise I think it's great.

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Nov 1, 2017

Member

Since bitset cloning is pretty cheap I'm going to

bors r+

Member

Xaeroxe commented Nov 1, 2017

Since bitset cloning is pretty cheap I'm going to

bors r+

bors bot added a commit that referenced this pull request Nov 1, 2017

Merge #441
441: Add UI framework r=Xaeroxe a=Xaeroxe

Work done in this PR:

- Add UiTransform Component
- Add UiImage component
- Add font loading
- Add UiText component
- Add UiDraw pass
@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Nov 1, 2017

Member

bors r-

Member

Xaeroxe commented Nov 1, 2017

bors r-

@bors

This comment has been minimized.

Show comment
Hide comment
@bors

bors bot Nov 1, 2017

Contributor

Canceled

Contributor

bors bot commented Nov 1, 2017

Canceled

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Nov 1, 2017

Member

@torkleyy has informed me that bit set clones are not cheap. I'll fix this in the morning

Member

Xaeroxe commented Nov 1, 2017

@torkleyy has informed me that bit set clones are not cheap. I'll fix this in the morning

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Nov 1, 2017

Member

bors r+

Member

Xaeroxe commented Nov 1, 2017

bors r+

bors bot added a commit that referenced this pull request Nov 1, 2017

Merge #441
441: Add UI framework r=Xaeroxe a=Xaeroxe

Work done in this PR:

- Add UiTransform Component
- Add UiImage component
- Add font loading
- Add UiText component
- Add UiDraw pass
@bors

This comment has been minimized.

Show comment
Hide comment

@bors bors bot merged commit b8d0103 into amethyst:develop Nov 1, 2017

3 checks passed

bors Build succeeded
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Xaeroxe Xaeroxe deleted the Xaeroxe:ui branch Nov 1, 2017

@remram44 remram44 referenced this pull request Nov 1, 2017

Closed

UI Framework #365

4 of 4 tasks complete
@remram44

This comment has been minimized.

Show comment
Hide comment
@remram44

remram44 Nov 1, 2017

The ui example shows me a dark blue sphere with nothing else. Closing the window causes a panic "InvalidFramebufferOperation".

screen shot 2017-11-01 at 13 58 06

The pong example doesn't display any text either.

remram44 commented Nov 1, 2017

The ui example shows me a dark blue sphere with nothing else. Closing the window causes a panic "InvalidFramebufferOperation".

screen shot 2017-11-01 at 13 58 06

The pong example doesn't display any text either.

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Nov 1, 2017

Member

Oh right, the blend targets still don't work on Mac. I forgot about that. I'll fix it before we release. That's not a problem with anything UI related, it's a problem with using a rendering pass with blending, interestingly this only occurs on OSX.

Member

Xaeroxe commented Nov 1, 2017

Oh right, the blend targets still don't work on Mac. I forgot about that. I'll fix it before we release. That's not a problem with anything UI related, it's a problem with using a rendering pass with blending, interestingly this only occurs on OSX.

@Xaeroxe

This comment has been minimized.

Show comment
Hide comment
@Xaeroxe

Xaeroxe Nov 1, 2017

Member

I wrote up #473 to address this.

Member

Xaeroxe commented Nov 1, 2017

I wrote up #473 to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment