Jump to content


Photo

Surface Fix


  • Please log in to reply
207 replies to this topic

#1 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 21 November 2009 - 03:24 PM

This package is no longer required for GM 8.1 users as 3D surface support was finally fixed by YYG. However, a new, separate package specifically for GM 8.1 users is being worked on which includes more advanced features.

Surface Fix (Version 1.2.1)

Surface Fix is an extension package/DLL for Game Maker 7 and Game Maker 8 that lets you easily and flawlessly use surfaces in your 3D games. No manual depth sorting needs to be done and no slow functions such as background_create_from_screen need to be used. Simply install the extension package or use the DLL and your game will instantly be able to use surfaces without problems in 3D mode.

Additionally, Surface Fix allows you to do the following:
  • Use room transitions in 3D games - even custom transitions will work without any modifications!
  • Draw to surfaces in the Draw event without messing up views
  • Quickly dump a surface to a string or file (to simplify saving surfaces with your games)
  • And more...
Plus, you can use it to add great-looking special effects to your games! Some of the effects that have been done so far include security monitors, mirrors, blur, motion blur, depth-of-field, glow, and shadows. Use your imagination and the possibilities are endless.

There is both a GEX version and a DLL version of the package. Also, a help file and five examples (security monitor, blur, motion blur, depth-of-field, and transitions) are included. Please read through the help file before you use it. Note that Windows Vista and Windows 7 users need to run GM as an administrator in order to install the GEX version of the package. I can't do anything about this, so don't complain. If you're unable to run GM as an administrator, use the DLL version instead.

Enjoy! :whistle:

License

Surface Fix is completely free. You may use it for both commercial and non-commercial purposes. If Surface Fix is used in a commercial game, you need to give me credit in some way. Otherwise, I don't really care.

Screenshot (from the monitor example)

Posted Image

Download

Extension package:
Posted Image

DLL:
Posted Image

Edited by amd42, 07 July 2011 - 12:51 AM.

  • 5
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#2 wisemeat56

wisemeat56

    GMC Member

  • GMC Member
  • 182 posts

Posted 22 November 2009 - 02:31 AM

Hmm, I might try this! I'm downloading it right now.
  • 0

#3 wisemeat56

wisemeat56

    GMC Member

  • GMC Member
  • 182 posts

Posted 22 November 2009 - 02:37 AM

It's doesn't work. It says it can't find file Surface_Fix or something like that. ???

EDIT: And the moniter thing doesn't work either it says unknown function or script depth_clear.

EDIT 2: oops, didn't see that this was an advanced forum thread. Sorry! Probably why I can't understand this thing!

Edited by wisemeat56, 22 November 2009 - 02:41 AM.

  • 0

#4 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • GMC Member
  • 965 posts
  • Version:GM8

Posted 22 November 2009 - 02:39 AM

I get an error saying "An error occurred installing the extension package." I think the file is corrupt or something.
  • 0

Posted Image


#5 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 22 November 2009 - 03:05 AM

I get an error saying "An error occurred installing the extension package." I think the file is corrupt or something.

That's odd - I just checked it and it installed fine. I'll re-upload it and see if that fixes anything.

EDIT: Okay, I re-uploaded it. Try it now and see if it works.

Edited by amd42, 22 November 2009 - 03:28 AM.

  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#6 Jazza4Lyf

Jazza4Lyf

    GMC Member

  • GMC Member
  • 247 posts
  • Version:GM:Studio

Posted 22 November 2009 - 05:16 AM

[codebox]FATAL ERROR in
action number 1
of Step Event
for object obj_cam2:

COMPILATION ERROR in code action
Error in code at line 14:
depth_clear();

at position 2: Unknown function or script: depth_clear[/codebox]
I got this error after installing the package and running 'monitor.gmk' but it is fine with 'room_transitions.gmk', this could be very useful if it gets up and running.
  • 0

2nsxog9.png

 

