Pages

Se afișează postările cu eticheta Godot. Afișați toate postările
Se afișează postările cu eticheta Godot. Afișați toate postările

sâmbătă, 16 martie 2019

marți, 12 februarie 2019

Godot : water shader example.

This is an example created by user named Gonkee in this video tutorial.
The result of this shader tutorial I tested is this:

The source code of this shader is this:
shader_type canvas_item;

// Gonkee's water shader for Godot 3 - full tutorial https://youtu.be/uhMAHpV_cDg
// If you use this shader, I would prefer if you gave credit to me and my channel

uniform vec4 blue_tint : hint_color;

uniform vec2 sprite_scale;
uniform float scale_x = 0.67;

float rand(vec2 coord){
 return fract(sin(dot(coord, vec2(12.9898, 78.233)))* 43758.5453123);
}

float noise(vec2 coord){
 vec2 i = floor(coord);
 vec2 f = fract(coord);

 // 4 corners of a rectangle surrounding our point
 float a = rand(i);
 float b = rand(i + vec2(1.0, 0.0));
 float c = rand(i + vec2(0.0, 1.0));
 float d = rand(i + vec2(1.0, 1.0));

 vec2 cubic = f * f * (3.0 - 2.0 * f);

 return mix(a, b, cubic.x) + (c - a) * cubic.y * (1.0 - cubic.x) + (d - b) * cubic.x * cubic.y;
}

void fragment(){
 
 vec2 noisecoord1 = UV * sprite_scale * scale_x;
 vec2 noisecoord2 = UV * sprite_scale * scale_x + 4.0;
 
 vec2 motion1 = vec2(TIME * 0.3, TIME * -0.4);
 vec2 motion2 = vec2(TIME * 0.1, TIME * 0.5);
 
 vec2 distort1 = vec2(noise(noisecoord1 + motion1), noise(noisecoord2 + motion1)) - vec2(0.5);
 vec2 distort2 = vec2(noise(noisecoord1 + motion2), noise(noisecoord2 + motion2)) - vec2(0.5);
 
 vec2 distort_sum = (distort1 + distort2) / 60.0;
 
 vec4 color = textureLod(SCREEN_TEXTURE, SCREEN_UV + distort_sum, 0.0);
 
 color = mix(color, blue_tint, 0.3);
 color.rgb = mix(vec3(0.5), color.rgb, 1.4);
 
 float near_top = (UV.y + distort_sum.y) / (0.2 / sprite_scale.y);
 near_top = clamp(near_top, 0.0, 1.0);
 near_top = 1.0 - near_top;
 
 color = mix(color, vec4(1.0), near_top);
 
 float edge_lower = 0.6;
 float edge_upper = edge_lower + 0.1;
 
 if(near_top > edge_lower){
  color.a = 0.0;
  
  if(near_top < edge_upper){
   color.a = (edge_upper - near_top) / (edge_upper - edge_lower);
  }
 }
 
 COLOR = color;
}

duminică, 22 octombrie 2017

News: C# IN GODOT game engine.

The development team come with this news:
In order to bring C# programming to Godot, we are embedding the Mono runtime into the engine. As of alpha2, Godot is using Mono 5.2 and C# 7.0 is supported.
I will write more posts about the internals and how things work in the future but, for this one, I would like to focus on introducing the language and how to write Godot scripts with it.

One example of script it's that script class show by the development team :
// Coin.cs
using Godot; // Namespace that contains all Godot types

// Class Coin has same name as its file. Godot will detect it
public class Coin : Node
{
    public override void _Ready()
    {
        GD.Print("Hello, Godot!");
    }
}
Read more about this at official website .

miercuri, 12 iulie 2017

Godot game engine and python language.

As you know the Godot game engine is an advanced, feature-packed, multi-platform 2D and 3D open source game engine.
The author of this feature named Leblond Emmanuel come with this idea to have python language into Godot game engine.
This feature of Python into Godot game engine come with some advanced ways to solve the problem:
  •  using Micropython interpreter instead of CPython 
  •  using PyBind11 to statically bind to Godot C++ API 
  •  and using CFFI and rely on a 3rd party C API 
You can see the author's speech at the meeting EuroPython 2017:

duminică, 1 ianuarie 2017

News: Godot's new renderer and JAM Game.

If you remember Godot - game engine, then we have new and exciting news on the official blog.
The open-source game engine Godot has been working to improve its 3D renderer.
The new todo for January 2017 come with this tasks:
  • Implement Particle Shaders, with support for: Sorting, Collision and Soft Particles.
  • Improve Culling: Portals (rewrite as polygon-based) and Rooms.
  • Add Clustered lighting (before this all is forward).
  • Add Layered/Stencil rendering
  • Implement Decals.
 As you can see any changes are great into area of game engines and game programming.
The last released of Godot Engine 2.1.1-stable (2016/11/17) is also available on Steam and come from:
Linux 64-bit and 32-bit , Linux Server 64-bit , OS X (32-bit and 64-bit), Windows 64-bit and 32-bit. The Godot development is open and has many demos projects and tools to make a good game.

NOTE: The Godot Engine team are organizing a new Godot Community Game Jam that will run from 16 December 2016 to 31 January 2017.