Animated background - and character "losing" color. Questions from a newcomer to both visionaire and game making at large

  • #1, by Tomas FolkegårdMonday, 21. August 2017, 14:33 3 years ago
    Greetings fellow visionaires et al. 
    As i stumbled upon visionaire studio on my recent begun quest in making more of the stories (not the voices) in my head. 
    I am in the processing of learning both visionaire studio and other software for making animations, gamesounds etc, and slowly pulling my hair as i realize the scope of what i have commited to. Fun ofcourse, but also daunting - and oh so easy to get caught up in getting the "right software" instead of letting my creativity flow smile 

    Well, enough about my situation and onwards and upward to the questions. 

    1.  Is it possible to use an animated background for the scenes? (I guess this is a question i easily could answer by trying, but as the animation only exist in thought it would yet be a theoretical test and a hypothetical answer at best.) 
    Or can i animate within, so that objects follow the player? 
    What i have are a cityscape that will substitute for one scene of the adventure - and i want to make the buidling have cartoon eyes that follows the main character as he moves around in the scene. 

    2. The main character will during the story progress from a child to an adult, but not change his apperance significally - therefore i guess that is simply a matter of scaling during the scenes - right? 
    The thing is, i would like to make him fade out of colour during the adventure - so that as a youngster he will be full of colours, but as the story progresses he will become partially greyis and at the end entirely grey in a colorful world, can that be achieved without having to change the character animation (could it be made as the character animation) or am i just hoping for something that is well beyond my skills as a enthusiast? 

    Curious and sincere regards. 
    Tomas

    Newbie

    1 Posts


  • #2, by sebastianSaturday, 26. August 2017, 11:22 3 years ago
    1. Is it possible to use an animated background for the scenes? (I guess this is a question i easily could answer by trying, but as the animation only exist in thought it would yet be a theoretical test and a hypothetical answer at best.) 
    Or can i animate within, so that objects follow the player? 
    What i have are a cityscape that will substitute for one scene of the adventure - and i want to make the buidling have cartoon eyes that follows the main character as he moves around in the scene. 
    the background image itself is always static. But you can add objects and animations on top of that. So yes this would be possible. 

    2. The main character will during the story progress from a child to an adult, but not change his apperance significally - therefore i guess that is simply a matter of scaling during the scenes - right? 
    The thing is, i would like to make him fade out of colour during the adventure - so that as a youngster he will be full of colours, but as the story progresses he will become partially greyis and at the end entirely grey in a colorful world, can that be achieved without having to change the character animation (could it be made as the character animation) or am i just hoping for something that is well beyond my skills as a enthusiast? 

    Thats also possible. More easily with extra outfits, but i guess you could do the color changing also with Shader effects bound to your character. Buts thats more advanced stuff if you dont know the GLSL Shader language.


    Thread Captain

    2336 Posts

  • #3, by caligarimarteMonday, 28. August 2017, 16:36 3 years ago
    I am not sure Shaders can be bound to Characters (otherwise a Grayscale-Shader would be one of the easiest Exercises imaginable), because in Visionaire 4 this was not possible and there was not much Demand to change that, so I guess that won't work in 5 either, but please correct me if I am wrong, it would be a Blast.
    Alternatively, you could -- maybe, just maybe -- use an Effect like I have shown here (https://www.visionaire-studio.net/forum/thread/lichtkreis-si...) but instead make it a Circle or rather a vertical Ellipse closely around the Player within which everything becomes gray, while everything around it remains as colorful as it is. I know that is not what you asked for, but it could be an interesting Alternative, kind of implying that the Protagonist's Tristesse is spreading and infecting what is close around him.

    Concerning the Eyes on the Building, you do not need an animated Background for that, and neither an animated Object. What you need for that is some LUA, a Script that will make the Pupils (as separate Objects on empty Eyes) rotate in such a Way that they are aligned towards the Vector between their Origin and the Player Position, or similarily have them move with some Sine-Cosine-Magic towards that (which probably isn't too hard either, but would go above my Head, I am not good with Circle-Calculation).

    Forum Fan

    145 Posts

  • #4, by SimonSMonday, 28. August 2017, 21:53 3 years ago
    You can use a shader for the character.

    I don't know why everyone's so afraid of GLSL.

    Create a shader Grayscale, change the Fragment to this:
    #ifdef GL_ES
    precision lowp float;
    precision lowp int;
    #endif
    uniform vec4 color;
    uniform sampler2D texel;
    varying vec2 uvVarying;
    void main ()
    {
      vec4 col = (texture2D (texel, uvVarying) * color);
      float grey = (col.r+col.g+col.b)/3.0;
      gl_FragColor = vec4(grey,grey,grey,col.a);

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14

    Then using it (a definition script):
    local grayscaleShader = shaderCompile(Shaders.Grayscale.Compiled)

    function setGrayscale(char, active)
      char.ShaderSet = grayscaleShader
    end

    setGrayscale(game.CurrentCharacter, true)
    1
    2
    3
    4
    5
    6
    7

    Simple ay.

    Thread Captain

    1352 Posts

  • #5, by esmeraldaThursday, 31. August 2017, 17:09 3 years ago

    Then using it (a definition script):
    local grayscaleShader = shaderCompile(Shaders.Grayscale.Compiled)

    function setGrayscale(char, active)
      char.ShaderSet = grayscaleShader
    end

    setGrayscale(game.CurrentCharacter, true)
    1
    2
    3
    4
    5
    6
    7

    Simple ay.
    I don't know anything about coding, but I wanted to try the script. It works fine, but I have no idea how to turn off the effect.
    I called the script as execute script (not definition script). To end the effect, I call a second script that is identical to the one above. Only the last line is:
    setGrayscale(game.CurrentCharacter, false)
    But my chacter is still desaturated...
    I also tried an "execute script"action part with the same line to no effect.

    Could one of you help me with this, please?


    Great Poster

    385 Posts

  • #6, by afrlmeThursday, 31. August 2017, 17:28 3 years ago
    I don't know why everyone's so afraid of GLSL.
    Probably because it looks likea bunch of random numbers & letters & most of the people on here won't even give Lua a chance which is probably a 100x much simpler than C or GLSL.

    I look at what you just wrote in your code blocks & it looks like complete gibberish to me.

    Imperator

    6816 Posts

Write post