Realtime raytracing in GM? [demo]

Posted by Gordy on Dec. 28, 2011, 5:29 p.m.

well, no; more like, realtime lightmapping.

so, last night i was playing around with a lighting engine i made, and decided to bring it into gm3d. at first i was using the trangle fan, raytrace method, or whatever, but, that's slow as shit.

so, instead i came up with something else and holy hell, it's awesome.

also, the game engine is mine, but teknogame's Action Fists is my source of sprites and inspiration.

so, lookey!

all the lights are realtime, the only drawback is that adding motion to them slows the system down; but they're free to flicker, fade in and out, and change color all in realtime.

hmm, nothing much else to say, just wanted to show you guys.

edit:

though i'd upload a quick demo to show you guys!

(there are a few bugs with the game and i'm aware off nearly all of them, but if you find any, please post!)

download here!

w,a,s,d to move. move mouse to adjust view.

space to jump.

f1 to toggle debug data, esc to view menu.

z to interact with things (you'll see a word appear)

so, collect the keys, grab gems, and get the big diamond!

(be sure to grab a blue magnesium thing from the lamps! (press z when "extinguish" appears))

also, mobs will only chase you if you're in the dark.

Comments

OL 12 years, 4 months ago

Reminds me of something xot worked on:

http://www.gmlscripts.com/forums/viewtopic.php?id=1574

Astryl 12 years, 4 months ago

I clicked on this blog with the intention of commenting "In your dreams, kid" until I saw who was blogging. And then I saw the pictures, and actually read the blog.

You get +1. Also, can we have the scripts at some point, just out of interest?

Gordy 12 years, 4 months ago

@OL, xot's scripts where what my original light engine was based off of, but trying to salvage scripts from it and convert it to 3d was an absolute nightmare.

@Mega, i do intend to release the scripts, although, i plan to abuse this in almost all of my upcoming games, so, it won't be until after they're released.

i'll try to upload a video so you guys can see it in action, it's quite the spectacle.

sirxemic 12 years, 4 months ago

Ok so I took a quick glance at that thing xot made, and I have to say - smart and impressive! How is what you are doing different from Xot's, though?

Furthermore, the fact that it's grid-based kind of reminded me of this -

http://www.youtube.com/watch?v=fAsg_xNzhcQ

Gordy 12 years, 4 months ago

xot uses d3d transformations to generate shadows, and draws them all to a big surface; i do about the same thing, just with a different transform and different technique.

oh, and the light engine isn't restricted to a grid, i'm just lazy and haven't made any complex level geometry.

and actually, ambient occlusion is generated with my engine, you just can't see it well because of the hard shadows.

sirxemic 12 years, 4 months ago

Okay okay :) I am interested in your methods. Xot's one was already pretty difficult to understand but I got the general idea at least :P

Oh and Xot's thingy got me FPS from 15 to 30, is your method faster by any chance?

Gordy 12 years, 4 months ago

just posted a quick level demo! (bottom of the blog)

check it out and offer your feedback, i'd love to hear it!

gosh, i was up until 5am working on this.. time for bed.

edit: also, if any of you are good with chiptune/8bit music / sound effects, i could really use some help!