Be on the lookout for JSME v3 in the future sometime... It is coming!


#7 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 22 November 2009 - 06:49 AM

It works for me.

Now you are going to have to tells us how it works


Perhaps send the code to mark to see if he can natively suported it in GM8!
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#8 T-Bird

T-Bird

    GMC Member

  • New Member
  • 1326 posts

Posted 22 November 2009 - 07:14 AM

That is simply amazing.

Extensions like this always make me question how much of what Mark says he "can't do" for GM is simply a wont do. I have the upmost respect for him, but they need to hire some full time programmers to support him.

I must ask though, does this DLL overwrite GM's existing surface and transition functions to use surfaces controlled by your DLL? Does it tweak GM's internals? What is it doing?
  • 0

#9 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 22 November 2009 - 01:31 PM

That is simply amazing.

Extensions like this always make me question how much of what Mark says he "can't do" for GM is simply a wont do. I have the upmost respect for him, but they need to hire some full time programmers to support him.

I must ask though, does this DLL overwrite GM's existing surface and transition functions to use surfaces controlled by your DLL? Does it tweak GM's internals? What is it doing?

Thanks. Glad you like it.

I'm not going to go into too much detail here, but the only reason why surfaces don't normally work in 3D (Mark, take note!) is because surface_set_target() and surface_reset_target() set the ZBuffer to NULL. So, what the DLL in this package does is add code to a few of the surface functions to give each surface its own ZBuffer. Otherwise, most of the surface management is done by GM.

@Jazza4Lyf: That's odd. Is Surface Fix in the used packages list?

Edited by amd42, 22 November 2009 - 01:32 PM.

  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#10 HaRRiKiRi

HaRRiKiRi

    GMC Member

  • GMC Member
  • 1364 posts

Posted 22 November 2009 - 02:32 PM

This is nice. :D This also allows to create that sweet portal effect. While back we used the background save functions, but now it can be created in much faster way. :P

This really makes us think what Mark is doing all the time. By "cracking" GM, users have create some very unbelievable things and Mark couldn't do these things with the sourcecode he possess (like multi-threading). It just makes me sad. Anyway, he created a great language and it seems that open source projects like Enigma will be great replacements for this software that needs to be cracked all the time to make it better. :P

Edited by HaRRiKiRi, 22 November 2009 - 02:37 PM.

  • 0

#11 Whirligig

Whirligig

    GMC Member

  • GMC Member
  • 31 posts

Posted 22 November 2009 - 07:23 PM

Nice. I tried the security camera, and it works fine.

To those who were getting errors: Make sure you've installed the extension package before opening the other files.
  • 0
I know what you're thinking. "What a boring signature..."

#12 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • GMC Member
  • 965 posts
  • Version:GM8

Posted 22 November 2009 - 08:06 PM

I still get that same error. I tried installing it from another directory, but I sill get the error. I tried installing it on GM8 RC2 too, but even that gives the same error. Any help here? I was really looking forward to this.
  • 0

Posted Image


#13 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 22 November 2009 - 10:08 PM

I still get that same error. I tried installing it from another directory, but I sill get the error. I tried installing it on GM8 RC2 too, but even that gives the same error. Any help here? I was really looking forward to this.

You're doing this with Game Maker 7, right? Are you able to install other packages?
  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#14 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 23 November 2009 - 02:07 AM

I'm not going to go into too much detail here, but the only reason why surfaces don't normally work in 3D (Mark, take note!) is because surface_set_target() and surface_reset_target() set the ZBuffer to NULL. So, what the DLL in this package does is add code to a few of the surface functions to give each surface its own ZBuffer. Otherwise, most of the surface management is done by GM.

@Jazza4Lyf: That's odd. Is Surface Fix in the used packages list?



So you've over ridden GM surface_set_target? made your own scripts with the same name so GM calls them (I like the fact that you can make script the same name as GM's and it calls them) and then they call a dll coded version, the dll packaged in the extention package? I asume.

