added additive blending.
This commit is contained in:
@@ -490,10 +490,14 @@ with the tiled map file at `path` and `unit` scale.
|
|||||||
(let [^Batch batch (.getBatch renderer)]
|
(let [^Batch batch (.getBatch renderer)]
|
||||||
(.setProjectionMatrix batch (.combined camera))
|
(.setProjectionMatrix batch (.combined camera))
|
||||||
(.begin batch)
|
(.begin batch)
|
||||||
(doseq [entity entities]
|
(doseq [{:keys [additive? opacity] :as entity} entities]
|
||||||
(.setColor batch (color 1 1 1 (or (:opacity entity) 1.0)))
|
(when additive?
|
||||||
|
(.setBlendFunction ^Batch batch (gl :gl-src-alpha) (gl :gl-one)))
|
||||||
|
(.setColor batch (color 1 1 1 (or opacity 1.0)))
|
||||||
(e/draw! entity screen batch)
|
(e/draw! entity screen batch)
|
||||||
(.setColor batch (color 1 1 1 1)))
|
(.setColor batch (color 1 1 1 1))
|
||||||
|
(when additive?
|
||||||
|
(.setBlendFunction ^Batch batch (gl :gl-src-alpha) (gl :gl-one-minus-src-alpha))))
|
||||||
(.end batch))
|
(.end batch))
|
||||||
entities)
|
entities)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user