Replace glDrawBuffers with glNamedFramebufferDrawBuffers
This commit is contained in:
@@ -20,8 +20,8 @@ void main()
|
|||||||
vec4 a1 = theMat * p1;
|
vec4 a1 = theMat * p1;
|
||||||
vec4 a2 = theMat * p2;
|
vec4 a2 = theMat * p2;
|
||||||
// if (0 > isLHS (a1.xy - a2.xy, a1.xy - "viewFromPoint")) {
|
// if (0 > isLHS (a1.xy - a2.xy, a1.xy - "viewFromPoint")) {
|
||||||
vec4 p3 = vec4 (p1.xy,5000,1); //note the random z value, used for GL_DEPTH_CLAMP
|
vec4 p3 = vec4 (p1.xy,500,1); //note the random z value, used for GL_DEPTH_CLAMP
|
||||||
vec4 p4 = vec4 (p2.xy,5000,1);
|
vec4 p4 = vec4 (p2.xy,500,1);
|
||||||
vec4 a3 = theMat * p3;
|
vec4 a3 = theMat * p3;
|
||||||
vec4 a4 = theMat * p4;
|
vec4 a4 = theMat * p4;
|
||||||
gPos = p1;gl_Position = a1; EmitVertex();
|
gPos = p1;gl_Position = a1; EmitVertex();
|
||||||
|
|||||||
@@ -115,8 +115,8 @@ inventoryX c = case c of
|
|||||||
"A" ->
|
"A" ->
|
||||||
[introScan t | t <- [minBound..maxBound]] <>
|
[introScan t | t <- [minBound..maxBound]] <>
|
||||||
[ flameThrower
|
[ flameThrower
|
||||||
, fuelPack
|
|
||||||
, chemFuelPouch
|
, chemFuelPouch
|
||||||
|
, fuelPack
|
||||||
, copier ABSOLUTE
|
, copier ABSOLUTE
|
||||||
, nulgate
|
, nulgate
|
||||||
, unigate
|
, unigate
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ spanColLightBlackI col h a b =
|
|||||||
V2 x y = 0.5 *.* (a +.+ b)
|
V2 x y = 0.5 *.* (a +.+ b)
|
||||||
|
|
||||||
spanLightI :: Point2 -> Point2 -> Placement
|
spanLightI :: Point2 -> Point2 -> Placement
|
||||||
spanLightI = spanColLightI 0.75 50
|
spanLightI = spanColLightI 0.75 50.1
|
||||||
|
|
||||||
spanLightY :: Point2 -> Point2 -> Point2 -> Point2 -> Placement
|
spanLightY :: Point2 -> Point2 -> Point2 -> Point2 -> Placement
|
||||||
spanLightY l x y z =
|
spanLightY l x y z =
|
||||||
|
|||||||
+13
-13
@@ -161,7 +161,8 @@ doDrawing' win pdata u = do
|
|||||||
2
|
2
|
||||||
ptr
|
ptr
|
||||||
withArray [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2] $
|
withArray [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2] $
|
||||||
\ptr -> glDrawBuffers 3 ptr
|
glNamedFramebufferDrawBuffers (pdata ^. fboBase . _1 . unFBO) 3
|
||||||
|
-- \ptr -> glDrawBuffers 3 ptr
|
||||||
--draw walls onto base buffer
|
--draw walls onto base buffer
|
||||||
-- maybe cull faces? maybe do this before?
|
-- maybe cull faces? maybe do this before?
|
||||||
glEnable GL_CULL_FACE
|
glEnable GL_CULL_FACE
|
||||||
@@ -202,7 +203,8 @@ doDrawing' win pdata u = do
|
|||||||
0
|
0
|
||||||
(fromIntegral nchs)
|
(fromIntegral nchs)
|
||||||
withArray [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2] $
|
withArray [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2] $
|
||||||
\ptr -> glDrawBuffers 3 ptr
|
glNamedFramebufferDrawBuffers (pdata ^. fboBase . _1 . unFBO) 3
|
||||||
|
-- \ptr -> glDrawBuffers 3 ptr
|
||||||
glDepthMask GL_TRUE
|
glDepthMask GL_TRUE
|
||||||
--draw floor onto base buffer
|
--draw floor onto base buffer
|
||||||
glUseProgram (pdata ^. floorShader . shaderUINT)
|
glUseProgram (pdata ^. floorShader . shaderUINT)
|
||||||
@@ -254,7 +256,7 @@ doDrawing' win pdata u = do
|
|||||||
renderLayer BloomNoZWrite shadV pokeCounts
|
renderLayer BloomNoZWrite shadV pokeCounts
|
||||||
glDepthMask GL_TRUE
|
glDepthMask GL_TRUE
|
||||||
renderLayer BloomLayer shadV pokeCounts
|
renderLayer BloomLayer shadV pokeCounts
|
||||||
-- draw clouds, transparency blocks some alpha
|
-- draw clouds to block bloom particles, transparency blocks some alpha
|
||||||
glDepthMask GL_FALSE
|
glDepthMask GL_FALSE
|
||||||
glBlendColor 0 0 0 0.1 -- using this and GL_CONSTANT_ALPHA below
|
glBlendColor 0 0 0 0.1 -- using this and GL_CONSTANT_ALPHA below
|
||||||
-- can allow for some underlighting of the clouds
|
-- can allow for some underlighting of the clouds
|
||||||
@@ -284,15 +286,10 @@ doDrawing' win pdata u = do
|
|||||||
glBindFramebuffer GL_FRAMEBUFFER (_unFBO (fst (_fboCloud pdata)))
|
glBindFramebuffer GL_FRAMEBUFFER (_unFBO (fst (_fboCloud pdata)))
|
||||||
glDepthFunc GL_LEQUAL
|
glDepthFunc GL_LEQUAL
|
||||||
glDepthMask GL_FALSE
|
glDepthMask GL_FALSE
|
||||||
--blendFunc $= (SrcAlphaSaturate,One)
|
|
||||||
--blendColor $= Color4 0.5 0.5 0.5 0.5
|
|
||||||
--blendFuncSeparate $= ((SrcAlphaSaturate,One) , (One,OneMinusSrcAlpha))
|
|
||||||
--blendFuncSeparate $= ((SrcAlpha, OneMinusSrcAlpha), (One, OneMinusSrcAlpha))
|
|
||||||
--glBlendFuncSeparate GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA GL_ONE GL_ONE_MINUS_SRC_ALPHA
|
|
||||||
glBlendFuncSeparate GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA GL_ONE_MINUS_DST_ALPHA GL_ONE
|
glBlendFuncSeparate GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA GL_ONE_MINUS_DST_ALPHA GL_ONE
|
||||||
--glBlendFuncSeparate GL_SRC_ALPHA_SATURATE GL_ONE_MINUS_SRC_ALPHA GL_ONE GL_ONE_MINUS_SRC_ALPHA
|
--withArray [GL_COLOR_ATTACHMENT0, GL_NONE] $ \ptr -> glDrawBuffers 2 ptr
|
||||||
--glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
withArray [GL_COLOR_ATTACHMENT0, GL_NONE]
|
||||||
withArray [GL_COLOR_ATTACHMENT0, GL_NONE] $ \ptr -> glDrawBuffers 2 ptr
|
$ glNamedFramebufferDrawBuffers (pdata ^. fboCloud . _1 . unFBO) 2
|
||||||
withArray [0.5, 0.5, 0.5, 0] $ \ptr ->
|
withArray [0.5, 0.5, 0.5, 0] $ \ptr ->
|
||||||
glClearNamedFramebufferfv
|
glClearNamedFramebufferfv
|
||||||
(pdata ^. fboCloud . _1 . unFBO)
|
(pdata ^. fboCloud . _1 . unFBO)
|
||||||
@@ -319,7 +316,8 @@ doDrawing' win pdata u = do
|
|||||||
glDepthFunc GL_ALWAYS
|
glDepthFunc GL_ALWAYS
|
||||||
glDisable GL_BLEND
|
glDisable GL_BLEND
|
||||||
withArray [GL_NONE, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2] $
|
withArray [GL_NONE, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2] $
|
||||||
\ptr -> glDrawBuffers 3 ptr
|
-- \ptr -> glDrawBuffers 3 ptr
|
||||||
|
glNamedFramebufferDrawBuffers (pdata ^. fboCloud . _1 . unFBO) 3
|
||||||
withArray [0, 0, 0, 0] $ \ptr ->
|
withArray [0, 0, 0, 0] $ \ptr ->
|
||||||
glClearNamedFramebufferfv
|
glClearNamedFramebufferfv
|
||||||
(pdata ^. fboCloud . _1 . unFBO)
|
(pdata ^. fboCloud . _1 . unFBO)
|
||||||
@@ -374,7 +372,9 @@ doDrawing' win pdata u = do
|
|||||||
--apply lightmap to cloud buffer
|
--apply lightmap to cloud buffer
|
||||||
glBindFramebuffer GL_FRAMEBUFFER (_unFBO (fst (_fboCloud pdata)))
|
glBindFramebuffer GL_FRAMEBUFFER (_unFBO (fst (_fboCloud pdata)))
|
||||||
glDepthMask GL_FALSE
|
glDepthMask GL_FALSE
|
||||||
withArray [GL_COLOR_ATTACHMENT0, GL_NONE] $ \ptr -> glDrawBuffers 2 ptr
|
withArray [GL_COLOR_ATTACHMENT0, GL_NONE] $
|
||||||
|
glNamedFramebufferDrawBuffers (pdata ^. fboCloud . _1 . unFBO) 2
|
||||||
|
-- $ \ptr -> glDrawBuffers 2 ptr
|
||||||
glDepthFunc GL_ALWAYS
|
glDepthFunc GL_ALWAYS
|
||||||
glBindTextureUnit 0 (_unTO . snd $ _fboLighting pdata)
|
glBindTextureUnit 0 (_unTO . snd $ _fboLighting pdata)
|
||||||
glEnable GL_BLEND
|
glEnable GL_BLEND
|
||||||
|
|||||||
Reference in New Issue
Block a user