Don't let us hanging. Share the concept.
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#15 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • GMC Member
  • 965 posts
  • Version:GM8

Posted 23 November 2009 - 02:09 AM

I still get that same error. I tried installing it from another directory, but I sill get the error. I tried installing it on GM8 RC2 too, but even that gives the same error. Any help here? I was really looking forward to this.

You're doing this with Game Maker 7, right? Are you able to install other packages?

Yeah, I'm using 7. and I can install other packages perfectly.
  • 0

Posted Image


#16 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 23 November 2009 - 02:57 AM

I still get that same error. I tried installing it from another directory, but I sill get the error. I tried installing it on GM8 RC2 too, but even that gives the same error. Any help here? I was really looking forward to this.

You're doing this with Game Maker 7, right? Are you able to install other packages?

Yeah, I'm using 7. and I can install other packages perfectly.

Okay, try one more time. I made a few tweaks to the package and switched to a different file host. If this still doesn't work, I can just make a DLL out of it.

New Download Link
  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#17 xot

xot

    GMC Dismember

  • GMC Elder
  • 4785 posts
  • Version:GM:Studio

Posted 23 November 2009 - 10:31 AM

This is straight-up AMAZING! You've just made my dreams come true, amd42. Bless you and the units of /dev/null!
  • 2
GMLscripts.com, rise from your grave!

If any of my posts contain broken images or links, I can probably supply them for you. PM with a link to the post.

#18 Jazza4Lyf

Jazza4Lyf

    GMC Member

  • GMC Member
  • 247 posts
  • Version:GM:Studio

Posted 23 November 2009 - 03:03 PM

@Jazza4Lyf: That's odd. Is Surface Fix in the used packages list?

Yeah, I re-downloaded it and it worked. Before I did, I made sure I checked and 'depth_clear()' was the only one that didn't come up in the info bar at the bottom nor was it highlighted like the other functions, but its cool now!

P.S. - REALLY like the monitor!
  • 0

2nsxog9.png

 

Be on the lookout for JSME v3 in the future sometime... It is coming!


#19 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 23 November 2009 - 09:00 PM

I'm not going to go into too much detail here, but the only reason why surfaces don't normally work in 3D (Mark, take note!) is because surface_set_target() and surface_reset_target() set the ZBuffer to NULL. So, what the DLL in this package does is add code to a few of the surface functions to give each surface its own ZBuffer. Otherwise, most of the surface management is done by GM.

@Jazza4Lyf: That's odd. Is Surface Fix in the used packages list?



So you've over ridden GM surface_set_target? made your own scripts with the same name so GM calls them (I like the fact that you can make script the same name as GM's and it calls them) and then they call a dll coded version, the dll packaged in the extention package? I asume.

Don't let us hanging. Share the concept.

It just alters the code of those functions directly - when the game loads, an initialization function is called which changes a few bytes in the surface functions so that they branch into some C++ code at certain points. It doesn't replace them - they're mostly left intact, aside from the few changes that the DLL makes. This is also why it only works with GM7 - I used hardcoded memory addresses which code is written directly into. It's faster (and in some cases, easier) than completely rewriting all of the surface functions. I'm going to make this open-source soon, so you'll see what I mean.

Edited by amd42, 23 November 2009 - 09:05 PM.

  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#20 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • GMC Member
  • 965 posts
  • Version:GM8

Posted 23 November 2009 - 09:22 PM

I'm not going to go into too much detail here, but the only reason why surfaces don't normally work in 3D (Mark, take note!) is because surface_set_target() and surface_reset_target() set the ZBuffer to NULL. So, what the DLL in this package does is add code to a few of the surface functions to give each surface its own ZBuffer. Otherwise, most of the surface management is done by GM.

@Jazza4Lyf: That's odd. Is Surface Fix in the used packages list?



