Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 18 21:31
    wbrickner commented #1840
  • Jan 18 21:23
    wbrickner commented #1840
  • Jan 18 21:21
    wbrickner commented #1840
  • Jan 06 18:17
    JOE1994 commented #1907
  • Jan 06 18:16
    JOE1994 commented #1907
  • Jan 06 18:15
    JOE1994 commented #1907
  • Jan 06 17:39
    est31 commented #1907
  • Jan 06 17:37
    est31 commented #1907
  • Jan 06 17:26
    JOE1994 opened #1907
  • Jan 04 13:26
    vberger opened #1906
  • Dec 30 2020 09:56
    willemv commented #1904
  • Dec 30 2020 09:45
    rforcen commented #1727
  • Dec 23 2020 15:47
    Boscop commented #1904
  • Dec 21 2020 21:57
    willemv commented #1904
  • Dec 21 2020 21:55
    willemv commented #1904
  • Dec 20 2020 00:13
    est31 commented #1905
  • Dec 19 2020 23:58
    meringu closed #1905
  • Dec 19 2020 23:58
    meringu commented #1905
  • Dec 19 2020 23:55
    est31 commented #1905
  • Dec 19 2020 23:52
    meringu opened #1905
Jeroen Bollen
@Binero
How would I go about constructing a Cubemap texture? There doesn't seem to be a constructor?
Peter Bay Bastian
@pbbastian
How would I go about using glium with nalgebra? I tried enabling the nalgebra feature, but I'm told by cargo that glium doesn't have that feature
oh, seems nalgebra and cgmath support was removed as per this commit tomaka/glium@d08048f
Peter Bay Bastian
@pbbastian
what do i do then?
Jonathon Walsh
@Slogo
I'm having an odd problem using glium that I'm curious if anyone else has seen. My program runs fine on Windows, and the example programs run fine on my mac, but when I run my program on the mac there's no window that appears and I can't get glium to give me any sort of useful debug info.
Fedor Logachev
@not-fl3

hey guys! just asked on irc, but maybe someone here knows too :)

fn draw_foo<T : Surface>(surf : &mut T, textures : Vec<(String, Texture2d)>) {
  let uniforms  = ?;
  surf.draw(...., uniforms, ...)
}

I cant found any ways to pass compile unknown count of textures to my shader

Maik Klein
@MaikKlein
@tomaka Do you still think that Rust needs a better math library? See https://www.reddit.com/r/rust_gamedev/comments/4pa35k/is_there_value_in_creating_a_new_math_library/
Aaron Muir Hamilton
@xorgy
Hey folks; is there any way to draw quads in glium?
(aside from monotonously filling the index buffer with the regular [idx++, idx++, idx--, idx++, idx++, idx++] nonsense)
In my GLES2 applications I just flood the index buffer with this nonsense because there is no other way, but IIRC OpenGL 3.3 should still have GL_QUADS
Hossein
@Hossein-Noroozpour
I have question, is Vulakano application capable of porting to Android? Has anybody ever experience of game or engine developement with it?
Hossein
@Hossein-Noroozpour
I know it has a winit part but, I have some problem to build the traingle example for Android, and I have really like to know is this gonna be a promising library for android developemt?
酿泉
@tioover
Hello, my English is very poor, so I use Google Translate.
I have a problem has always wanted to not understand, although the problem can be bypassed.
why textures implement AsUniformValue is impl AsUniformValue for &'a TextureType
not for TextureType? in the as_uniform_value(), code is UniformValue(*self, None), self: &'a Texture...
酿泉
@tioover
impl AsUniformValue for SrgbTexture2d {
    fn as_uniform_value(&self) -> UniformValue {
        UniformValue::SrgbTexture2d(self, None)
    }
}
this can success compile, for what reason choose impl UniformValue for &'a TextureX? Is to avoid memory safety issues in this code?
I want to do this, but I'm afraid of causing problems, so come ask if this will cause any problems.
thanks very much!
David Harvey-Macaulay
@alteous
Hello, what's the difference between a Buffer and a BufferView? Intuition tells me a BufferView is a subset of a Buffer and so a BufferViewSlice must be a subset of a BufferView. This is the result I need but according to the documentation there seems to be no difference between the construction of a BufferView versus a Buffer at all.
Fedor Logachev
@not-fl3
@tomaka Hello! I made quick port of glium_text to rusttype https://github.com/not-fl3/glium_text - it works well for quick protyping and dont requires additional binary dependencies. Code is not clean, and I didnt found a way to get all characters from rusttype like you did with truetype, so I dont think that you need it in main repo.
But it works well for me, and I am thinking about publish it on crates.io with different name, like glium_text_rusttype, do you have any thoughts about it?
Valera Rozuvan
@valera-rozuvan

