3D Ambient

jo-thijs

Member
Hi and welcome to the GMC!

I'm not sure about this, but I would like to ask to test something.
If you use c_red as ambient, is it blue?
If you use c_blue, is it red?
If you use c_green, is it green?

Also, what exact code draws what we see in the screenshot?
 

Mornedil

Member
Try using make_color_rgb(255, 255, 0) instead of c_yellow and see if that works. I really have no idea why it would end up as a cyan color.
 
M

Mooshim

Guest
Hi and welcome to the GMC!

I'm not sure about this, but I would like to ask to test something.
If you use c_red as ambient, is it blue?
If you use c_blue, is it red?
If you use c_green, is it green?

Also, what exact code draws what we see in the screenshot?
Yep - all of those are correct.
And this is the exact code I've been using:

temp_background = background_create_color(1,1,c_white);
d3d_light_define_ambient(c_green);
d3d_draw_floor(-100,-100,0,100,100,0,temp_background,200,200);


Thanks
 

jo-thijs

Member
Then for some reason the red and blue components are switched by the ambient.
Try:
Code:
var col = c_yellow;
d3d_light_define_ambient(make_colour_rgb(colour_get_blue(col), colour_get_green(col), colour_get_red(col)));
 
M

Mooshim

Guest
Then for some reason the red and blue components are switched by the ambient.
Try:
Code:
var col = c_yellow;
d3d_light_define_ambient(make_colour_rgb(colour_get_blue(col), colour_get_green(col), colour_get_red(col)));
This works, thanks!
 

orange451

Member
Every color in Game Maker is defined as BGRA. Which is a little awkward sometimes. I guess the ambient function expects RBGA.
 

jo-thijs

Member
Actually, the alpha component isn't taken in consideration at this level, so it'd be BGR and RGB.
It's still a bug though.
 
Top