So you've over ridden GM surface_set_target? made your own scripts with the same name so GM calls them (I like the fact that you can make script the same name as GM's and it calls them) and then they call a dll coded version, the dll packaged in the extention package? I asume.

Don't let us hanging. Share the concept.

It just alters the code of those functions directly - when the game loads, an initialization function is called which changes a few bytes in the surface functions so that they branch into some C++ code at certain points. It doesn't replace them - they're mostly left intact, aside from the few changes that the DLL makes. This is also why it only works with GM7 - I used hardcoded memory addresses which code is written directly into. It's faster (and in some cases, easier) than completely rewriting all of the surface functions. I'm going to make this open-source soon, so you'll see what I mean.

Good! Then I can finally use it ;) (If you don't mind releasing the .ged)
  • 0

Posted Image


#21 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 23 November 2009 - 09:22 PM

snake_?? <i think> showed how to change show_message to call Windows' standard message box using the same method.

gmapi and gmlib will show you how to get the address for gm6, 6.1 and 7 functions by name, also the different base address... You'll be able to do the same for 6 and 6.1


You made a lot of people happy with this you know. Obviously. And I would suggest you post the recomended changes in gm8's bug report system. maybe mark can fix his code, though it's pascal... or implement complementary functions, leaving the originals intact.

He said it was not possible to fix due to the way directx worked or something like that... Probably just to brush us off or maybe it's a limitation with the pascal's directx interface.
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#22 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 23 November 2009 - 10:15 PM

I'm not going to go into too much detail here, but the only reason why surfaces don't normally work in 3D (Mark, take note!) is because surface_set_target() and surface_reset_target() set the ZBuffer to NULL. So, what the DLL in this package does is add code to a few of the surface functions to give each surface its own ZBuffer. Otherwise, most of the surface management is done by GM.

@Jazza4Lyf: That's odd. Is Surface Fix in the used packages list?



So you've over ridden GM surface_set_target? made your own scripts with the same name so GM calls them (I like the fact that you can make script the same name as GM's and it calls them) and then they call a dll coded version, the dll packaged in the extention package? I asume.

Don't let us hanging. Share the concept.

It just alters the code of those functions directly - when the game loads, an initialization function is called which changes a few bytes in the surface functions so that they branch into some C++ code at certain points. It doesn't replace them - they're mostly left intact, aside from the few changes that the DLL makes. This is also why it only works with GM7 - I used hardcoded memory addresses which code is written directly into. It's faster (and in some cases, easier) than completely rewriting all of the surface functions. I'm going to make this open-source soon, so you'll see what I mean.

