Render: Set 1-byte texture alignment. Make blank_texture
transparent.
This commit is contained in:
parent
4082679118
commit
ce4be40407
1 changed files with 5 additions and 2 deletions
|
@ -125,6 +125,9 @@ proc initialize*(self: RenderManager) =
|
||||||
glEnable(GL_CULL_FACE)
|
glEnable(GL_CULL_FACE)
|
||||||
glCullFace(GL_BACK)
|
glCullFace(GL_BACK)
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
|
||||||
|
# For uploading byte-packed textures. TODO: Does WebGL 2 ignore this?
|
||||||
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1)
|
||||||
|
glPixelStorei(GL_PACK_ALIGNMENT, 1)
|
||||||
self.bg_mesh = newMesh(self.engine, "_bg_mesh", common_attributes={vertex})
|
self.bg_mesh = newMesh(self.engine, "_bg_mesh", common_attributes={vertex})
|
||||||
self.bg_mesh.load_from_va_ia(@[-1'f32, -1, -1, 3, -1, -1, -1, 3, -1])
|
self.bg_mesh.load_from_va_ia(@[-1'f32, -1, -1, 3, -1, -1, -1, 3, -1])
|
||||||
self.bg_mesh.radius = Inf
|
self.bg_mesh.radius = Inf
|
||||||
|
@ -132,9 +135,9 @@ proc initialize*(self: RenderManager) =
|
||||||
self.no_material = self.engine.newSolidMaterial("_no_material", vec4(1,0,1,1));
|
self.no_material = self.engine.newSolidMaterial("_no_material", vec4(1,0,1,1));
|
||||||
self.camera_render_ubo = self.newUBO("CameraRenderUniform", CameraRenderUniform, 1)
|
self.camera_render_ubo = self.newUBO("CameraRenderUniform", CameraRenderUniform, 1)
|
||||||
# since this is a ref, it won't be destroyed until it's used
|
# since this is a ref, it won't be destroyed until it's used
|
||||||
let zero = newArrRef[uint8](3)
|
let zero = newArrRef[uint8](4)
|
||||||
zero.fill 0
|
zero.fill 0
|
||||||
self.blank_texture = self.engine.newTexture("",1,1,1,RGB_u8,pixels=zero.to float32)
|
self.blank_texture = self.engine.newTexture("",1,1,1,RGBA_u8,pixels=zero.to float32)
|
||||||
self.initialized = true
|
self.initialized = true
|
||||||
for fun in self.queue:
|
for fun in self.queue:
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue