Code Monkey home page Code Monkey logo

country-slice's Introduction

country-slice's People

Contributors

anopara avatar canop 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  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

country-slice's Issues

Thread 'main' panicked at 'gl function was not loaded'

Hi,
After install Rust on macosx and compile the repo appear this error.

Any idea about this error? I'm new to Rust.

INFO [country_slice::setup] Pixel format of the window's GL context: PixelFormat { hardware_accelerated: true, color_bits: 24, alpha_bits: 8, depth_bits: 24, stencil_bits: 8, stereoscopy: false, double_buffer: true, multisampling: Some(4), srgb: true } thread 'main' panicked at 'gl function was not loaded', /Users/joss/Downloads/country-slice-main/target/release/build/gl-91567117508283f4/out/bindings.rs:20624:13 note: run with RUST_BACKTRACE=1environment variable to display a backtrace TRACE [winit::platform_impl::platform::window] DroppingUnownedWindow(0x7faba7e357e0) iMac-de-Joss:country-slice-main joss$ cargo run --release RUST_BACKTRACE=1 warning: unused import:gl::types::*--> src/geometry/instanced_wall.rs:1:5 | 1 | use gl::types::*; | ^^^^^^^^^^^^ | = note:#[warn(unused_imports)]` on by default

warning: unused imports: ffi::CString, marker::PhantomData, os::raw::c_char, ptr
--> src/geometry/instanced_wall.rs:3:11
|
3 | use std::{ffi::CString, marker::PhantomData, os::raw::c_char, ptr};
| ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^

warning: unused import: shader::ShaderProgram
--> src/geometry/instanced_wall.rs:5:21
|
5 | use crate::render::{shader::ShaderProgram, ssbo::GLShaderStorageBuffer};
| ^^^^^^^^^^^^^^^^^^^^^

warning: unused import: DisplayTestMask
--> src/systems/startup.rs:9:13
|
9 | use crate::{DisplayTestMask, IndirectDraw};
| ^^^^^^^^^^^^^^^

