Kaisirak's Forum Posts

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah except for the fact that I created two videos, explained the problem in details, and linked to a thread where the problem was discussed and where I posted a capx also showing and explaining the problem.

    But thanks for your input

  • 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

  • Ashley, thanks, actually that's what I was using but in a Dictionary to make it less confusing in big expressions

  • Ashley, let's say this is working as intended (getting the canva's height is basically useless since the actual coordinates don't change), how do I access the REAL project window's height short of entering it manually in a variable or dictionnary or whatever (meaning I have to input it twice) ?

  • Problem Description

    windowHeight doesn't seem to work, at least in letterbox mode, windowHeight gives the size of the viewport instead of giving the height of the project

    Capx: http://www.mediafire.com/download/5d3j0 ... eight.capx

    Expected Result

    I expect windowHeight to give the project's window Height, not the browser's window Height.

    Or at least get access to a projectWindowHeight parameter

    Construct 2 Version ID

    r163

  • 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

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

    Let me give it a try. Ashley I summon thee

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

  • I had the same problem when running your capx, and it seems that setting it to disabled from events doesn't work either. It seems to compute the average of the two positions.

    Definitely a bug

  • It depends on how you use them, using them as they are is simpler for me, but I get where you're coming from.

    It's probably a matter of implementation, and you'll have to wait for Ashley for this.

  • Yeah there is definitely a discrepancy with the way viewOrigin and scroll work in scirra, however I think viewOrigin makes more sense in the way it handles coordinates.

    0,0 should be the top left corner, scroll.x should be the left viewport origin and scroll.y the top viewport origin.

    It's a problem of consistency

    If you want to see what is given to the shader with viewOrigin, replace scrollx by ViewportLeft(0) and scrolly by ViewportTop(0) in your capx.

    I haven't tested it, but I'm pretty sure the way construct handles the layer angle is by rotating it from the middle of the layout, and since viewOrigin is the top left corner of the layer, the values change. But you can use the uniform layerAngle and derive the rotation matrix like so:

    where mid is the center of rotation

    |x'| = cos(layerAngle) * (vTex.x - mid) + sin(layerAngle) * (vTex.y - mid) + mid

    |y'| = cos(layerAngle) * (vTex.y - mid) - sin(layerAngle) * (vTex.x - mid) + mid

  • 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

  • Projects with webgl effects that worked before updating now show this when I try them: "Uncaught ReferenceError: viewLeft is not defined" in layout.js line 1663

    This happens only when using a shader not made by Scirra but Brad Larson, Evan Wallace or myself for example (the stretch or swirl effect for instance or any custom made shader)

    UPDATE: It would appear that changing <extend-box-horizontal>0</extend-box-horizontal>   to any value other than 0 and restarting construct 2 solves this problem. So my guess is when checking the for the vec2 origin, origin.x is set to null instead of 0

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack: windows 7 64x

    Construct 2 version: r160