Search Result

  • RE: [SOLVED] Value to Shader Uniform

    Thanks so far. I have a few Questions about that:[list=1][*] Although I have the Shader Toolkit in my Project, but this particular Shader is in its own little Script, so I don't exactly know whether this as "using the shadertoolkit" or not.[*] Where exactly would I insert the suggested Line? In the Shader-Part, or in the LUA-Part? And should it be called once or rather repeatedly?[*] So, in the suggested Line, "ripple1" is the name of the Shader, which in my Case would be "daynight". What exactly would be ".num.frequency"? "num" I have seen defined in the Shader Toolkit, but I have no Idea whether that has anything to do with my Script -- I guess not? And "frequency" I suppose would be a Flat/Int defined somewhere in the Shader Script? (As a Uniform?)[*] And if my Protagonist has the Value "Daylight", I suppose in my Case "Values.value.Int" would be "Values.Daylight.Int"?[/list]For Completion's Sake and to maybe make helping me a little easier, here is my little Script:[code]shader_effects["daynight"] = {shader=basic_fsh..[[float x = iGlobalTime * 0.5;// This should be changed to go along with the Value "Daylight"float pi = 3.1415926535897932384626433832795;float R = (0.75+sin((x-3)*0.5*pi + cos((x-3)*0.5*pi))*0.25);float G = (0.75+0.125+cos(x*0.5*pi)*0.125);float B = (0.75+0.125+cos(x*1.0*pi)*0.125);void main(){vec3 base = texture2D(iChannel0, texcoord.xy).rgb;gl_FragColor = vec4(base.r*R,base.g*G,base.b*B, 1.0);}]]}if getObject("Conditions[DaylightShader]"):getBool(VConditionValue) thenshaderAddEffect("daynight");end[/code]

    by caligarimarte, 9 years ago

    7
    0
    caligarimarte 9 years ago
  • RE: [SOLVED] Value to Shader Uniform

    If you're using the shadertoolkit, you can do something like this:[code]shader_effects.ripple1.num.frequency = Values.value.Int[/code]Lua doesn't care if it's float or int, it will be a float in the end. But if you explicitly want an int in the shader, you need to add _i_ to uniform when writing to it.

    by SimonS, 9 years ago

    7
    0
    SimonS 9 years ago
  • [SOLVED] Value to Shader Uniform

    I am using a Shader and want it to be affected by a Value outisde of the Script, a Value which my Protagonist has. How can I translate such a Value into an Int or Float inside a Shader Script? I would suppose it has to do with the "uniform" command, but I am not sure on the exact Implementation.

    by caligarimarte, 9 years ago

    7
    0
    caligarimarte 9 years ago
  • RE: Shader movements and lagy text

    I was talking about how it normally follows the character around when the character walks near to the edge of the current viewport & then the camera shifts over to try to center the camera on the character. This is the ScrollPosition. It has nothing to do with the shader.

    by afrlme, 9 years ago

    9
    0
    afrlme 9 years ago
  • RE: Shader movements and lagy text

    I'm sorry i still don't really know what you mean, could you please describe it a bit more?Isn't that followCharacter function also shader?

    by ke4, 9 years ago

    9
    0
    ke4 9 years ago
  • RE: Shader movements and lagy text

    You are forcing the text position with the registerHookFunction, no? It looks like it's trying to fight with that. The action text at the mouse cursor seems to be displaying just fine in the video. You could probably emulate the same thing without using the shader you know... if the background is larger than the default game resolution then you should be able to disable camera follow character & update the scrollposition in the same way that the viewport works & because you aren't messing with the shader the text should remain exactly where you place it on the screen - in theory at least.

    by afrlme, 9 years ago

    9
    0
    afrlme 9 years ago
  • RE: Shader movements and lagy text

    Looks like it's trying to compensate for the movement of the camera. You could try allowing the shader stuff to affect only the cursor temporarily as it doesn't look like you have any other shader effects active. The text will swing with the camera movement, but it might look smoother & I don't think it matters all that much seeing as you aren't displaying it inside of a box or anything.

    by afrlme, 9 years ago

    9
    0
    afrlme 9 years ago
  • RE: Shader movements and lagy text

    Could you share a video recording of it? & quick question: have you disabled the shader from affecting interfaces, mouse cursors & text?

    by afrlme, 9 years ago

    9
    0
    afrlme 9 years ago
  • Shader movements and lagy text

    Hi,i used the shader [i]shaderViewport[/i] to get this [b]"hand camera"[/b] effect. I'm doing scene in a plane and i'm trying to break the static feeling, looks great however when text is being shown or hotspot animation it's lagy as the engine is trying to calculate the position i guess. It's centering everything else smoothly though. ( including action text ) Is there something to do about it?thanks.

    by ke4, 9 years ago

    9
    0
    ke4 9 years ago
  • RE: Where is my family, point and click game

    I dont know if a fullscreen animation is it worth regarding performance. Your video seemed very laggy and it could be because of the animation... There is a "wave like" shader for the shader part of the engine available. maybe this would solve the issue... just an idea ^_^

    by sebastian, 9 years ago

    63
    0
    sebastian 9 years ago