1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

GMS 2 Video Player Pro - (Was) free for a limited time

Discussion in 'Marketplace' started by Lonewolff, Jul 2, 2019.

  1. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,207
    Hi Guys,

    To honour the internationally celebrated public holiday of July 2nd 'Lonewolff Day'. We are giving gave away 'Video Player Pro for GMS2' for free, for a limited time.

    https://marketplace.yoyogames.com/assets/6484/video-player-pro-for-gms-2-x

    [​IMG]

    [​IMG]

    The possibilities are endless.

    Features extremely high performance video playback of any format that media player supports. But don't take my word for it, find out for yourself. :)
     
    Last edited: Jul 4, 2019
  2. HayManMarc

    HayManMarc Member

    Joined:
    Jun 21, 2016
    Posts:
    939
    Thanks, LW!
     
    Lonewolff likes this.
  3. TheSnidr

    TheSnidr Heavy metal viking dentist GMC Elder

    Joined:
    Jun 21, 2016
    Posts:
    474
    Very nice!
     
    Lonewolff likes this.
  4. Pfap

    Pfap Member

    Joined:
    Apr 30, 2017
    Posts:
    551
    That's what's up!
     
    Lonewolff likes this.
  5. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,207
    Here's a demo of the forest scene thingy too. So you can see the possibilities.

    https://www.dropbox.com/s/7xuvjyu601x7iv9/skydome_video.zip?dl=0

    Mouse to look around and escape to exit (as it runs in full screen mode).

    Fairly big download at 300 Meg as I haven't cut the footage back yet. The 4K video file is longer than it really needs to be for a scene like this.


    [edit]
    71 83 91 103 112 purchases walked out the door already! Thanks for the interest guys!
     
    Last edited: Jul 4, 2019
    Samuel Venable and Pfap like this.
  6. Mert

    Mert Member

    Joined:
    Jul 20, 2016
    Posts:
    425
    W O N D E R F U L ! ! !
     
    Lonewolff likes this.
  7. JeffJ

    JeffJ Member

    Joined:
    Jun 20, 2016
    Posts:
    342
    Very cool, thank you for sharing!

    This may be a stupid question, but seeing as it's based on Microsoft technology, is this Windows only, or will it work on multiple platforms?
     
    Lonewolff likes this.
  8. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,299
    No. But, as a work around, you may use this exclusively for Windows, and then do a platform check and use @zbox's video player which is very similar in it's capabilities for the other platforms you may need (save HTML5).
     
    JeffJ and Lonewolff like this.
  9. EvanSki

    EvanSki King of Raccoons

    Joined:
    Apr 17, 2018
    Posts:
    581
    Cool trees
     
    Lonewolff likes this.
  10. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,207
    Just Windows unfortunately. And highly likely with UWP if I do a 64 bit build. I don't have UWP though on GMS2, so if you want to be a test dummy, say the word and I'll fire a 64 bit your way. :)


    Some might say, they are photorealistic :p


    Yep, that's always an option. I don't have that extension, so I can't vouch for how it would perform with 8K video though. You'd have to run that by ZBox.
     
    JeffJ and Samuel Venable like this.
  11. Lonewolff

    Lonewolff Member

    Joined:
    Jan 8, 2018
    Posts:
    1,207
    [​IMG]

    112 people and 7 bots took up the opportunity! Thanks for playing! :D


    If anyone is interested on how to replicate the 360 degree video, enjoy :)

    Code:
    /// @description Initialise everything here
    // The create event
    
    
    // Cull counter clockwise
    gpu_set_cullmode(cull_counterclockwise);
    
    // Set up the vertex buffer format for the skydome
    vertex_format_begin();
    vertex_format_add_position_3d();
    vertex_format_add_normal();
    vertex_format_add_texcoord();
    vertex_format = vertex_format_end();
    
    // Load the skydome model
    var temp_buffer = buffer_load("data0.dat");
    vertex_buffer = vertex_create_buffer_from_buffer(temp_buffer, vertex_format);
    buffer_delete(temp_buffer);
    vertex_freeze(vertex_buffer);
    
    // Reserve and index to the video's surface
    video_surface = 0;
    
    // Video player initialise
    video_init(window_device());
    video_load("some_video.mp4")
    video_set_loop(1);
    
    rot = 106;    // Intitial 3D camera rotation
    pitch = 0;    // and pitch
    fov = window_get_width() / window_get_height();    // Field of view
    
    // Set the mouse cursor centre screen and hide it
    display_mouse_set(display_get_width() / 2, display_get_height() / 2);
    window_set_cursor(cr_none);
    

    Code:
    /// @description The rest here in the draw event (to save space for the purposes of this demo)
    // The draw event
    
    // Quit on 'escape' key press
    if(keyboard_check_pressed(vk_escape))
        game_end();
    
    // If the video has started playing, create the surface at the same size as the video
    if(!surface_exists(video_surface) && video_get_duration() > 0)
    {
        video_surface = surface_create(video_get_width(), video_get_height());
        video_draw();    // Pre-draw sets up internal texture mapping after video has confirmed to have started.
    }
    
    // Once the surface exists and video is playing, set the surface as the render
    // target and draw the video to it. Then we can draw back to the screen.
    if(surface_exists(video_surface))
    {
        shader_set(shader0);
        surface_set_target(video_surface)
        result_draw = video_draw();
        surface_reset_target();
        draw_surface_ext(video_surface, 0, 0, 1.0, 1.0, 0, c_white, 1);
        shader_reset();
    }
    
    // Calculate the movement of the mouse
    mouse_x_diff = display_mouse_get_x() - display_get_width() / 2;
    mouse_y_diff = display_mouse_get_y() - display_get_height() / 2;
    display_mouse_set(display_get_width() / 2, display_get_height() / 2);
    
    // Move the 3D camera around in relation to mouse movement
    rot -= mouse_x_diff / 20;
    pitch += mouse_y_diff / 20;
    
    if(pitch >= 90)
        pitch = 90;
    if(pitch <= -90)
        pitch = -90;
    
    mat_world = matrix_build(0,0,0,pitch,rot,0,1,1,1);
    mat_proj = matrix_build_projection_perspective_fov(60, fov, 0, 100);
    mat_view = matrix_build_lookat(0,0,00,0,0,-1000,0,-1,0);
    
    matrix_set(matrix_world, mat_world);
    matrix_set(matrix_projection, mat_proj);
    matrix_set(matrix_view, mat_view);
    
    // Draw the skydome with the video as the texture
    shader_set(shader0);
        vertex_submit(vertex_buffer, pr_trianglelist, surface_get_texture(video_surface));
    shader_reset();
    
    // Reset the world matrix back to normal or everything else drawn from this point will likely
    // not look the way you want it to.
    matrix_set(matrix_world, matrix_build_identity());
    

    Oh, and the shader, as the model I made intentionally doesn't have a colour attribute. You can grab the model from the demo zip in the earlier post (named 'data0.dat').

    Code:
    // Vertex shader
    attribute vec3 in_Position;     // (x,y,z)
    attribute vec3 in_Normal;        // (x,y,z)
    attribute vec2 in_TextureCoord;    // (u,v)
    
    varying vec2 v_vTexcoord;
    
    void main()
    {
        vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
        gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
      
        v_vTexcoord = in_TextureCoord;
    }
    
    
    // Fragment shader
    varying vec2 v_vTexcoord;
    
    void main()
    {
        vec4 pixelColor = texture2D( gm_BaseTexture, v_vTexcoord );
        // Add a little contrast
        pixelColor.rgb = ((pixelColor.rgb - 0.5) * max(1.1250, 0.0)) + 0.5;
      
        gl_FragColor = pixelColor;
    }
    
     
    Last edited: Jul 4, 2019
  12. Samuel Venable

    Samuel Venable Time Killer

    Joined:
    Sep 13, 2016
    Posts:
    1,299
    I'm just popping in here to say thanks for the meme of an iconic star wars scene. XD
     
    Lonewolff likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice