Search Result

  • RE: Heat Haze Shader

    Yes, I wrote it. I am not sure what the best Method of learning would be (I cannot recommend any specific Tutorials), but I taught myself coding GLSL (and by Extension HLSL) by looking at other Shader-Scripts other People have uploaded to the Internet -- I looked at them, changed a Value here, changed a Command there, and kept watching what the Effects would be (so, my Understanding of Shaders is admittedly somewhat restricted, but sufficient for most Things I need). There are some rather advanced Shader-Examples on this Site: https://www.shadertoy.com/If you want a slightly more complex Shader ready for Visionaire-Implementation to inspect, play around with and maybe learn from, here is a Reflection-Shader I recently shared on Discord: https://www.dropbox.com/s/k0wg4cyyta9rlr3/reflection_shader.zip?dl=0EDIT: Keep in Mind that if you create your own Mask-Image (for this Reflection-Shader), there should be one Pixel in each Corner that is at Least 0.001 white, or else Visionaire misinterprets the Image-Size. Also keep in Mind that if you change the Mask, the "Mirror_PosY"-Value must be changed to fit the new Image.

    by caligarimarte, 8 years ago

    10
    0
    caligarimarte 8 years ago
  • RE: Heat Haze Shader

    Here is a little Archive for you:https://www.dropbox.com/s/vyniph7yis67v2k/heatwave_shader.zip?dl=0It is one of the most basic Shaders, so a nicely easy Script for you to get started. :)The Archive includes the Visionaire5-Version for the Shader-Toolkit (in Case you don't have it in your Project), one Script which you have to set up as Definition-Script after the Shader-Toolkit, the actual Shader-Code which you have to copy-paste into a new Shader named "HeatwaveShader" in the Shader-Tab, and an "effects"-Folder (with a Cloud-Texture of mine) which you simply copy into your Project-Folder. If all that is done, you should get a very similar Effect on your Screen, once you start the Game.

    by caligarimarte, 8 years ago

    10
    0
    caligarimarte 8 years ago
  • Heat Haze Shader

    Hi,can the current shader achieve something as heat haze effect? Maybe something like this but rather as a wave.https://www.youtube.com/watch?v=Qghhbkk1HqYIt is possible to add custom shader effects, right?

    by ke4, 8 years ago

    10
    0
    ke4 8 years ago
  • RE: Lua Masking

    But that is what my Shader is doing. As I said, the Color-Changing is nothing you necessarily need, implying that you can remove that in that Case. In which Case the Code in the Shader would look like this:  vec4 color = vec4(0.0);   if (uvVarying.x < Health) {     color = vec4(1.0);   }   gl_FragColor = (texture2D (texel, uvVarying) * color);(Strangely, the "<" is sometimes depicted as "<;" here on the Forum. That is wrong.)

    by caligarimarte, 8 years ago

    11
    0
    caligarimarte 8 years ago
  • RE: Lua Masking

    Oh, actually, a similar Question has been posed on Discord, and several Answers were given. In the End, I offered a little Shader with which the Healthbar-Image would get shortened and also change its Color from Green to Red, with a nice yellow Color at Midpoint (a Feature you don't necessarily need). I will copy the Message I originally wrote to Adventure4Life into this Message, with some Adjustments --maybe you'll find it useful.(EDIT #1: Only works if you have the current Shader-Toolkit for V5 already in your Project: https://www.dropbox.com/s/jfu9zac31lbyfjo/shadertoolkit5.txt?dl=0 )(EDIT #2: I am sure sharing Part of a private Conversation is legally and morally fine, since I am only sharing my own Message, which is but a mere Instruction and includes nothing personal.)~~~You surely already have a Health-Value somewhere in your Game. I have named the Value in my Testfile "PlayerHealth" and set it to 100 initially, as full Health. The next Step is adding an Interface-Object (technically it is categorized as a "Button", but you don't have to make it clickable, then it just is Interface-Decoration) and name it "PlayerHealthbar". My Test-Bar was a Texture with a Size of 512*24px, but any Size will automaticaly work. Then you only have to add this as a Definition-Script: eff = "PlayerHealth_Shader" shader_effects[eff] = { shader = Shaders[eff].Compiled } shaderAddEffect(eff) shaderRemoveEffect(eff) Buttons["PlayerHealthbar"].ShaderSet = shader_effects[eff].num.num bind(eff, "Health", field("Values.PlayerHealth.Int * 0.01")) (The last Line in the Lua-Script, where it says "Values.PlayerHealth.Int * 0.01", that is where you can insert your Value-Name instead of "PlayerHealth" if you want.)And eventually add a new Shader under the "Shader"-Tab (I am assuming you are using Visionaire 5, you mentioned having started to try it out) named "PlayerHealth_Shader", and paste this Code into it: #ifdef GL_ES precision lowp float; precision lowp int; #endif uniform sampler2D texel; varying vec2 uvVarying; uniform float Health; void main () {   vec4 color = vec4(0.0);   if (uvVarying.x < Health) {     //color = vec4( mix( vec3(1.0,0.0,0.0), vec3(0.0,1.0,0.0), Health), 1.0);     color = vec4( (       vec3(pow(1.0-Health,0.33),0.0,0.0) +       vec3(0.0,pow(Health,0.67),0.0)     ), 1.0);   }   gl_FragColor = (texture2D (texel, uvVarying) * color); }  There is one Line (#12) I have commented out -- that Line basically mixes the Colors with a dark Ocre in the Middle. I don't suggest you use that, because frankly, it is just an ugly Color, but I inserted it anyway (albeit outcommented) for you to freely choose. Instead, Lines #14 and #15 (could be one Line, but I thought I'd split it into several so you can look at it more easily) use a slightly more complex Way of Mixing where I initially used Powers of Values between 0.25 to 0.5 to give the red and green Values more rounded Falloffs and thusly have a brighter Yellow in the Middle; however, I noticed that, other than with a fully visible and fully green Healthbar, the deep red Color of low Health would never be visible because by that Point the Bar is effectively gone -- so instead, I used Powers of one and two Thirds (0.33 and 0.67) to have an intentionally uneven Color-Falloff: Now, the low Healthbar will still have quite a nice Red-Value, but the Mid-Color is more of an Orange. You can change that if you want, but I think that is the best Way to go.

    by caligarimarte, 8 years ago

    11
    0
    caligarimarte 8 years ago
  • RE: Lua Masking

    I suppose you mean the new but super-undocumented and thusly quasi unknowable Masking-Feature in Visionaire 5? I have no Idea, but maybe whatever you want to get can instead be done just as well with a GLSL-Shader -- in which Case: What exactly is it you'd like to achieve?

    by caligarimarte, 8 years ago

    11
    0
    caligarimarte 8 years ago
  • RE: HTML Performance Optimization

    Firefox alone uses around 200-400mb RAM with just the default page open. Chrome uses considerably much less, but I've been using Firefox more or less since it first came out & I'm too stubborn to switch over to Chrome.Anyway, yeah. While 1080p may look great, it's a massive resource hog; especially as far as 2D is concerned. I recommend 720p or lower. Also probably scrap openGL shader stuff or at least the more intense features/functions/effects. & finally convert png to webp & use that as it will reduce all of your images & animation file sizes down by at least 1/3 to 50% which means less required hdd space / loading times overall, which is a massive help. Lossy webp format will reduce file sizes by a lot compared to lossless webp, but I highly recommend using lossless because there's less chance of weird graphical glitches.As for the change resolution option, I believe it reduces the default game resolution. Theoretically I think it's supposed to scale down the images, animations, way borders, interaction polygons & all of that, but I really wouldn't trust it. I've not tried it in 5.x, but it's never worked as intended in previous versions or at least not worked 100% accurately.https://wiki.visionaire-tracker.net/wiki/Game_Optimizationhttps://wiki.visionaire-tracker.net/wiki/Image_Encoding

    by afrlme, 8 years ago

    18
    0
    afrlme 8 years ago
  • RE: fog with particle system ?

    If you want it to feel 3D, so that you can in Fact see the Feet move through Layers of Mist, I guess that is not possible with Particles, but it might be "easy" to achieve if the Fog is still, then you can just use several Objects which are several Z-Layers of Mist: Imagine your Room had a Grid and each Z-Level was a separate Object which is one "Line" of Fog, and the next Line closer to the Camera has its own Line of Fog a little below the first one, and so on and so on, and then you set the right Object Centers for each Line, and if you use enough such Layers, you could achieve a decent Effect where only the Feet are more and more engulfed in Mist the further the Character goes into the Background.If however you just meant one Layer of Fog that is at the very Front and only in the lower Part of the Screen, sure, you can do that with Particles. The Method I described above might also work if you used several Particle-Effects placed at different Points, if they accept the Object Center where they are set -- I haven't yet tested that.Equally for a non-3D Effect, I myself woud prefer to just use a Shader across the whole Screen (or maybe an Object, if you still have other Objects in the Foreground in Front of the Mist) with one Cloud-Texture overlayed moving in different Directions and getting more transparent towards the Top of the Screen. But only because I like Shaders. Particles should work just fine.(I would have an Idea for how the 3D-Fog lingering only around the Feet could possibly be achieved with a Shader put on the Character as well, but I do not know whether it would be possible to code in Visionaire -- it would demand that the Screen-UV could be projected onto the Character-Texture's UV.)

    by caligarimarte, 8 years ago

    8
    0
    caligarimarte 8 years ago
  • RE: Visionaire RC2 Bugfix Update Changelog

    Please add this feature : In earthquake action add shake direction in x or y or both . I need to shake screen only in y direction move .I know, you didn't ask for a Shader, but I quickly wrote a Shader that will do the Job for you.Here is a Script, have it as Definition-Script:eff = "QuakeY" shader_effects[eff] = { shader = Shaders[eff].Compiled } shaderAddEffect("QuakeY") bind(eff, "QuakeY_Strength", field("Values.QuakeY_Strength.Int")) bind(eff, "QuakeY_Speed", field("Values.QuakeY_Speed.Int")) bind(eff, "time", field("getTime()*0.001"))  Then create a Shader with the Name "QuakeY":...     Woow .Thanks so much caligarimarte . I'll try it now.

    by TinTin, 8 years ago

    54
    0
    TinTin 8 years ago
  • RE: Visionaire RC2 Bugfix Update Changelog

    Please add this feature : In earthquake action add shake direction in x or y or both . I need to shake screen only in y direction move .I know, you didn't ask for a Shader, but I quickly wrote a Shader that will do the Job for you.Here is a Script, have it as Definition-Script:eff = "QuakeY" shader_effects[eff] = { shader = Shaders[eff].Compiled } shaderAddEffect("QuakeY") bind(eff, "QuakeY_Strength", field("Values.QuakeY_Strength.Int")) bind(eff, "QuakeY_Speed", field("Values.QuakeY_Speed.Int")) bind(eff, "time", field("getTime()*0.001"))  Then create a Shader with the Name "QuakeY":#ifdef GL_ES precision lowp float; precision lowp int; #endif uniform sampler2D texel; varying vec2 uvVarying; uniform float QuakeY_Speed; uniform float QuakeY_Strength; uniform float time; void main () {  gl_FragColor = texture2D(texel, vec2(uvVarying.x, uvVarying.y+sin(QuakeY_Speed * time)*QuakeY_Strength*0.0001 )); } Then create two Values named "QuakeY_Strength" and "QuakeY_Speed", anywhere you want (Protagonist maybe), and set them to some Value between 0 and 100. For Speed I suggest 100 as a Default, and then you can set the Strength as a Value to 100 in whatever Action you need it and right after that Actionpart add this little Tweening-Script to let the Camera quake and shake with an Amount of 100 getting smaller within 2000 Milliseconds:Values.QuakeY_Strength:to(2000, {Int = 0}, easeQuadOut)I know the Setup looks complicated, but once that is done, you'll have good and easy Control over your vertical Quake-Effects. It could be extended so you can control both X and Y, but maybe you can do that on your own, as a little Exercise, if you need it.

    by caligarimarte, 8 years ago

    54
    0
    caligarimarte 8 years ago