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)]
|
||||
(.setProjectionMatrix batch (.combined camera))
|
||||
(.begin batch)
|
||||
(doseq [entity entities]
|
||||
(.setColor batch (color 1 1 1 (or (:opacity entity) 1.0)))
|
||||
(doseq [{:keys [additive? opacity] :as entity} entities]
|
||||
(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)
|
||||
(.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))
|
||||
entities)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user