Good! Then I can finally use it ;) (If you don't mind releasing the .ged)

Still not working? Does GM have a limit on the maximum number of extension packages you can have installed or something? Yes, I will release the .GED. I'll also try to report this on the bug reporting system. I'm rather busy at the moment, though, but I'll try to release everything as soon as I can.
  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#23 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • GMC Member
  • 965 posts
  • Version:GM8

Posted 24 November 2009 - 11:14 PM

...

Still not working? Does GM have a limit on the maximum number of extension packages you can have installed or something? Yes, I will release the .GED. I'll also try to report this on the bug reporting system. I'm rather busy at the moment, though, but I'll try to release everything as soon as I can.


Now that's an idea...

EDIT: Nope, that's not the problem.

Edited by D1g1talAli3n, 25 November 2009 - 12:08 AM.

  • 0

Posted Image


#24 Recreate

Recreate

    Furry

  • GMC Member
  • 2992 posts
  • Version:GM:Studio

Posted 25 November 2009 - 04:57 AM

Woah Nice, I always dreamed about something like this. It would be pretty nice if it could be built into GM8.
  • 0

If the post that you are reading was created prior to 2011. For the safety of the general public, It is not to be regarded under any circumstances.
Please don't ask me to join your group at anything.


#25 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 25 November 2009 - 04:18 PM

Thanks for all of the positive comments, guys. I really appreciate it.

And, as I promised, Surface Fix is now open source. You need Visual C++ 2008 to build it. I just used the Express edition. There's a link to the source download in the main post. Also, I bumped the version number up to 1.1 because I optimized it a little and decreased the file size by about 2 kB. I also fixed a minor bug I found somewhere.

EDIT: Due to possible issues with the license I chose, I've taken down the source. I'll get it back up by the next release.

Edited by amd42, 03 December 2009 - 10:35 PM.

  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#26 IamCalle

IamCalle

    GMC Member

  • GMC Member
  • 444 posts

Posted 28 November 2009 - 06:16 AM

O-SHI*..!
This is above gold, thank you very much for this!

.... :whistle: Now I need to lay down for a while and re-think a few things. :wacko:


Again, thank you. :lol:
  • 0

#27 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 30 November 2009 - 07:48 AM

OK, Can you give a little hand? I can't get this thing to work

...


I'm trying to redirect the draw to a surface, then draw the surface on screen. But the moment I call d3d_start, it stops working. This is in the end step.


Can you make an example of what I want to do? I can't see the difference between what my code does and what your monitor does, aside from drawing the result on screen. As your monitor does work...

<solved gex confusion>

Edited by icuurd12b42, 01 December 2009 - 05:04 AM.

  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#28 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 30 November 2009 - 11:01 PM

The only thing with that code that could be causing issues is that you're calling d3d_end() before drawing the surface and everything. That would cause the surface to be destroyed.

Unfortunately, due to the way d3d_start() and d3d_end() work, it's impossible to alter their behavior without having to completely rewrite them (they reset the D3D device, which requires that all surfaces be freed first).

Of course, there also could be a bug in my code. I'll go take a look if you can't get it to work.

EDIT: Never mind, that's not it. It's probably a bug in my code somewhere.

EDIT 2: I figured it out! You need to clear the surface's depth buffer (use depth_clear()) and clear it to the background color (use draw_clear(background_color)) after calling surface_set_target(), and then you need to disable hidden surface removal (use d3d_set_hidden(false)) while drawing the surface to the screen.

Edited by amd42, 30 November 2009 - 11:48 PM.

  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#29 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 01 December 2009 - 12:23 AM

I tried it, I get the same blank screen.

I rarely ask for people looking at my code to fix it for me, but if you could honour me with your expertise....

Download Exodus.gmk


In the Exodus folder, vert_cam end step

I have a variable to turn the surface on and off. d3d_start is called only once, easily "coment-out-able". Without d3d_start it works but with no zbuffer, hiding my buildings behind the floor. With d3d_start it only works when surfacing is disabled.

<solved gex confusion>

Edited by icuurd12b42, 01 December 2009 - 05:04 AM.

  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#30 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 01 December 2009 - 02:09 AM

I tried it, I get the same blank screen.

I rarely ask for people looking at my code to fix it for me, but if you could honour me with your expertise....

Download Exodus.gmk


In the Exodus folder, vert_cam end step

I have a variable to turn the surface on and off. d3d_start is called only once, easily "coment-out-able". Without d3d_start it works but with no zbuffer, hiding my buildings behind the floor. With d3d_start it only works when surfacing is disabled.

You need to call depth_clear after you call surface_set_target(). So, erase line 4 and add
if (usesurface) depth_clear()
immediately after the line that calls surface_set_target().

I understand that the depth_clear() function is probably rather confusing. Just remember to call it whenever you call draw_clear() to clear a surface, and that's all you need to know.
  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#31 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 01 December 2009 - 02:31 AM

So it would look like this?

usesurface = false;
set_automatic_draw(false);
if(!d3d) d3d_start();
//d3d_set_hidden(true);
d3d = true;
if(usesurface) surf = surface_create(view_wview,view_hview);
if(usesurface) surface_set_target(surf)
if (usesurface) depth_clear()
draw_clear(c_green)
....

Did you try it? because that does not work.

<solved gex confusion>

Edited by icuurd12b42, 01 December 2009 - 05:05 AM.

  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#32 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 01 December 2009 - 03:21 AM

So it would look like this?

blah blah blah

Did you try it? because that does not work.

Yes, I tried it, and it worked. You need to uncomment that d3d_set_hidden(true); line (you need it), and then it should work. If not, try downloading the latest version - I recently upgraded it to 1.1 which had some bug fixes.
  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#33 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 01 December 2009 - 03:30 AM

OK, I installed the new version and it stil don;t work. Can you do me a favor and either PM me your updated end step code for vert_cam which you say works on your machine or post it here because I'm adding your suggested changes here and I get nothing working right. So instead of pasing tid bits of information I can resolve this in 5 seconds.

<solved gex confusion>

Edited by icuurd12b42, 01 December 2009 - 05:04 AM.

  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#34 Newly Discovered

Newly Discovered

    Harmonious Genius

  • GMC Member
  • 2475 posts
  • Version:GM8

Posted 01 December 2009 - 03:38 AM

wow, I'm really impressed what this is capable of. I've used surfaces for a long time now and I've used them in 3D, but had to deal with the problems it throws at me. I can't even imagine what effects we'll have for 3D now. You can render the screen to surface, scale it down and then back up, resulting in a blur. if you scale it only slightly, it should suffice as an AA effect. I mentioned the blur, which in return can be used for a bloom. Then a motion blur...which is ridiculously easy.

I'll play with this more later and see if I can get these to work.
  • 0

poof_sig.png


#35 slayer 64

slayer 64

    Slayer of gingers

  • GMC Member
  • 4301 posts
  • Version:GM:Studio

Posted 01 December 2009 - 05:13 AM

this is great! very easy to implement too. great job.
  • 0

5y5rs3d.pngfg0UQNL.png


#36 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 01 December 2009 - 11:27 PM

Thanks. I'm considering maybe adding more functions and features now. icuurd12b42 suggested getting surfaces working in the draw event, so maybe I'll work on that.

@Newly Discovered: If you can get any of those effects to work, send them to me and I'll add them as examples. I'll give you credit for them, of course. I'm especially interested in seeing something such as a bloom effect.
  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#37 hanson

hanson

    GMC Member

  • GMC Member
  • 444 posts
  • Version:GM8

Posted 02 December 2009 - 02:08 AM

Thanks for this! IT opens a TON of possibilities!
  • 0

#38 IamCalle

IamCalle

    GMC Member

  • GMC Member
  • 444 posts

Posted 02 December 2009 - 02:37 PM

Thanks. I'm considering maybe adding more functions and features now. icuurd12b42 suggested getting surfaces working in the draw event, so maybe I'll work on that.

@Newly Discovered: If you can get any of those effects to work, send them to me and I'll add them as examples. I'll give you credit for them, of course. I'm especially interested in seeing something such as a bloom effect.

Sounds great.
Even now the fix works great, and is a very fundamental part in my game engine.
If something like this is not included in GM 8, then I must beg you to make it work there as well. =)
  • 0

