Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 09 13:21
    halvnykterist commented #1912
  • Oct 04 21:20
    est31 closed #1962
  • Oct 04 21:20
    est31 commented #1962
  • Oct 03 20:43
    Rami-Slicer commented #1962
  • Oct 03 04:50
    est31 commented #1962
  • Oct 03 03:56
    unlimitedbacon commented #1962
  • Sep 25 02:04
    jvcmarcenes closed #1963
  • Sep 25 01:55
    jvcmarcenes edited #1963
  • Sep 25 01:54
    jvcmarcenes opened #1963
  • Sep 19 05:04
    JerryChCN synchronize #1957
  • Sep 17 19:23
    Rami-Slicer opened #1962
  • Sep 12 18:30

    est31 on master

    Fix texture tutorial color spac… Merge pull request #1961 from d… (compare)

  • Sep 12 18:30
    est31 closed #1961
  • Sep 12 16:44
    dcz-self opened #1961
  • Sep 12 12:34
    est31 commented #1960
  • Sep 12 12:27
    vavra123 commented #1960
  • Sep 12 12:26
    vavra123 commented #1960
  • Sep 11 10:39
    vavra123 opened #1960
  • Sep 06 20:29

    est31 on v0.30.2

    (compare)

  • Sep 06 20:29

    est31 on v0.30.1

    (compare)

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

Doycie
@Doycie
Hello, I am not sure how to handle the following thing. Perhaps somebody here knows the proper way to do it. Every frame I wish to upload a texture to the gpu I have a big vector of f32 that I want to convert into a texture and render. However recreating the texture everytime is very slow. Is there someway to avoid the vector copy? Or perhaps a better way to update the texure?
  let image = glium::texture::RawImage2d::from_raw_rgb(
           self.pixel_vector.to_vec(),
            (TEXSIZE as u32, TEXSIZE as u32),
        );
 let texture = glium::texture::Texture2d::new(display, image).unwrap();