[r161] Bumpmapping

0 favourites
  • 12 posts
  • Link to .capx file (required! If link is blocked remove the http and www parts):

    bumpmap with tilemaps.capx

    Steps to reproduce:

    1. Move mouse around over tilemaps on the left and sprites on the right

    2.

    3.

    Observed result:

    No idea what's going on here :D

    Comparing to sprites, bumpmapping effects acts like crazy on tilemaps and Tiled Background.

    First of all Bumpmapping acts different on these object having various size and position.

    and second - more important, bumpmapping is inverted on Y axis - but only with Y position. "Illumination" follows mouse properly.

    I mean if you follow mouse from bottom of tilemap in up direction you can see that edges of bricks on texture are brighter - but actual light comes from upper direction. Same opposite moving mouse top to bottom. Upper edge of bricks is brighter while light comes from down.

    Y axis on bumpmapping texture is set correctly, because I've been testing it with sprites at first and then moved to Tiled Background and Tilemap.

    Expected result:

    Bumpmapping working exactly the same way on all objects.

    Browsers affected:

    Chrome: yes

    Firefox: -

    Internet Explorer: yes

    Operating system & service pack:

    Win 7 64bit sp1

    Construct 2 version:

    r161

  • The bug still exists in [r163]. And it seems like it affects every shader using vTex for sampling.

    Update: Turns out it's the <extend-box-vertical> and <extend-box-horizontal> that are broken when you set their value at anything but 0.

    vTex.x = 1.0 and vTex.y = 1.0 used to mean bottom right corner, but it seems to be reversed now, and now points to top right.

    On top of that, shaders specific to a game object seem to receive the vTex.y from the layer they are in world space, not from the pixel in object space.

    Here is an example file: http://www.mediafire.com/download/uwqa8 ... ndcapx.rar

    TL;DR: vTex.y now 1.0 - vTex.y and is received as layer vTex instead of object vTex but only when setting <extend-box-vertical> or <extend-box-horizontal> to anything other than 0

  • I haven't posted it as a new bug report, but maybe I should ?

  • Kaisirak I don thinks it's necessary. It all seems connected.

    Let me Just use Ashley - to let him know about this.

  • shinkan, it seems your summoning powers aren't as strong as you thought.

    Let me give it a try. Ashley I summon thee

  • We are aware of all bug reports posted here. Please allow us enough time to investigate. We are currently busy with multiplayer features which might increase the time it takes to investigate new reports.

  • No sweat Ashley, just making sure you know about it since it's such an integral part of C2, and I have been really invested in writing a bunch of shaders lately.

    Keep up the great work

  • This is a callback to a problem from rev161, mentioned here: r161-bumpmapping_t95603

    After many updates, the problem is still there. When you set either extend-box-horizontal or extend-box-vertical to any value other than 0, your shader will not work as intended. vTex.y coordinates get flipped upside down and the borders of the image in the shader seem to extend way beyond the image's actual borders.

    I created two videos to illustrate this, a shader that simulates a tree bending left and right periodically, and with more intensity the farther the pixel is from the root. The only difference in the two videos, is that I changed the extend-box-horizontal in the shader from 0 to 5.

    Working like it should http://youtu.be/Kzpgi4Z6YUc

    NOT working http://youtu.be/ml5X0IB7Kes

    Problem exists at least in the previewer, once exported, on firefox, chrome and node webkit

  • Oops, maybe I jumped the gun here.. looks like you guys may have identified my problem too, which I've first noticed in R165:

  • remy-jay Unfortunately this issue is present since WebGL shaders was added to C2 and probably won't be fixed any time soon.

  • Boo-urns shinkan, thanks for the heads up

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Closing as duplicate of https://www.scirra.com/forum/r192-bumpmap-shader-on-tiled-background-goes-nuts_t122118 which appears to provide a clearer repro so favouring that issue over this one.

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