#39 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 03 December 2009 - 03:25 AM

Thanks. I'm considering maybe adding more functions and features now. icuurd12b42 suggested getting surfaces working in the draw event, so maybe I'll work on that.

@Newly Discovered: If you can get any of those effects to work, send them to me and I'll add them as examples. I'll give you credit for them, of course. I'm especially interested in seeing something such as a bloom effect.

Sounds great.
Even now the fix works great, and is a very fundamental part in my game engine.
If something like this is not included in GM 8, then I must beg you to make it work there as well. =)

After releasing the next version and making surfaces fully operational, I have plans to report this to YYG through the bug tracker, along with the exact details they will need to fix up surface support. If they choose to ignore it and not fix surfaces in GM 8, once the full version of GM 8 comes out I'll make a GM 8 version ASAP.
  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#40 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 03 December 2009 - 04:22 AM

After releasing the next version and making surfaces fully operational, I have plans to report this to YYG through the bug tracker, along with the exact details they will need to fix up surface support. If they choose to ignore it and not fix surfaces in GM 8, once the full version of GM 8 comes out I'll make a GM 8 version ASAP.


I reopened my bug report on deffective gm7 transition and z-buffer problem and refered him to this topic. Asking him to contact you if he wishes. But dont get your hopes up. Your fix will work in GM8 anyway once the GM compiled code is locked and the lib you use (if you do) is updated have the right pointers for GM8...
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#41 Newly Discovered

