oppenheimer's Recent Forum Activity

  • sogen - why do you think PSD import will be of any use? i can't imagine a usecase where one really needs it. stick to PNG and everything is fine!

  • R0J0hound

    Interesting! I encountered artifacts as i tried to build a cartesian to polar mapper, which tries to sample some points out of the box area at times. Maybe it has something to do with the extended box... dunno.

    Btw. a first experiment showed, that your outline shader with outline only set to 1 works pretty good as a photoshop style "glow". Just in case somebody likes to try ;)

  • sogen - that advanced text object would be definately useful. especially if we can have css for it ;)

    R0J0hound Ashley - Well, in addition to my last post, i should clarify that it's not my intend to have a color parameter alone. The 3 vector types would be smart, too.

    edit: grammar <img src="smileys/smiley32.gif" border="0" align="middle" />

  • Ashley - So a game developer who targets desktop/browser apps has the same restrictions in shader usage as a mobile developer. Maybe a concept where the dev has the option to specify a certain glsl version would be good. The shader xml has to contain a param to define this gl version then. This would be flexible solution for multitarget exports.

    I can imagine that it means a lot of work for you, but to be really future proof (regarding mobile hardware as well), it's inevitable to open up the options a bit.

    Speaking of options.. The same way fragment shaders are implemented, it should be possible to include vertex shaders. Back in 2009 you stated "What can you usefully do with four vertices?" speaking about CC. There we had the opportunity to distort the vertices via events. Kinda bottlenecked, but it was possible. With a vertex shader it should be possible to adaptively add more vertices to an object. You claim that C2 is not a 3D software, but again i think, that you should open up the possibilites for the user a little bit more. Think of how much bandwidth will be saved if a user wants to add a 3d model with one texture instead of a precomputed sprite sheet.

    Concerning your last question, i can't think of further params to be included. But the 3 vector types (and arrays perhaps) would be pretty useful imho.

  • Joannesalfa

    First of all, it is a good idea to have a look into the shaders.js when you get errors. In chrome you can do this by pressing ctrl+shift+i. Go to the tab named "Sources", then "shaders.js". The specific error you encountered is present at Line 19, because the first line just initialzes the following code for C2.

    "Varying" variables can't be altered at runtime, so therefore you get that error. To bypass it you can simply define a new vec2 variable after "void main( void ) {" like this:

    vec2 myPos = position;

    then just replace the following "position" variable with "myPos".

    One further suggestion when copy-pasting:

    glsl es 1.0 is VERY strict, so you should always check the code for possible errors beforehand, otherwise Chrome will make you go nuts. For example if you define a float variable like this:

    float myFloat = 1;

    you will get an error because 1 is not a float. Write 1.0 instead.

    another popular one:

    gl_FragColor is a vec4(). So if you pass a vec3 to it (just rgb for example), you'll get an error.

    gl_FragColor = vec3(1.0, 1.0, 1.0); // <- wrong

    gl_FragColor = vec4(1.0, 1.0, 1.0, 0.5); // <- right

    following code is possible, too:

    vec3 RGBcolor = vec3(1.0, 1.0, 1.0);

    gl_FragColor = vec4(RGBcolor, 0.5);

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley

    Currently i'm pretty much into web gl sahder writing.. at least i try. But still there are some things a bit unclear to me. For example which version of glsl es are we dealing with, my guess is 1.0 because you pointed to page 3 and 4 of the reference card.

    That brings me to the question if there is any chance to raise this in the near future, because in 1.0 one has to struggle with a lot of limitations (e.g. array initializing, loops etc.).

    Another suggestion would be to elaborate a bit more on the pre-defined parameters we can use in shaders. Right now the template.fx speaks of seconds, pixelWidth, pixelHeight etc.. Is that everything? In the file "glwrap.js" there is one additional parameter "LayerScale". Might this be useful to include it into the template?

    How difficult would it be to implement furthers params we can use? As i already suggested it would be awesome to pass vector values (vec2, vec3, vec4) on the fly.

    Thanks for your reply! <img src="smileys/smiley2.gif" border="0" align="middle" />

  • R0J0hound

    just a little question: why did you set extend-box parameters in the xml to zero? i'd expect a bit more for standard outlines like up to 8 to 16 perhaps.

    On the other hand one can extend the transparent area around a sprite to the specified outline width. I thought it'll be a useful hint for some people <img src="smileys/smiley17.gif" border="0" align="middle" />

  • lemo thanks! im a newbie to glsl es, but i try my best to come up with something useful. and thanks for pointing me to the outline shader; maybe we can achieve a glow with that and a simple blur?

    just yesterday i realized that there are 2 simple glow shaders in the effects dir, horizontal and vertical. i'll see, if it can be improved somehow (radius etc.) <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Joannesalfa

    well, you can't just replace the sampler name. the shader toy has some built variables which will not work in C2.

    For example "uniform float time;" would be "uniform float seconds;" in C2. Take a look at the "template.fx" and "template.xml" from the sdk. Some of those special variables are explained there.

  • Android-Music

    1) the behind glow should be pretty easy to code, i'll look into it.

    2) personally i like to have a blur filter with more quality (steps). a parameter to determine the radius is obligatory. i'm on that currently. a glow filter is exactly the same, except it is blended additively.

    3) grain size should be possible, although you could simply add a pixelize filter. how do you imagine a speed parameter?

    4) a fake motion blur is possible if we have an angular blur. it's also in the pipeline ;)

  • R0J0hound Ashley

    Exactly. Currently, it's unnecessarily time-consuming for the coder and for the users to set/edit these values. Let's face it. The majority of the shaders we write deal with colors, so a quick access to those is really important.

    I even tried to pack RGBA values into a single float just to pass it to the shader in one parameter, but that overcomplicates the event handling for the user imho.

    To take this a step further it would be absolutey useful to pass array values to shaders (I'm thinking of gradients or kernels). Though I don't know if that's even possible... maybe comma-separated.

  • maybe the outline shader by R0J0hound is of interest.

    i made a small capx which shows the outline with a mouse over effect.

oppenheimer's avatar

oppenheimer

Member since 17 May, 2011

Twitter
oppenheimer has 1 followers

Trophy Case

  • 13-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies