GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2013-07-12 14:48:07

xot
Administrator
Registered: 2007-08-18
Posts: 1,238

GameMaker: Studio gets shaders and compiler

YoYo Games have recently released GameMaker: Studio v1.1058 which they consider a beta release of v1.2. This is a significant update that adds two huge new features.

The first of these is the addition of GPU shaders. One of the places GameMaker has always lagged behind is in 3D graphics support. GameMaker's primary purpose is for making 2D games but many users have found its basic 3D capabilities tantalizing enough to go to great lengths to get around some of its limitations to create games. Over time these limits have been reduced with simple improvements like better z-buffer control and render-to-texture abilities. With the addition of shaders and an improved vertex interface, there is now little that can't be done. GLSL ES shaders are available for most platforms and Windows users have the option of using more powerful GLSL and HLSL shaders.

The second major new addition is a native code compiler. As an interpreted language, GML has earned a reputation for being slow. The new compiler should put an end to that. CPU intensive games can expect significant performance improvements. YoYo has even gone so far as suggesting some processes running up to 100 times faster. That's probably an exceptional case, but expect at least modest improvements for all games. For now, the native code compiler is only available for Windows desktop games and requires the installation of Visual Studio or free-to-use Visual Studio Express.


Abusing forum power since 1986.

Offline

#2 2013-07-13 17:24:24

Marchal_Mig12
Member
Registered: 2009-05-21
Posts: 74

Re: GameMaker: Studio gets shaders and compiler

I haven't tested it yet, but I can't wait for v1.2. Games' quality will improve drastically and game maker will probably get a lot more customer. Hurrah!

Offline

#3 2013-07-13 19:10:35

xot
Administrator
Registered: 2007-08-18
Posts: 1,238

Re: GameMaker: Studio gets shaders and compiler

Yeah, it's a really good thing. I've been using the beta and having a great time learning about shaders. The beta GLSL ES support is missing a couple of important features at the moment but it's amazing what you can do. I've not tried the compiler.


Abusing forum power since 1986.

Offline

#4 2013-07-13 19:20:17

Marchal_Mig12
Member
Registered: 2009-05-21
Posts: 74

Re: GameMaker: Studio gets shaders and compiler

It is really the compiler that appeals me the most since I do not use 3d very much. Do you know how shaders could be any useful for 2d?

Offline

#5 2013-07-13 19:43:34

xot
Administrator
Registered: 2007-08-18
Posts: 1,238

Re: GameMaker: Studio gets shaders and compiler

There are so many ways shaders can spice up a 2D game.

Right now I'm helping Tarik add normal mapping to pre-rendered 3D sprites for dynamic lighting, adding some complex shading to planets, adding some distortion effects to explosions and lasers. All of these effects could be accomplished before shaders, but shaders should make them faster and of higher quality.

The Wireworld cellular automaton I built with shaders is being used by icuurd12b42 as eye candy in a game he's working on. That's posted the Conway's Life topic in these forums.

There is an example on the GMC for doing alpha transitions which are a lot like the gradient wipe transitions I posted in these forums quite a while back. Again the advantage of shaders is speed.

Sprite color replacement is something a lot of people ask for. I've made scripts for this but they are sort of slow and I've had difficultly getting them to work due to some apparent bugs in GM:Studio. Shaders make this kind of thing simpler. You could also do animated palette effects much more effectively.

I'm attempting to translate my NAILS raster-based shadow system to shaders (posted in these forums). It should be a good deal faster since I can replace a part that takes nine or more passes with a single pass.


Abusing forum power since 1986.

Offline

#6 2013-07-13 19:46:50

Marchal_Mig12
Member
Registered: 2009-05-21
Posts: 74

Re: GameMaker: Studio gets shaders and compiler

I am waiting for 1.2 before testing all that out but I'm intrigued as how to use them. Is it easy? Oh and by way it has been a very long time since I saw Tarik around. He's still making games if I understand correctly?

Offline

#7 2013-07-13 19:49:17

xot
Administrator
Registered: 2007-08-18
Posts: 1,238

Re: GameMaker: Studio gets shaders and compiler

Yeah, Tarik is still around and working on games. He contacted me through the GMC a couple weeks ago. I don't know how active he is though.


Abusing forum power since 1986.

Offline

#8 2013-07-14 04:31:33

icuurd12b42
Member
Registered: 2008-12-11
Posts: 303

Re: GameMaker: Studio gets shaders and compiler

Apparently you can do scene shaders setting the view_surface[0] to a surface the size of the port. that causes Studio to render the game on the surface.  The surface will contain the rendered scene generated by the draw event for the view

You then use the UI Draw Event to transfer the scene on the screen drawing the surface, using a shader if you want or other means,

I don't know if you can redirect to another surface mid draw when using the feature though... If you cant ir severely limit what you can do if you used surfaces mid draw for other goodies, aka depth layered surface effects...

Example of this would be distortion effects like a heat wave or compression wave for a bomb. All your after effects can be done on/with/using that surface in the UI Draw

I had this idea for a 2d light map where the light mapped objects draw their normals on 1 surface, their sprite on another (or the view_surface), the light source draw their directional vectors on another surface x,y,z as rgb, their color on another the alpha channel could also hold information, an array index?

The shader would take the 3-4 surfaces as inputs while drawing the view_surface.

The result is one screen pass... one shader call

Last edited by icuurd12b42 (2013-07-14 04:36:45)

Offline

#9 2013-07-14 04:56:25

xot
Administrator
Registered: 2007-08-18
Posts: 1,238

Re: GameMaker: Studio gets shaders and compiler

I presume the surface abstraction layer will allow surface drawing when view surfaces are enabled. I'll need to test that.

I've already built a system that automatically enables surfaces for every view and composites them in the Draw GUI event. I made it for an object devs can easily drop into their games for color blindness usability testing. It's certainly suitable for post processing effects in general. Unfortunately, there currently seem to be some offset drawing bugs with view surfaces for view ports which are not at the origin.


Abusing forum power since 1986.

Offline

Board footer

Powered by FluxBB