Newly Discovered

    Harmonious Genius

  • GMC Member
  • 2475 posts
  • Version:GM8

Posted 03 December 2009 - 10:59 AM

I had troubles setting up the ortho in the step event when redrawing the surfaces (for the blur effect) but...
I DID IT!

Here's blur (it adds a nice soft effect to the screen): http://host-a.net/Jo...torplusblur.gmk

AND (use your mouse wheel to adjust blur settings in both examples)

Here's motion blur: http://host-a.net/Jo...sMOTIONblur.gmk

Bloom was my first attempt, but this thing just hates blend modes. even using 0 0 (both normal) it still gave me problems.
I took out the blend modes leaving the blur. In the blur, obj_info draw event, you'll see I'm drawing the surface alpha with blur/10.
This gives it the softness. If you change it to 1 it'll be a complete blur. Someone can play with the blend modes to set up the bloom.

I hope to see more awesome effects like these, not only in this topic, but in our games too!
A big thanks to amd42 for providing this awesome dll and example.

Enjoy!

A side note on thinking, I bet we could come up with an amazing water reflection effect using the same method you did for your monitor.  You're basically setting a parent object and drawing every object with that parent to the surface.  Do the same for a water surface.  You'd have to draw it from from another perspective I would assume, but if you set it up right and actually get it working, you could also distort the surface using some sort of alpha mask water animation (I've see it on the forum before).  I think this would be an excellent example and would make realtime reflections a possibility.  Just a thought.

Edited by Newly Discovered, 03 December 2009 - 11:37 AM.

  • 0

poof_sig.png


#42 IamCalle

IamCalle

    GMC Member

  • GMC Member
  • 444 posts

Posted 03 December 2009 - 01:58 PM

That is real smooth, nice. =)
Edit:
I keep thinking on heat waves and then shadows, as two of many things to explore.
The shadow topic is of course a big one, but worth looking into in my opinion.

Edited by IamCalle, 03 December 2009 - 02:02 PM.

  • 0

#43 IamCalle

IamCalle

    GMC Member

  • GMC Member
  • 444 posts

Posted 03 December 2009 - 02:02 PM

(ignore this <_< )

Edited by IamCalle, 03 December 2009 - 02:03 PM.

  • 0

#44 saulc12

saulc12

    GMC Member

  • New Member
  • 15 posts

Posted 03 December 2009 - 03:59 PM

Any chance you could extend this fix to deal with the problems related to using surfaces with NVidia hardware - really could use something to fix this. Very impressed with this and thanks for making it available. Hope it does get incorporated into GM8, but it would be nice if it could fix the hardware compatability issues too :-)
  • 0

#45 hanson

hanson

    GMC Member

  • GMC Member
  • 444 posts
  • Version:GM8

Posted 03 December 2009 - 05:52 PM

Woohoo! Nice post-render effects possible now. I like the blurring, Newly Discovered! I'll definitely contribute some effects for general use as I make 'em - I think it would be neat to have a user created post-processing library of effects to add to our games.
Here's a simple one that distorts the screen with a sine wave:
http://host-a.net/ha...torpluswavy.gmk
(Nobody is required to give me credit - use/hack it/change it/sell it if you want)

Also, heat waves would be possible with something similar to this. The problem would be setting an alpha map based on occluding geometry...

-hanson

