Heightmap plus: phong model, alpha support

This forum is currently in read-only mode.
From the Asset Store
Comprehensive localization solution for Construct 3 projects, no addons required!
  • I just wrote an updated Heightmap effect.

    It shades the underying image using a heightmap-derived (grayscale, white is high) bumpmap. Alpha is taken into account, so transparent parts of the heightmap do nothing to the underlying image.

    Also, specular spot size and intensity are done as in the phong model.

    I see some strange glitchyness in my videocard (vertical flickering lines) so please test it out, it may be a bug in my video drivers.

    Heightmap plus Beta 1


  • Yes. Many thx to you kind madster. Gonna try this out right now!

  • Im seeing some lines on the sprite as it gets closer to layout 0 x,y.

    Is there a way to add color to the light?

  • the result doesn't look the same in the runtime as it does in the IDE.

    <img src="http://dl.dropbox.com/u/1010927/HMPlusRuntime.png">

    <img src="http://dl.dropbox.com/u/1010927/MNplusIDE.png">

    Please make this work, I love heightmap.

  • sadly i'm still a bit confused on what the coordinates mean in effects. Yeah they seem to be different in the IDE and in the runtime. 0 is top-left and 1 is bottom-right though.

    What puzzles me is those flickering lines. I can't imagine why they come up.

    EDIT: Just figured out the bug with the coordinates!! It's actually a Construct bug. The ide uses coordinates for the layout area where 0 is top-left and 1 is bottom-right... but that's the layout AREA, not just the layout! To test this out, hold mouse wheel and drag around.... and watch the objects lighting change.

    I also noticed that it looks glitchy in the IDE unless I'm zoomed... so it's probably some kind of sampling alias.... I'll move the samples around, see what happens.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Fixed! (and reuploaded to the same location).

    changed foreground sampling from half a screen-space texel in each direction to a whole screen-space texel. No idea why this was an issue, but works for me now.

    Also: since there is no info available on texture size or object-space texels, the resulting angles depend on the size of the object =(

    So, if you change your objects size, be sure to adjust the depth of the effect to compensate.

  • Demo using an asteroids game I'm working on:


    Light follows the mouse.

    Bugfix: light direction was vertically inverted.

  • this is awesome mad

    this revives my heightmapping in my game

    which severely downgraded the look I hoping for when I first realized you can't do alpha

    thanks for this

  • How do I download this?

  • Just copy the link out, if it opens as a text file do a Ctrl+S in your browser and save the FX file.

  • This doesnt work

  • This doesnt work

    It does.

    Open THIS LINK in your browser. Copy the text from the browser or 'save as' text to your Contruct Classic/Effects folder. It should work then.


  • The problem is that it was saving some HTML bits at the beginning and at the end of the code, after removing these it worked

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)