warning: country-slice (bin "country-slice") generated 4 warnings
Finished release [optimized] target(s) in 0.09s
Running target/release/country-slice RUST_BACKTRACE=1
TRACE [winit::platform_impl::platform::window] Creating new window
TRACE [winit::platform_impl::platform::view] Triggered viewDidMoveToWindow
TRACE [winit::platform_impl::platform::view] Completed viewDidMoveToWindow
TRACE [winit::platform_impl::platform::view] Triggered validAttributesForMarkedText
TRACE [winit::platform_impl::platform::view] Completed validAttributesForMarkedText
TRACE [winit::platform_impl::platform::view] Triggered validAttributesForMarkedText
TRACE [winit::platform_impl::platform::view] Completed validAttributesForMarkedText
TRACE [winit::platform_impl::platform::view] Triggered validAttributesForMarkedText
TRACE [winit::platform_impl::platform::view] Completed validAttributesForMarkedText
TRACE [winit::platform_impl::platform::window] Locked shared state in set_fullscreen
TRACE [winit::platform_impl::platform::window] Unlocked shared state in set_fullscreen
INFO [country_slice::setup] Pixel format of the window's GL context: PixelFormat { hardware_accelerated: true, color_bits: 24, alpha_bits: 8, depth_bits: 24, stencil_bits: 8, stereoscopy: false, double_buffer: true, multisampling: Some(4), srgb: true }
thread 'main' panicked at 'gl function was not loaded', /Users/joss/Downloads/country-slice-main/target/release/build/gl-91567117508283f4/out/bindings.rs:20624:13
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
TRACE [winit::platform_impl::platform::window] Dropping UnownedWindow (0x7ff67cc23850)`

Panic on run because glslValidator is not found

TRACE [mio::poll] registering event source with poller: token=Token(0), interests=READABLE
INFO [winit::platform_impl::platform::x11::window] Guessed window scale factor: 1.5
DEBUG [winit::platform_impl::platform::x11::window] Calculated physical dimensions: 1600x1200
INFO [country_slice::setup] Pixel format of the window's GL context: PixelFormat { hardware_accelerated: true, color_bits: 24, alpha_bits: 8, depth_bits: 24, stencil_bits: 8, stereoscopy: false, double_buffer: true, multisampling: Some(4), srgb: true }
thread 'main' panicked at 'failed to execute process: Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/utils/mod.rs:27:14

It's really minor, since you just expect glslvalidator to be present. But maybe the error message could be improved, or the whole thing just skipping validation if it's not found.

Also, you should be able to do it at build time instead of run time.

Congratulate!

Hi, just to say congratulation.
I just see "Tiny Glade" on Stream and the gameplay trailer video, and it reminds me of a game demo written in rust which I have played a few month(maybe years?) ago. But I can't recall the name of the original demo(sorry for forgeting to star this repo :-P).
So I start to search the information about the developers of the game, and finally find this repo out.
I'm so happy that this demo grows into a real game. And I'm looking forward to playing the game sooner!

Overflow in curve.rs:61

Running in debug, clicking on screen gives me this panic:

INFO [country_slice::systems::startup] Finished startup
DEBUG [country_slice::systems::vao_update] Built VAO HandleId(4739843756176253309) for HandleId(11286059709789117910)
DEBUG [country_slice::systems::vao_update] Built VAO HandleId(7068307247264835612) for HandleId(11444245003127120014)
DEBUG [country_slice::systems::vao_update] Built VAO HandleId(13333237594557491658) for HandleId(11663918807627483446)
DEBUG [country_slice::systems::vao_update] Built VAO HandleId(6153107102375329856) for HandleId(15180837281428474218)
thread 'main' panicked at 'attempt to subtract with overflow', src/geometry/curve.rs:61:38

Shader build error on startup

Pixel format of the window's GL context: PixelFormat { hardware_accelerated: true, color_bits: 24, alpha_bits: 8, depth_bits: 24, stencil_bits: 8, stereoscopy: false, double_buffer: true, multisampling: Some(4), srgb: true }
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "ERROR::SHADER::COMPILATION_FAILED\n0:52(14): warning: `i' used uninitialized\n0:52(42): warning: `i' used uninitialized\n0:0(0): error: Read from write-only variable `cmds'\n\n#version 430\nlayout(local_size_x = 1, local_size_y = 1) in;\n\n// Same as the OpenGL defined struct: DrawElementsIndirectCommand\nstruct DrawCommand {\n    uint count;         // Num elements (vertices)\n    uint instanceCount; // Number of instances to draw (a.k.a primcount)\n    uint firstIndex;    // Specifies a byte offset (cast to a pointer type) into the buffer bound to GL_ELEMENT_ARRAY_BUFFER to start reading indices from.\n    uint baseVertex;    // Specifies a constant that should be added to each element of indices\u{200b} when chosing elements from the enabled vertex arrays.\n    uint baseInstance;  // Specifies the base instance for use in fetching instanced vertex attributes.\n};\n\n// Command buffer backed by a Shader Storage Object Buffer (SSBO)\nlayout(std140, binding = 0) writeonly buffer draw_commands {\n    DrawCommand cmds[];\n};\n\nlayout (std430, binding=2) buffer transforms_buffer { \n    mat4 transforms[];\n};\n\nstruct CurveData {\n    uint points_count;\n    uint pad0;\n    uint pad1;\n    uint pad2;\n    vec4 positions[1000];\n};\n\nlayout (std430, binding=3) buffer curves_buffer { \n    CurveData curves[];\n};\n\nlayout(rgba32f) uniform image2D road_mask;\n\nvoid main() {\n\n    const uint idx = gl_GlobalInvocationID.x;\n    //cmds[0].count = 312; // brick.glb vertex count\n    uint instance_offset = atomicAdd(cmds[0].instanceCount, curves[idx].points_count); //https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/atomicAdd.xhtml\n    //cmds[0].instanceCount = curves[idx].points_count;\n    //cmds[0].firstIndex = 0;   \n    //cmds[0].baseVertex = 0; \n    //cmds[0].baseInstance = 0;   \n\n    float offset = 0.0;\n    vec4 pixel = imageLoad(road_mask, ivec2(512/2, 512/2)); //center of the image\n    if (pixel.x > 0.0) {\n        offset = 1.0;\n    }\n\n    for (int i; i<curves[idx].points_count; i++) {\n        vec4 pt_position = curves[idx].positions[i];\n         transforms[instance_offset+i] = transpose(mat4(\n            0.1, 0.0, 0.0, pt_position.x,\n            0.0, 0.1, 0.0, pt_position.y,\n            0.0, 0.0, 0.1, pt_position.z,\n            0.0, 0.0, 0.0, 1.0\n        ));\n    }\n\n    //for (int i=0; i<3; i++) {\n    //\n    //    transforms[i] = transpose(mat4(\n    //        1.0, 0.0, 0.0, 0.0,\n    //        0.0, 1.0, 0.0, float(i*1.5) + offset,\n    //        0.0, 0.0, 1.0, 0.0,\n    //        0.0, 0.0, 0.0, 1.0\n    //    ));\n    //}\n}  "', src/main.rs:189:92
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.