Edited by hanson, 03 December 2009 - 05:55 PM.

  • 0

#46 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 03 December 2009 - 09:56 PM

I had troubles setting up the ortho in the step event when redrawing the surfaces (for the blur effect) but...
I DID IT!

Here's blur (it adds a nice soft effect to the screen): http://host-a.net/Jo...torplusblur.gmk

AND (use your mouse wheel to adjust blur settings in both examples)

Here's motion blur: http://host-a.net/Jo...sMOTIONblur.gmk

Bloom was my first attempt, but this thing just hates blend modes. even using 0 0 (both normal) it still gave me problems.
I took out the blend modes leaving the blur. In the blur, obj_info draw event, you'll see I'm drawing the surface alpha with blur/10.
This gives it the softness. If you change it to 1 it'll be a complete blur. Someone can play with the blend modes to set up the bloom.

I hope to see more awesome effects like these, not only in this topic, but in our games too!
A big thanks to amd42 for providing this awesome dll and example.

Enjoy!

A side note on thinking, I bet we could come up with an amazing water reflection effect using the same method you did for your monitor.  You're basically setting a parent object and drawing every object with that parent to the surface.  Do the same for a water surface.  You'd have to draw it from from another perspective I would assume, but if you set it up right and actually get it working, you could also distort the surface using some sort of alpha mask water animation (I've see it on the forum before).  I think this would be an excellent example and would make realtime reflections a possibility.  Just a thought.

Great job on the effects! Both run at full speed on my computer, and I have old hardware, too. I remember that my friend once sent me a game he made which used motion blur effects a lot (with background_create_from_screen), and it ran so slowly that I was unable to play it. I'm hoping that more advanced effects can now be created. I'll be making those into examples, and I'll give you full credit.

A realistic water thing would be really cool. I tried making a mirror thing once, but I couldn't get it working right because I'm not very good with 3D math and I'm not sure how to calculate the UV coords so that it looks right.
  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#47 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 03 December 2009 - 10:05 PM

Woohoo! Nice post-render effects possible now. I like the blurring, Newly Discovered! I'll definitely contribute some effects for general use as I make 'em - I think it would be neat to have a user created post-processing library of effects to add to our games.
Here's a simple one that distorts the screen with a sine wave:
http://host-a.net/ha...torpluswavy.gmk
(Nobody is required to give me credit - use/hack it/change it/sell it if you want)

Also, heat waves would be possible with something similar to this. The problem would be setting an alpha map based on occluding geometry...

-hanson

Good job - that looks pretty neat. I'll add it as an example.

I'm considering maybe making some sort of post-render effect system using scripts. It would allow you to easily use post-render effects defined in scripts and even chain them together. The only problem is that it might be too limiting for most effects.
  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949

#48 IamCalle

IamCalle

    GMC Member

  • GMC Member
  • 444 posts

Posted 03 December 2009 - 10:16 PM

I believe that would be useful to users with more limited capabilities.
I think those of us who feel they can handle surfaces in 3D mode are also able to organize things for themselves.

Yet again; I may be wrong, and it won't hurt making that system anyway.
  • 0

#49 IamCalle

IamCalle

    GMC Member

  • GMC Member
  • 444 posts

Posted 03 December 2009 - 10:22 PM

All these effecta... To much awesome in to short amount of time *Explodes*

<_< Yep, this came like a bomb from a clear sky on most of us, I think.
  • 0

#50 amd42

amd42

    GMC Member

  • GMC Member
  • 269 posts
  • Version:GM8

Posted 03 December 2009 - 10:37 PM

I believe that would be useful to users with more limited capabilities.
I think those of us who feel they can handle surfaces in 3D mode are also able to organize things for themselves.

Yet again; I may be wrong, and it won't hurt making that system anyway.

Yeah, I'm probably not going to do it. It would be too limiting.
  • 0
"Computers in the future may weigh no more than 1.5 tons." - Popular Mechanics, 1949