J
jva
Guest
Hello everyone,
Been using GMS for a long time and was excited when I read GMS2 was supporting DX11 (Vertex texture fetches!).
So I made a quick test for reading height data from a heightmap for a terrain.
On GMS 1.4 GLSL ES VTF works on android. On GMS2 it doesn't seem to work, at least on android or windows targets.
Has anyone gotten VTF to work on GMS2?
If it has not yet been implemented I hope yoyo will add it soon and for most targets, very happy if they do!
Absolutely need this feature!
Vertex Shader:
attribute vec3 in_Position;
uniform sampler2D sampler;
varying vec3 v_vColour;
void main()
{
lowp float zh = texture2D(sampler,vec2(in_Position.xy/128.0)).r;
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z+(zh*30.0), 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
v_vColour = vec3(0.25+(zh*0.75));
}
Fragment Shader:
varying vec3 v_vColour;
void main()
{
gl_FragColor = vec4(v_vColour,1.0);
}
Been using GMS for a long time and was excited when I read GMS2 was supporting DX11 (Vertex texture fetches!).
So I made a quick test for reading height data from a heightmap for a terrain.
On GMS 1.4 GLSL ES VTF works on android. On GMS2 it doesn't seem to work, at least on android or windows targets.
Has anyone gotten VTF to work on GMS2?
If it has not yet been implemented I hope yoyo will add it soon and for most targets, very happy if they do!
Absolutely need this feature!
Vertex Shader:
attribute vec3 in_Position;
uniform sampler2D sampler;
varying vec3 v_vColour;
void main()
{
lowp float zh = texture2D(sampler,vec2(in_Position.xy/128.0)).r;
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z+(zh*30.0), 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
v_vColour = vec3(0.25+(zh*0.75));
}
Fragment Shader:
varying vec3 v_vColour;
void main()
{
gl_FragColor = vec4(v_vColour,1.0);
}