I am trying to take 6 skybox images that I have, load them, and apply them to a mesh as a cubic map (for reflection).
Since I have the images in 6 separate files, I am drawing them to the backbuffer, then using BackBufferToTex to write them to a texture.
The trouble I am having is that the loaded images are being drawn to the backbuffer with alpha, despite explicitly setting SOLIDBLEND.
Here is the code:
Since I have the images in 6 separate files, I am drawing them to the backbuffer, then using BackBufferToTex to write them to a texture.
The trouble I am having is that the loaded images are being drawn to the backbuffer with alpha, despite explicitly setting SOLIDBLEND.
Here is the code:
Local reflect_forward:TImage = LoadImage("space_skybox_front_" + random_seed + ".jpg") Local reflect_back:TImage = LoadImage("space_skybox_back_" + random_seed + ".jpg") Local reflect_left:TImage = LoadImage("space_skybox_left_" + random_seed + ".jpg") Local reflect_right:TImage = LoadImage("space_skybox_right_" + random_seed + ".jpg") Local reflect_top:TImage = LoadImage("space_skybox_top_" + random_seed + ".jpg") Local reflect_bottom:TImage = LoadImage("space_skybox_bottom_" + random_seed + ".jpg") Local tex_size:Int = ImageWidth(reflect_forward) Local temp_texture:TTexture = CreateTexture(tex_size, tex_size, 1+128) SetClsColor 0, 0, 0 SetBlend SOLIDBLEND SetCubeFace temp_texture,0 DrawImage reflect_right, 0, 0 BackBufferToTex(temp_texture) SetCubeFace temp_texture,1 DrawImage reflect_forward, 0, 0 BackBufferToTex(temp_texture) SetCubeFace temp_texture,2 DrawImage reflect_left, 0, 0 BackBufferToTex(temp_texture) SetCubeFace temp_texture,3 DrawImage reflect_back, 0, 0 BackBufferToTex(temp_texture) SetCubeFace temp_texture,4 DrawImage reflect_bottom, 0, 0 BackBufferToTex(temp_texture) SetCubeFace temp_texture,5 DrawImage reflect_top, 0, 0 BackBufferToTex(temp_texture) EntityTexture in_entity, temp_texture, 0, 1