Jump to content


Photo

Terrain Decal Mapping


  • Please log in to reply
9 replies to this topic

#1 hanson

hanson

    GMC Member

  • GMC Member
  • 444 posts
  • Version:GM8

Posted 22 October 2009 - 02:45 AM

I had the idea the other day for creating shadow wrapped to terrain. I kind put it off until a came upon a topic requesting such a thing, and decided it was time to put my ideas into a program. I do not plan to develop this any further, but am sharing the result here for anyone to use. No credit is required, though I wouldn't mind a thank-you if it's used. Enjoy!


Download latest gm6
Or, for the sake of comparison or whatever you might want the old version for...
original gm6


Posted Image


-hanson

Edit: There was a slight problem where I forgot to set matching resolutions in the example. It still worked, but same resolutions looks way better. I also fixed it to make the "decal" stretch the sprite over the whole portion. Screenshot has been updated to reflect this change.

Edited by hanson, 23 October 2009 - 02:39 PM.

  • 0

#2 Newly Discovered

Newly Discovered

    Harmonious Genius

  • GMC Member
  • 2475 posts
  • Version:GM8

Posted 22 October 2009 - 05:59 AM

whoa, cool! it ran great here, but I'm not sure what the 500x500 is for, or the x and y res...could you explain what they do?
I messed with them a bit but I still don't get it.

anyway, nice job.
  • 0

poof_sig.png


#3 hanson

hanson

    GMC Member

  • GMC Member
  • 444 posts
  • Version:GM8

Posted 22 October 2009 - 02:30 PM

The 500x500 is the size of the model complete created. x and y res are the resolution of the model, the number of points on the x any y axis respectively. Higher res values == higher resolution model. I didn't make a perfect interpolation script to you may get a few bumps, but that's what the smooth_grid function is for. I didn't get a chance to fix the texture coords to only use one sprite when drawing the decal - If I have a chance I'll do that otherwise it's not too hard to fix yourself if you understand what's going on.

-hanson
  • 0

#4 freko

freko

    The Professional

  • GMC Member
  • 504 posts
  • Version:GM8

Posted 23 October 2009 - 04:58 AM

You did.
So its finally done. Its so smooth & works like a charm. Thank you Hanson.

I will learn form this and experiment on this. Thanks again for this
  • 0

#5 hanson

hanson

    GMC Member

  • GMC Member
  • 444 posts
  • Version:GM8

Posted 23 October 2009 - 02:43 PM

Thanks ^_^ I just fixed a resolution issue I had in the example which caused intersection(decal was lower res than terrain), and made it so it stretches the sprite.

-hanson
  • 0

#6 freko

freko

    The Professional

  • GMC Member
  • 504 posts
  • Version:GM8

Posted 23 October 2009 - 03:42 PM

Sweet
  • 0

#7 RamboFox

RamboFox

    Tainted Fortune

  • New Member
  • 992 posts

Posted 01 November 2009 - 10:42 AM

Very nice, but why the hell are the normals upside-down?
  • 0

#8 hanson

hanson

    GMC Member

  • GMC Member
  • 444 posts
  • Version:GM8

Posted 04 November 2009 - 04:59 AM

Thanks :D
Normals are messed up because I didn't take the time to do anything with 'em
  • 0

#9 paperofme

paperofme

    GMC Member

  • New Member
  • 66 posts

Posted 09 January 2010 - 06:31 PM

broken link
  • 0
//looks good
if looks_good=false game_suicide()

//looks bad
if looks_good=true show_messange("LIAR!")

#10 hanson

hanson

    GMC Member

  • GMC Member
  • 444 posts
  • Version:GM8

Posted 09 January 2010 - 07:29 PM

Works for me. It's not a direct link, so make sure you go to the host-a page it sends you to
  • 0