N
neurothoughtmachine
Guest
Greetings,
I am trying to reproduce an effect from a previous project!
This is what it should look like...
Unfortunately, this is what I am getting from the code below...
I have already tried moving the sprites, the surface and the draw_circle_colour to different locations, with no success.
But I am guessing that location(s) is the primary cause of my failure.
Any help or ideas would be great!
I am trying to reproduce an effect from a previous project!
This is what it should look like...
Unfortunately, this is what I am getting from the code below...
if !surface_exists(img_surf)
{
img_surf = surface_create(obj_tunnel_spiral_top_bottom.sprite_width, obj_tunnel_spiral_top_bottom.sprite_height);
var_test_active_check = 1;
}
surface_set_target(img_surf);
// put your circles code here, centered
draw_circle_colour(obj_tunnel_spiral_top_bottom.sprite_width / 2, obj_tunnel_spiral_top_bottom.sprite_height / 2, global.var_base_y_value, var_wormhole_gradi_a_01, var_wormhole_gradi_a_02, false);
// this is needed to cover the unwanted draw
// the shape, including the black, centered
draw_sprite(spr_tunnel_spiral_top_bottom, 0, obj_tunnel_spiral_top_bottom.sprite_width / 2, obj_tunnel_spiral_top_bottom.sprite_height / 2);
surface_reset_target();
shader_set(sh_shapefx);
// the sprites are relatively centered
draw_surface(img_surf, obj_tunnel_spiral_top_bottom.x - obj_tunnel_spiral_top_bottom.sprite_width / 2, obj_tunnel_spiral_top_bottom.y - obj_tunnel_spiral_top_bottom.sprite_height / 2);
shader_reset();
surface_free(img_surf);
{
img_surf = surface_create(obj_tunnel_spiral_top_bottom.sprite_width, obj_tunnel_spiral_top_bottom.sprite_height);
var_test_active_check = 1;
}
surface_set_target(img_surf);
// put your circles code here, centered
draw_circle_colour(obj_tunnel_spiral_top_bottom.sprite_width / 2, obj_tunnel_spiral_top_bottom.sprite_height / 2, global.var_base_y_value, var_wormhole_gradi_a_01, var_wormhole_gradi_a_02, false);
// this is needed to cover the unwanted draw
// the shape, including the black, centered
draw_sprite(spr_tunnel_spiral_top_bottom, 0, obj_tunnel_spiral_top_bottom.sprite_width / 2, obj_tunnel_spiral_top_bottom.sprite_height / 2);
surface_reset_target();
shader_set(sh_shapefx);
// the sprites are relatively centered
draw_surface(img_surf, obj_tunnel_spiral_top_bottom.x - obj_tunnel_spiral_top_bottom.sprite_width / 2, obj_tunnel_spiral_top_bottom.y - obj_tunnel_spiral_top_bottom.sprite_height / 2);
shader_reset();
surface_free(img_surf);
//
// Simple passthrough vertex shader
//
attribute vec3 in_Position; // (x,y,z)
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
attribute vec4 in_Colour; // (r,g,b,a)
attribute vec2 in_TextureCoord; // (u,v)
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
v_vColour = in_Colour;
v_vTexcoord = in_TextureCoord;
}
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 color;
color = texture2D( gm_BaseTexture, v_vTexcoord ).rgba;
if (color.rgb == vec3(0.0, 0.0, 0.0)) {
color.a = 0.0;
}
gl_FragColor = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
gl_FragColor.a = color.a;
}
// Simple passthrough vertex shader
//
attribute vec3 in_Position; // (x,y,z)
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
attribute vec4 in_Colour; // (r,g,b,a)
attribute vec2 in_TextureCoord; // (u,v)
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
v_vColour = in_Colour;
v_vTexcoord = in_TextureCoord;
}
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 color;
color = texture2D( gm_BaseTexture, v_vTexcoord ).rgba;
if (color.rgb == vec3(0.0, 0.0, 0.0)) {
color.a = 0.0;
}
gl_FragColor = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
gl_FragColor.a = color.a;
}
I have already tried moving the sprites, the surface and the draw_circle_colour to different locations, with no success.
But I am guessing that location(s) is the primary cause of my failure.
Any help or ideas would be great!