3d drawn into a surface

VerdeBoss

Member
So I was trying to achieve a 3d scrolling background floor however I have stumbled across this problem where I try to apply a 3d on a surface, it still looks flat. I have tried ways to manuever around this problem, but little to no avail.


GML:
if !surface_exists(floor)
    floor = surface_create( room_width, room_height );
    
surface_set_target(floor);
draw_clear_alpha( c_black, 0 );

draw_set_color(c_white);
d3d_start();
d3d_set_perspective(1);
texture_set_interpolation(1);

d3d_set_projection_ext(0, 0, 512, -0.00, -0.39, 332.00, 0, 0, 1, 45, 3.60, 1, 3200);
d3d_draw_floor(-room_width, (room_height / 2), 0, room_width, (room_height + 32), 0, background_get_texture(tex_floor), room_height / 32, 1);

d3d_end();
surface_reset_target();
draw_surface( floor, 0, 0);
texture_set_interpolation(0);
 

4i4in

Member
I start 1.2 to see how it goes. Code is 10y old so I do not remember what I did had on the mind, but...
d3d_set_projection_ext yes,
d3d_set_zwriteenable(true); do not remember why
d3d_set_culling(true); reasonable;
alpha, color, lightning, shading - not in Your case;

did You set identity?
there is something abut d3d set identity, add scaling, add trasnalation, then draw, then transform_set_identity

I'm not sure, but matrix could need identity to count anything.
 

VerdeBoss

Member
I start 1.2 to see how it goes. Code is 10y old so I do not remember what I did had on the mind, but...
d3d_set_projection_ext yes,
d3d_set_zwriteenable(true); do not remember why
d3d_set_culling(true); reasonable;
alpha, color, lightning, shading - not in Your case;

did You set identity?
there is something abut d3d set identity, add scaling, add trasnalation, then draw, then transform_set_identity

I'm not sure, but matrix could need identity to count anything.
Would d3d fog work in this case? I mean I tried that during my attempts to get it working and it's literally colors the whole screen to the corresponding fog color.
 

4i4in

Member
Would d3d fog work in this case?
Yes. It is basic dx6 solution. If You like I can send You a whole working project on 1.2 (it works on pad, but as I remember it goes with mouse too) where You gonna have this gms 3d) have character animation and surface layers (for flames from backpack engines), collisions and of course display, camera works correct. Send me PM with an email adress to deliver.
I put there also a fog blended with far camera view (so objects that are far are drawn in given range but not so often an bledned with fog).
 

VerdeBoss

Member
Yes. It is basic dx6 solution. If You like I can send You a whole working project on 1.2 (it works on pad, but as I remember it goes with mouse too) where You gonna have this gms 3d) have character animation and surface layers (for flames from backpack engines), collisions and of course display, camera works correct. Send me PM with an email adress to deliver.
I put there also a fog blended with far camera view (so objects that are far are drawn in given range but not so often an bledned with fog).
done
 
Top