Well I managed to create the effect that I wanted to using 2 primitives comprised of 8 triangles (each primitive is in a different object) and then putting a texture over each one. The bottom one is used for a gradient. The top one placed over this one (a separate object) is the mist. After hours of hard work I manged to get it looking exactly like what I wanted.
............ the problem is that as SOON as I put on a background, or changed the background color to anything but solid black my cool looking mist effect went from this:

to this:

The colors get all messed up and the outline that is around the topmost texture I was unable to see before, can easily be seen now. How can I fix this please?
Here is my GM file: http://www.mediafire...3e2jpbw6xs1v2fu
And here is the code for both draw statements:
//draw for bottom primitive (the gradient texture) d3d_transform_set_identity() d3d_transform_add_rotation_z(image_angle); d3d_transform_add_scaling(1.6,1.45,0) d3d_transform_add_translation(x,y,0); d3d_primitive_begin_texture(pr_trianglelist, mist_gradient); //triangle order: top left, top right, middle top left, middle top right,bottom middle left, bottom middle right. bottom left, bottom right //triangle1:top, left, bottom d3d_vertex_texture_color(20,8+warp_value,0,0.5,0,c_white,gradient_alpha); d3d_vertex_texture_color(7+warp_value,5+warp_value,0,0,0,c_white,gradient_alpha); d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,gradient_alpha); //triangle2:top, right, bottom d3d_vertex_texture_color(20,8+warp_value,0,0.5,0,c_white,gradient_alpha); d3d_vertex_texture_color(33+(warp_value*-1),5+warp_value,0,1,0,c_white,gradient_alpha); d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,gradient_alpha); //triangle3:top left, bottom left, bottom right d3d_vertex_texture_color(7+warp_value,5+warp_value,0,0,0,c_white,gradient_alpha); d3d_vertex_texture_color(3+warp_value,30,0,0,0.5,c_white,gradient_alpha); d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,gradient_alpha); //triangle4: top right, bottom right, bottom left d3d_vertex_texture_color(33+(warp_value*-1),5+warp_value,0,1,0,c_white,gradient_alpha); d3d_vertex_texture_color(37+(warp_value*-1),30,0,1,0.5,c_white,gradient_alpha); d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,gradient_alpha); //triangle5: upper left, upper right, bottom d3d_vertex_texture_color(3+warp_value,30,0,0,0.5,c_white,gradient_alpha); d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,gradient_alpha); d3d_vertex_texture_color(7+warp_value,55+(warp_value*-1),0,0,1,c_white,gradient_alpha); //triangle6: upper left, upper right, bottom d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,gradient_alpha); d3d_vertex_texture_color(37+(warp_value*-1),30,0,1,0.5,c_white,gradient_alpha); d3d_vertex_texture_color(33+(warp_value*-1),55+(warp_value*-1),0,1,1,c_white,gradient_alpha); //triangle7:left, top, bottom d3d_vertex_texture_color(7+warp_value,55+(warp_value*-1),0,0,1,c_white,gradient_alpha); d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,gradient_alpha); d3d_vertex_texture_color(20,52+(warp_value*-1),0,0.5,1,c_white,gradient_alpha); //triangle8:right,top, bottom d3d_vertex_texture_color(33+(warp_value*-1),55+(warp_value*-1),0,1,1,c_white,gradient_alpha); d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,gradient_alpha); d3d_vertex_texture_color(20,52+(warp_value*-1),0,0.5,1,c_white,gradient_alpha); d3d_primitive_end(); d3d_transform_set_identity()
//draw for top primitive (mist overlay) draw_set_blend_mode(bm_subtract) d3d_transform_set_identity(); d3d_transform_add_rotation_z(image_angle); d3d_transform_set_scaling(2,1.5,1) d3d_transform_add_translation(x,y,0); d3d_primitive_begin_texture(pr_trianglelist, mist_texture); //triangle order: top left, top right, middle top left, middle top right,bottom middle left, bottom middle right. bottom left, bottom right //triangle1:top, left, bottom d3d_vertex_texture_color(20,10+warp_value[1],0,0.5,0,c_white,0.9); d3d_vertex_texture_color(10+warp_value[0],17+warp_value[0],0,0,0,c_white,0.9); d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,0.9); //triangle2:top, right, bottom d3d_vertex_texture_color(20,10+warp_value[1],0,0.5,0,c_white,0.9); d3d_vertex_texture_color(30+(warp_value[2]*-1),17+warp_value[2],0,1,0,c_white,0.9); d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,0.9); //triangle3:top left, bottom left, bottom right d3d_vertex_texture_color(10+warp_value[0],17+warp_value[0],0,0,0,c_white,0.9); d3d_vertex_texture_color(7+warp_value[7],30,0,0,0.5,c_white,0.9); d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,0.9); //triangle4: top right, bottom right, bottom left d3d_vertex_texture_color(30+(warp_value[2]*-1),17+warp_value[2],0,1,0,c_white,0.9); d3d_vertex_texture_color(33+(warp_value[3]*-1),30,0,1,0.5,c_white,0.9); d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,0.9); //triangle5: upper left, upper right, bottom d3d_vertex_texture_color(7+warp_value[7],30,0,0,0.5,c_white,0.9); d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,0.9); d3d_vertex_texture_color(10+warp_value[6],43+(warp_value[6]*-1),0,0,1,c_white,0.9); //triangle6: upper left, upper right, bottom d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,0.9); d3d_vertex_texture_color(33+(warp_value[3]*-1),30,0,1,0.5,c_white,0.9); d3d_vertex_texture_color(30+(warp_value[4]*-1),43+(warp_value[4]*-1),0,1,1,c_white,0.9); //triangle7:left, top, bottom d3d_vertex_texture_color(10+warp_value[6],43+(warp_value[6]*-1),0,0,1,c_white,0.9); d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,0.9); d3d_vertex_texture_color(20,50+(warp_value[5]*-1),0,0.5,1,c_white,0.9); //triangle8:right,top, bottom d3d_vertex_texture_color(30+(warp_value[4]*-1),43+(warp_value[4]*-1),0,1,1,c_white,0.9); d3d_vertex_texture_color(20,30,0,0.5,0.5,c_white,0.9); d3d_vertex_texture_color(20,50+(warp_value[5]*-1),0,0.5,1,c_white,0.9); d3d_primitive_end(); draw_set_blend_mode(bm_normal) d3d_transform_set_identity()
Edited by esco, 16 April 2012 - 04:19 PM.