Hey guys! Quick question. In OpenGL, when you have something like:

vec3 A = vec3(1.0, 2.0, 3.0);
A.xy = -A.yx;

A will now become:

{-2.0, -1.0, 3.0}

?
(In GLSL to be more precise. This is possible due to "swizzling". But in this particular case - I am in a bit of a doubt.)

mhsjlw
@mhsjlw
What is the equivalent of glfwGetTime
I'm trying to perform a rotation, should I have my own timer, or does glutin/glium have a similar function
Thanks in advance! :D
mhsjlw
@mhsjlw
I've got another question:
What is the glium parameter equivalent of:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
I've tried using all the blend functions with OneMinusSourceAlpha and it doesn't work
There is white stuff on the edge of the image as well as having a black background
If I run this in OpenGL it will make things transparent and it will remove that white stuff around the edge of the png
mhsjlw
@mhsjlw
To my first question:
        let params = glium::DrawParameters {
            blend: glium::Blend::alpha_blending(),
            .. Default::default()
        };
And to my second:
// At the start of your program
let instant = Instant::now()
// Later
instant.elapsed().as_secs() as f64 + instant.elapsed().subsec_nanos() as f64 * 1e-9) as f32
Blightbuster
@Blightbuster
(this may be a stupid question) Which version of opengl is used by glium?
matrixbot
@matrixbot
tomaka Whatever version is available
Blightbuster
@Blightbuster
so i could use opengl 4.5 features but had to test for required hardware first right?
first time with opengl :D
mhsjlw
@mhsjlw
set the context to 4.5
Blightbuster
@Blightbuster
ty
Corentin Brunel
@Luxed
Hey everyone, I'm trying to learn about OpenGL by following the learnopengl, but right I'm lost.
I am trying to send a struct in a uniform, I tried everything that I could and nothing worked.
I tried the UniformBuffer to see if it would work, but even by itself with a simple f32 value, it doesn't work:
let buffer_material = glium::uniforms::UniformBuffer::new(&display, 1.0f32).expect("failed to create uniform buffer");
target.draw(&cube_vertex_buffer, &index_buffer, &program, &uniform! {
    MyBlock: &buffer_material,
},
&params).expect("failed to draw");
#version 330
uniform layout(std140);
uniform MyBlock {
    float test;
} myblock;

void main() {
FragColor = vec4(myblock.test, 1.0);
}
I can force the value to 1.0, use a simpler uniform and it will work
but this absolutely doesn't want to work
Corentin Brunel
@Luxed

I also tried renaming everything to make the block work, it just won't do anything.

Following this: LearnOpenGL - Lighting - Materials
What would I want to do to get the data I need across ? should I use regular uniforms and not worry about structs ? Even though it won't be as organized ?

Corentin Brunel
@Luxed

New issue now, it works but only partially !
here is the rust code (only part of it)

    #[derive(Copy, Clone)]
    struct Test {
        color: [f32; 3],
        color_two: [f32; 3],
    };
    implement_uniform_block!(Test, color, color_two);
    let struct_uni_test = Test {
        color: [0.5, 0.5, 0.5],
        color_two: [0.2, 0.6, 0.1],
    };
    let uni_test = glium::uniforms::UniformBuffer::new(&display, struct_uni_test).expect("failed to create uniform buffer");

And the GLSL:

#version 330 core
uniform layout(std140);

uniform UniTest {
    vec3 color;
    vec3 color_two;
};

void main()
{
    FragColor = vec4(color, 1.0);
}

And here is the error:

thread 'main' panicked at 'failed to draw: UniformBlockLayoutMismatch { name: "UniTest", err: MemberMismatch { member: "color_two", err: OffsetMismatch { expected: 16, obtained: 12 } } }', src\libcore\result.rs:906:4
The second color isn't offset well ? why would that be ?
Corentin Brunel
@Luxed
Found it ? maybe ? If I use vec4 instead of vec3 it seems to work
io12
@io12
Is it possible to only use a VertexBuffer and not an IndexBuffer?
Sam Johnson
@sam0x17
any tips on how to unbreak the examples after the recent glutin update?
Boscop
@Boscop
I've been using glium for writing a visualizer. now i want to support Resolume, so i need to write a FFGL plugin. it gets the opengl context passed from the host and then needs to render into it. how can i do that with glium?
https://github.com/leadedge/ShaderLoader/blob/master/Source/ShaderLoader.cpp#L265
roberto forcen
@rforcen
what's the equivalent to: glEnable(GL_DEPTH_TEST);
roberto forcen
@rforcen

what's the equivalent to: glEnable(GL_DEPTH_TEST);

just found the solution in : https://github.com/glium/glium/blob/master/book/tuto-09-depth.md