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

Lonewolff

Member
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





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:

Lonewolff

Member
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:

JeffJ

Member
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?
 

Samuel Venable

Time Killer
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?
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).
 

Lonewolff

Member
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?
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. :)


Cool trees
Some might say, they are photorealistic :p


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).
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.
 

Lonewolff

Member


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:
Top