Kaisirak's Recent Forum Activity

  • 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

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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

Kaisirak's avatar

Kaisirak

Member since 14 Aug, 2012

None one is following Kaisirak yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies