Search Result

  • RE: ShaderToolkit fourbit question

    A follow-up question, I have the following problem with shaders, I will try to describe: From any scene, I can click on the corresponding interface button and get into the menu. When this button is pressed, Autosave #1 is recorded. Once in the menu, I can press the return to the game button, and, accordingly, autosave #1 is loaded. Everything works fine. But, if you repeat exactly the same thing a second time, then when you return to the game, the shader somehow continues to work, but its animation freezes. This happens with all shaders and in all scenes after doing this algorithm of actions. What could be the reason? Thanks.

    by red363, 2 years ago

    12
    0
    red363 2 years ago
  • RE: ShaderToolkit fourbit question

    Hello! I get this error after I put long code in shader compiler: "error X4000: variable 'outColor' used without having been completely initialized" What could be the problem?

    by red363, 2 years ago

    12
    0
    red363 2 years ago
  • RE: ShaderToolkit fourbit question

    No, put the shader part (the long part) into a shader in the shader section in the engine (third icon from the right upper left), just add a shader and name it fourbit and put the shader in fs, it then compiles automatically, and you can change the pixelsize there if needed. You must use the internal shader compiler.Just add the lua script as a definition script afterwards, there are no changes needed.

    by SimonS, 2 years ago

    12
    0
    SimonS 2 years ago
  • RE: ShaderToolkit fourbit question

    sorry, I´m not expert with this code :DShould I add #ifdef GL_ES code in ShaderToolkit script at the end and add"shader_effects["fourbit"] = { shader = Shaders["fourbit"].Compiled } shaderAddEffect("fourbit") bind("fourbit", "time", field("shader_iTime"))" everytime I wanted to use the fourbit, right?and then play with pixelSize ?(I tried that and it didn´t work) 

    by Andres, 2 years ago

    12
    0
    Andres 2 years ago
  • 5.1.8.1 1226 Update released

    New things:- Used dialog option font- Russian translationChanges:- Can copy/paste in integrity dialog with CTRL+A/C- Action parts are now executed even in fade: change/show character, change/show scene (fades stack), load/save- Select first dialog on character select / Clear if noneIlios changes:- Blocks can be multiselected and copied/pasted- Comment block- Get Object on b2Body - Duplicate/Copy/Remove objects- Static variables in blocks- Convertable blocks crash- Class name checks for invalid chars- Update is now using floats and called (you might need to recreate the block)- Change the component class in scene/object is now possible- Controller events- Clear values on reset- Added some math functionsFixes:- Android is slow- Crashes in rtf export- Monospace fonts are not spaced correctly- Savegames tab crashes on save without savegames- Can walk out of bounds with controller- Open browser in Linux works only once- Action part setting shift up/down work now correctly- Shift up/down doesn't fade sounds- Fade over/Shift shows one frame of the target if interfaces excluded from shader- Characters disappear on fade over/shift- Character animation blinks on hide animation- Script editor can freeze/crash in some scenarios- Align for immediate actions not working

    by SimonS, 2 years ago

    0
    0
    SimonS 2 years ago
  • RE: ShaderToolkit fourbit question

    Here's the code: #ifdef GL_ES precision highp float; precision lowp int; #endif uniform float time; uniform sampler2D composite; uniform int renderpass; uniform vec2 mouse; uniform vec2 resolution; varying vec2 texcoord; // 4BIT COLOR // Maps into DawnBringer's 4-bit (16 color) palette http://www.pixeljoint.com/forum/forum_posts.asp?TID=12795 // Also see the amazing ASCII shadertoy: https://www.shadertoy.com/view/lssGDj float hash(vec2 p) { return fract(1e4 * sin(17.0 * p.x + p.y * 0.1) * (0.1 + abs(sin(p.y * 13.0 + p.x)))); } float compare(vec3 a, vec3 b) { // Increase saturation a = max(vec3(0.0), a - min(a.r, min(a.g, a.b)) * 0.25); b = max(vec3(0.0), b - min(b.r, min(b.g, b.b)) * 0.25); a*=a*a; b*=b*b; vec3 diff = (a - b); return dot(diff, diff); } void main(void) { const float pixelSize = 1.0; vec2 c = floor(texcoord * resolution / pixelSize); vec2 coord = c * pixelSize; vec3 src = texture2D(composite, coord / resolution.xy).rgb; // Track the two best colors vec3 dst0 = vec3(0), dst1 = vec3(0); float best0 = 1e3, best1 = 1e3; # define TRY(R, G, B) { const vec3 tst = vec3(R, G, B); float err = compare(src, tst); if (err < best0) { best1 = best0; dst1 = dst0; best0 = err; dst0 = tst; } } TRY(0.078431, 0.047059, 0.109804); TRY(0.266667, 0.141176, 0.203922); TRY(0.188235, 0.203922, 0.427451); TRY(0.305882, 0.290196, 0.305882); TRY(0.521569, 0.298039, 0.188235); TRY(0.203922, 0.396078, 0.141176); TRY(0.815686, 0.274510, 0.282353); TRY(0.458824, 0.443137, 0.380392); TRY(0.349020, 0.490196, 0.807843); TRY(0.823529, 0.490196, 0.172549); TRY(0.521569, 0.584314, 0.631373); TRY(0.427451, 0.666667, 0.172549); TRY(0.823529, 0.666667, 0.600000); TRY(0.427451, 0.760784, 0.792157); TRY(0.854902, 0.831373, 0.368627); TRY(0.870588, 0.933333, 0.839216); # undef TRY best0 = sqrt(best0); best1 = sqrt(best1); gl_FragColor = vec4(mod(c.x + c.y, 2.0) > (hash(c * 2.0 + fract(sin(vec2(floor(time), floor(time* 1.7))))) * 0.75) + (best1 / (best0 + best1)) ? dst1 : dst0, 1.0); } <font face="monospace"></font>There's pixelSize, I set to it to 1.0. Add this as a shader named fourbit in the shadertab, then you can use with this:shader_effects["fourbit"] = { shader = Shaders["fourbit"].Compiled }shaderAddEffect("fourbit")bind("fourbit", "time", field("shader_iTime"))

    by SimonS, 2 years ago

    12
    0
    SimonS 2 years ago
  • ShaderToolkit fourbit question

    Hi!I´m using Shader Toolkit Version 0.96... is this one the last version?Is there a way to see fourbit less pixelated?Thanks! Andrés

    by Andres, 2 years ago

    12
    0
    Andres 2 years ago
  • RE: ShaderToolkit and text question

    Edit the shader toolkit script & add this line at the top of the script...game.ShaderExclude = eShaderExcludeInterfacesIt should prevent the fx from effecting interfaces, mouse cursors, & texts. If you want it to affect interfaces, but not the mouse cursor & texts, then use this line of code instead...game.ShaderExclude = eShaderExcludeTextsAndCursor

    by afrlme, 2 years ago

    2
    0
    afrlme 2 years ago
  • RE: How to Realize: Cutscene: Newsletter which is turning and zoom in

    I would probably make an animation in my graphics software and play that.There is also the shader tool kit that allows you to control a camera, so you could zoom in and rotate the camera. (but I have never tried to rotate the camera more than 360° at once, so I'm not sure it is possible)http://www.visionaire-studio.com/luadocs/#shadertoolkitOr you could use the :to() function to scale and rotate the object.Like so:  Objects["Newspaper"] :to(3000, {Scale = 3, Rotation = 62.9}, easeQuadOut)the number 3000 is the time for the transformation in milliseconds,Scale and Rotation are the attributes of the object that are to be changed. Scale = 1 would be the original scale, 2 = double ... Rotation = 0 would be no rotation. One full 360° turn is about 6.29. So 62.9 is turning 10 times. The number is not quite accurate, I got there by experimenting. I know there is a way to set the rotation to degrees, but I don't know how or how to do the mathematical conversion to a float correctly. I hope someone else here will jump in and give the correct number or the Lua command to use degrees.easeQuadOut is defining the curve how the easing shall happen (in this case quick start, getting slower at the end) https://easings.net/Edit: found it -> Rotation = math.rad(360)  is a full 360° rotationObjects["Newspaper"] :to(3000, {Scale = 3, Rotation = math.rad(3600)}, easeQuadOut)Would rotate the object 10 times and scale up 3 times in 3 secondsone more edit: Thinking about it, scaling up a small image will make your newspaper unreadalbe - so it would be better to first scale down your scene filling object at the beginning of the scene. For example to a tenth of the original size.Action called at the beginning of the scene:Execute script -> Objects["Newspaper"] :to(0, {Scale = 0.1})Pause 500 ms  -- to make sure the first scaling is done before the next transformation, can be shorterExecute script -> Objects["Newspaper"] :to(3000, {Scale = 1, Rotation = math.rad(3600)}, easeQuadOut)

    by esmeralda, 2 years ago

    3
    0
    esmeralda 2 years ago
  • RE: DX Error

    Thank you!!! That was the problem. I had a shader in there that I no longer needed.

    by Hoschi.380, 2 years ago

    2
    0
    Hoschi.380 2 years ago