Search Result

  • RE: SHADER Toolkit. Discussions, examples and other cool stuff!

    It's not about generating character shadows. At all. It's about the open GL Shader in general. We were talking about applying shader effects to specified scene objects &/or characters.The[i]entire[/i] thread though is about the [b]shader[/b] in [i]general[/i].@ Simon: there's some funny stuff happens when you try applying certain effects to objects/animations. Some of the effects complete hide the object/animation & some of them draw the entire objects shape (background in one color, alpha with corrupted version of the effect).

    by afrlme, 10 years ago

    51
    0
    afrlme 10 years ago
  • RE: SHADER Toolkit. Discussions, examples and other cool stuff!

    I think the best approach might be to create the effects & shader stuff internally & just provide people with some parameters for each one. Like Construct2 for example, from what I've seen it comes with various shader functions in action parts that you can set options for & choose what to apply it to.It would be safer than letting people mess about with the shader code itself. Someone creates an effect with an action part then it gets added to a table which automatically gets deleted after x loops, time passed - if not set to infinite loop, or something.I'm not sure if that would mean more work for you or less, or be more or less complicated. I find the GSL code quite confusing for my short term memory brain. :D

    by afrlme, 10 years ago

    51
    0
    afrlme 10 years ago
  • RE: SHADER Toolkit. Discussions, examples and other cool stuff!

    Some effects work, some do not. Problem is I have to rewrite big portions of the script to make these possible. Saturation, lightness and such have the problem, that they are applied at the end of the chain, so I would need at least 2 copies of the shader and also a possibility to control both seperately. Blur and glow are adding to the problem that these are multipass effects and I also need to be careful with bleeding on the edge... The glow is just copying the colors and filtering them so only the bright colors are left, then just a blur on that and add it to the screen.

    by SimonS, 10 years ago

    51
    0
    SimonS 10 years ago
  • RE: SHADER Toolkit. Discussions, examples and other cool stuff!

    OK I think I got it cheers. :)We can do this for most of the shader effects apart from blur & glow? Are we allowed to apply other effects such as saturation, lightness?I think blur & glow would be nice effects to add to individual scene objects/characters - well at some point. I'm sure someone would find uses for it. The current glow is a bit too general as it automatically affects certain parts of scenes, but I'm not sure what it uses to determine which parts.

    by afrlme, 10 years ago

    51
    0
    afrlme 10 years ago
  • RE: SHADER Toolkit. Discussions, examples and other cool stuff!

    [code]local eff="ripple1" -- effect name-- the following lines are to make sure the shader is compiled, -- a shader is mini program, that needs to be compiled to use itshaderAddEffect(eff)shaderRemoveEffect(eff)-- this is a standard setting, the shader has a variable that is called strength, we set that to 1shader_effects[eff].num.strength=1-- also for any animation inside the shader, it needs the time, -- so we bind the variable time in the shader to our timebind(eff, "time", field("shader_iTime"))--[[ that is tricky, it contains the settings for something we could call "effect channel", like in an audio mixer, send to channel 1 or such. So we say use the shader "eff" and composition method 5 and 4, list of methods here:0 GL_ZERO1 GL_ONE2 GL_SRC_COLOR3 GL_ONE_MINUS_SRC_COLOR4 GL_SRC_ALPHA5 GL_ONE_MINUS_SRC_ALPHA6 GL_DST_ALPHA7 GL_ONE_MINUS_DST_ALPHA8 GL_DST_COLOR9 GL_ONE_MINUS_DST_COLOR10 GL_SRC_ALPHA_SATURATEthe comp dst means what of the destination goes into the equationand comp src the same for source. So we use the alpha channel of the source image (GL_SRC_ALPHA) and for the destination the inverse (GL_ONE_MINUS_SRC_ALPHA).Destination means our surface, source is the image we are drawing.If we use GL_ONE, GL_ONE you will see that image is like blended onto the surface because the colors are added. ]]shaderSetOptions({{shader = shader_effects[eff].num(), comp_dst=5, comp_src=4 }}, 1)-- simplest thing of them, set the object "target_object" to the effect channel 1Objects.target_object.ShaderSet = 1[/code]

    by SimonS, 10 years ago

    51
    0
    SimonS 10 years ago
  • RE: SHADER Toolkit. Discussions, examples and other cool stuff!

    Simon could you please break down what you've written into clean syntax so we can understand what you have just written?I get the first, second & third lines. Not sure why you added both shaderAdd & shaderRemove effect though. Rest is a little unclear.@ Unreal: game.ShaderExclude is just for preventing the shader from affecting certain things like interfaces, the mouse cursor, displayed text etc.Let's say you applied shader lighting effects (spotlights) to various places of your scene which would automatically make certain parts of your scene dark, but without excluding certain things from the shader, the mouse cursor & text etc would also end up light/dark/tinted in certain parts of the scene, meaning you might not be able to see them properly.If Simon breaks down the syntax for applying shader effects to objects for me then I might create a function that simplifies it, when I get a bit of time.

    by afrlme, 10 years ago

    51
    0
    afrlme 10 years ago
  • RE: SHADER Toolkit. Discussions, examples and other cool stuff!

    Yep, possible, but depends on the effect.Most of the additional effects can be used like this:[code]local eff="ripple1"shaderAddEffect(eff)shaderRemoveEffect(eff)shader_effects[eff].num.strength=1bind(eff, "time", field("shader_iTime"))shaderSetOptions({{shader = shader_effects[eff].num(), comp_dst=5, comp_src=4 }}, 1)Objects.target_object.ShaderSet = 1[/code]Change the target_object to your objects name an ripple1 to the desired effect. Should create a nice ripple, good for some lake.The other effects require some rework to the script. Blur and glow are not possible with the current version, don't know if I do that in the future.

    by SimonS, 10 years ago

    51
    0
    SimonS 10 years ago
  • RE: Snoop Animation

    [url=http://wiki.visionaire-tracker.net/wiki/Hotspots_(h2)]http://wiki.visionaire-tracker.net/wiki/Hotspots_(h2)[/url]New .ved & tutorial created the day. Hold space to show hotspot animations & release space to hide hotspot animations. All scene objects can be interacted with via the left mouse button.P.S: sorry in advance if it all looks a bit dark. I was also messing about with some shader lighting effects - well more trying to wrap my head around them. It looked ok in my laptop monitor but a bit dark on my secondary monitor.

    by afrlme, 10 years ago

    20
    0
    afrlme 10 years ago
  • RE: Shader Effect

    You can already do that with lightmaps or the CharacterTint data structure table which allows you to tint the character. Or do you mean in a more dynamic way where character lighting is affected based on characters position from a light source?The latter would probably be done via normal maps/depth maps which we currently don't support.I suppose you could use the shader spotlight effect to place multiple light sources around a room which will render the rest of the scene darker in places that the light does not extend which would also affect your character as he passes through light & darkness.I've not tried doing anything like that yet, but I assume it would probably look ok.

    by afrlme, 10 years ago

    6
    0
    afrlme 10 years ago
  • Shader Effect

    Hi,Can i use the shader effect only for the character?e.g. when is dark outside, change the lightness of the character.Thanks

    by ke4, 10 years ago

    6
    0
    ke4 10 years ago