Code Monkey home page Code Monkey logo

gfx_graphics's Introduction

gfx_graphics's People

Contributors

3c1u avatar blanham avatar bvssvni avatar csherratt avatar dcampbell24 avatar eddyb avatar frewsxcv avatar indiv0 avatar kvark avatar leonkunert avatar mbrubeck avatar mitchmindtree avatar mystal avatar nanotech avatar pnkfelix avatar potpourri avatar ryman avatar samestep avatar sphereflow avatar tyoverby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gfx_graphics's Issues

GLSL 1.20 textured fragment shader is missing texture input

There's a uniform sampler2D s_texture; missing in the 120 version of the textured fragment shader, so trying to use gfx_graphics results in a shader compilation error (when GLSL 1.50 is not supported).

(This didn't seem worth making a pull request for.)

Investigate face culling problem

The y-axis points up in normalized OpenGL coordinates, but in absolute 2D coordinates it points down. This leads to triangles disappearing if not the right side is rendered.

Upgrade to latest Gfx

src/g2d.rs:324:23: 324:71 error: expected function, found `render::mesh::SliceKind`
src/g2d.rs:324         batch.slice = gfx::VertexSlice(gfx::TriangleList, 0, n as u32);
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/g2d.rs:376:26: 376:74 error: expected function, found `render::mesh::SliceKind`
src/g2d.rs:376         batch_uv.slice = gfx::VertexSlice(gfx::TriangleList, 0, n as u32);
                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
Could not compile `gfx_graphics`.

Shaders fail to compile with OpenGL::_3_2

Trying to run example from piston-shaders https://github.com/pistondevelopers/shaders

RUST_BACKTRACE=1 cargo run --example viewer
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: Vertex(ShaderCompilationFailed)', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libcore/result.rs:743
stack backtrace:
   1:        0x10503fa77 - sys::backtrace::write::h159c9303aa56d993QnB
   2:        0x10506ba33 - failure::on_fail::h30a5d63a5824ccdbmFK
   3:        0x104fa3da8 - rt::unwind::begin_unwind_inner::h83398b7af9be1f1fCmK
   4:        0x104fa4511 - rt::unwind::begin_unwind_fmt::hfc0db89fc8ff3c8e8kK
   5:        0x10506b35e - rust_begin_unwind
   6:        0x1050b9757 - panicking::panic_fmt::haa2c8b833452fc7bSvw
   7:        0x10182901b - result::Result<T, E>::unwrap::h12136061929040757835
   8:        0x10182817f - g2d::G2D::new::h17736005757864635201
   9:        0x1017f8c18 - start_gfx::h12348680618628704989
  10:        0x1017f8361 - start::closure.3109
  11:        0x1017ec61a - start_window::h10448440904531465193
  12:        0x1017ec310 - start::h16339578277304577960
  13:        0x1017ec1f0 - main::h1292a4f1ac9fc0f9iaa
  14:        0x1050e31a9 - rust_try_inner
  15:        0x1050e3196 - rust_try
  16:        0x10506c47d - rt::lang_start::h06967cab2a70aa6bnzK
  17:        0x1017ec24f - main
An unknown error occurred

Error when running "imagetest" example

RUST_BACKTRACE=1 cargo run --example imagetest
     Running `target/examples/imagetest`
thread '<main>' panicked at 'assertion failed: data.len() * esize + offset_bytes <= buf.get_info().size', /Users/sven/.cargo/git/checkouts/gfx-rs-93bce98024942039/master/src/render/lib.rs:255
stack backtrace:
   1:        0x10e916a77 - sys::backtrace::write::h159c9303aa56d993QnB
   2:        0x10e942a33 - failure::on_fail::h30a5d63a5824ccdbmFK
   3:        0x10e87ada8 - rt::unwind::begin_unwind_inner::h83398b7af9be1f1fCmK
   4:        0x10af498d7 - rt::unwind::begin_unwind::h12418617414705309073
   5:        0x10af69020 - render::Renderer<D>::update_buffer_vec::h11957271402520406697
   6:        0x10af68d3b - g2d::GraphicsBackEnd<'a, C>.BackEnd::tri_list::closure.7606
   7:        0x10af70662 - extern $u22$rust.call$u22$$u20$fn$LP$$RF$mut$u20$for$LT$$u27$r$GT$$u20$core..ops..FnMut$LP$$RF$$u27$r$u20$$u5b$f32$u5d$$RP$$u20$$u2b$$u20$$u27$static$C$$u20$$LP$$RF$$u27$static$u20$$u5b$f32$u5d$$C$$RP$$RP$::object_shim.7755::hd0e0a155049dfd3b
   8:        0x10af68bf2 - rectangle::Rectangle::draw::closure.7604
   9:        0x10af66d27 - g2d::GraphicsBackEnd<'a, C>.BackEnd::tri_list::h10387419007337182272
  10:        0x10af66904 - rectangle::Rectangle::draw::h11168062705347684041
  11:        0x10af6006d - main::closure.7507
  12:        0x10af5fc38 - g2d::G2D::draw::h12446179003519822330
  13:        0x10af1d526 - main::h851c6c8299080913uaa
  14:        0x10e9ba1a9 - rust_try_inner
  15:        0x10e9ba196 - rust_try
  16:        0x10e94347d - rt::lang_start::h06967cab2a70aa6bnzK
  17:        0x10af1d65f - main
An unknown error occurred

Travis CI not working

Using worker: worker-linux-12-2.bb.travis-ci.org:travis-linux-8

git.1

0.26s$ git clone --depth=50 git://github.com/PistonDevelopers/gfx_graphics.git PistonDevelopers/gfx_graphics

Cloning into 'PistonDevelopers/gfx_graphics'...

remote: Counting objects: 333, done.

remote: Compressing objects: 100% (160/160), done.

remote: Total 333 (delta 151), reused 326 (delta 144)

Receiving objects: 100% (333/333), 131.54 KiB | 0 bytes/s, done.

Resolving deltas: 100% (151/151), done.

Checking connectivity... done.

$ cd PistonDevelopers/gfx_graphics

3.08s$ git fetch origin +refs/pull/78/merge:

fatal: Couldn't find remote ref refs/pull/78/merge

The command "eval git fetch origin +refs/pull/78/merge:" failed. Retrying, 2 of 3.

fatal: Couldn't find remote ref refs/pull/78/merge

The command "eval git fetch origin +refs/pull/78/merge:" failed. Retrying, 3 of 3.

fatal: Couldn't find remote ref refs/pull/78/merge

The command "eval git fetch origin +refs/pull/78/merge:" failed 3 times.

The command "git fetch origin +refs/pull/78/merge:" failed and exited with 128 during .

Your build has been stopped.

`draw_state` version don't match.

gfx changed draw_state over git to crates.io. Now we need to do the same in graphics or maybe gfx return to git. I am for the transition to crates.io.

Upgrade G2D and GraphicsBackEnd to latest gfx

I have a problems with this.
The main problem is ParamsUV. TextureParam now has type parameter and if I pass GlResources, then can't create ParamsUV using D: Device, but and generic type doesn't work, #[shader_param()] can't implement ShaderParam to generic type.
@kvark need help

Error when running example

task '<main>' failed at 'called `Result::unwrap()` on an `Err` value: ErrorMesh(ErrorAttributeMissing(color))', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libcore/result.rs:620
An unknown error occurred

Using a dynamic buffer with gfx-rs

According to kvark:

create_buffer has an optional data parameter. If it's given, the buffer is considered static. If None is there - the buffer is dynamic
you then update the contents with update_buffer

Problems creating textures

Trying to get gfx_graphics working with Conrod, which uses freetype-rs to generate alpha maps. See PistonDevelopers/conrod#158

task '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: Invalid TextureInfo (width, height, and levels must not be zero): TextureInfo { width: 0, height: 0, depth: 1, levels: 1, kind: Texture2D, format: Unsigned(RGBA, 8, IntNormalized) }
', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libcore/result.rs:789
An unknown error occurred

Then I tried creating a texture of size 1x1 and got

task '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: Invalid data size provided to update the texture, expected size 4', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libcore/result.rs:789
An unknown error occurred

The following works with memory_from_alpha in opengl_graphics but not with gfx_graphics:

TEST ch `W`
TEST width 23 height 33
TEST ch `i`
TEST width 3 height 31
TEST ch `d`
TEST width 12 height 33
TEST ch `g`
TEST width 11 height 32
TEST ch `e`
TEST width 12 height 24
TEST ch `t`
TEST width 10 height 29
TEST ch ` `
TEST width 0 height 0
TEST ch `D`
TEST width 13 height 33
TEST ch `m`
TEST width 19 height 24
TEST ch `o`
TEST width 12 height 24
TEST ch `n`
TEST width 11 height 24
TEST ch `s`
TEST width 11 height 24
TEST ch `r`
TEST width 8 height 24
TEST ch `a`
TEST width 12 height 24

Compiler errors

src/g2d.rs:146:12: 146:22 error: use of undeclared type name `OwnedBatch`
src/g2d.rs:146     batch: OwnedBatch,
                          ^~~~~~~~~~
src/g2d.rs:147:15: 147:27 error: use of undeclared type name `OwnedBatchUV`
src/g2d.rs:147     batch_uv: OwnedBatchUV,
                             ^~~~~~~~~~~~
error: aborting due to 2 previous errors
Could not compile `piston2d-gfx_graphics`.

Update README

The implementation of a piston-graphics back-end using Gfx.

Error when running example

task '<main>' failed at 'assertion failed: `(left == right) && (right == left)` (left: `48`, right: `96`)', src/gfx2d.rs:293
An unknown error occurred

48/4/2 = 6

96/2/4 = 12

For some reason, it receives 6 vertices and 12 colors.

Compile error

When compiling the latest gfx_graphics, there is a compile error:

src/g2d.rs:275:26: 275:32 error: unresolved import `gfx::state::Normal`. There is no `Normal` in `gfx::state`
src/g2d.rs:275         use gfx::state::{Normal, Inverse, Factor};
                                        ^~~~~~
src/g2d.rs:275:34: 275:41 error: unresolved import `gfx::state::Inverse`. There is no `Inverse` in `gfx::state`
src/g2d.rs:275         use gfx::state::{Normal, Inverse, Factor};
                                                ^~~~~~~

Implement support for GlyphCache for Conrod compatibility

Conrod needs to create glyph textures in the middle of the frame. This is not a widely supported usage pattern in gfx-rs, so we need to have some sort of workaround.

Possible solutions:

  1. pre-create textures and just updated them in the middle of the frame
  2. use one big texture for the glyph atlas and update parts of it that are missing
  3. defer texture creation up to the frame boundary

gfx-rs change breaks compilation

It looks like gfx::UsageDynamic was changed to gfx::BufferUsage::Dynamic.

src/g2d.rs:165:13: 165:30 error: unresolved name `gfx::UsageDynamic`
src/g2d.rs:165             gfx::UsageDynamic);
                           ^~~~~~~~~~~~~~~~~
src/g2d.rs:168:13: 168:30 error: unresolved name `gfx::UsageDynamic`
src/g2d.rs:168             gfx::UsageDynamic);
                           ^~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
Could not compile `gfx_graphics`.

Rename `render` method to `draw`

A problem is that the method render on RenderEvent can't be used by any other method.

Can use draw instead, since this is both Gfx and piston-graphics terminology.

Design notes

First I need a working implementation to figure out whether gfx needs some changes.

The example doesn't build.

Compiling image_iter v0.0.0 (file:///home/ty/workspace/rust/gfx_graphics/examples/image_iter)
src/main.rs:24:22: 31:6 error: this function takes 2 parameters but 1 parameter was supplied [E0061]
src/main.rs:24     let mut window = GameWindowSDL2::new(
src/main.rs:25         GameWindowSettings {
src/main.rs:26             title: "Image".to_string(),
src/main.rs:27             size: [300, 300],
src/main.rs:28             fullscreen: false,
src/main.rs:29             exit_on_esc: true,
               ...
src/main.rs:41:21: 41:33 error: this function takes 1 parameter but 0 parameters were supplied [E0061]
src/main.rs:41     let ref mut g = Gfx2d::new();
                                   ^~~~~~~~~~~~
src/main.rs:41:21: 41:31 error: cannot determine a type for this bounded type parameter: unconstrained type
src/main.rs:41     let ref mut g = Gfx2d::new();
                                   ^~~~~~~~~~
error: aborting due to 3 previous errors
Could not compile `image_iter`.


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.