Commit Graph

82 Commits

Author SHA1 Message Date
Hajime Hoshi
ff311dd564 graphicsdriver/opengl: Pass uniform values to useProgram 2020-05-17 19:43:01 +09:00
Hajime Hoshi
8ab12827c0 graphicsdriver/opengl: Refactoring 2020-05-17 19:01:46 +09:00
Hajime Hoshi
9cc128fb40 graphicsdriver/opengl: Integrate last uniform values 2020-05-17 18:36:33 +09:00
Hajime Hoshi
d12b406e0a graphicsdriver/opengl: Remove unused variables 2020-05-17 18:15:27 +09:00
Hajime Hoshi
eabe4152a7 graphicsdriver/opengl: Rename Driver -> Graphics 2020-04-04 17:23:38 +09:00
Hajime Hoshi
85cbc7e56b Enable to compile Ebiten on js/wasm with Go 1.14
Fixes #1024
2019-12-19 00:45:53 +09:00
Hajime Hoshi
52f6be2639 graphicsdriver/opengl: Fix suspicious GL function calls
Before this change, the pixel object buffer is unbound just after
getting a pointer by glMapBuffer. This seemed suspicious.

This change fixes to do all pixel manipulations once between
glMapBuffer and glUnmapBuffer without changing a bound buffer.

This might fix a wrong rendering on some machines, but I am not
sure.

Updates #993
2019-11-20 02:41:34 +09:00
Hajime Hoshi
acc933b7c3 graphicsdriver/opengl: Experimental PBO implementation
This change is an experimental implementation to use Pixel Buffer
Objects. This reduces calls of glTexSubImage2D.

This works only on desktops. Unfortunately WebGL does not have
this features. Mobiles can have PBO as of OpenGL ES 3.

Updates #976
2019-11-17 05:01:43 +09:00
Hajime Hoshi
f40798b586 graphics: Move const definitions to driver package
Let's keep 'graphics' package as a package for utility functions
or testable functions as much as possible.
2019-06-26 01:05:13 +09:00
Acid147
21abd85a63 Small cleanup (#877)
* Remove unused variables and constants
* Remove redundant return statement
* Change flock.NewFlock to flock.New
2019-05-26 18:06:43 +09:00
Hajime Hoshi
3d8a45a770 graphicsdriver/opengl: Refactoring 2019-02-17 14:30:32 +09:00
Hajime Hoshi
d927241223 graphicsdriver/opengl: Remove unnecessary function calls 2019-02-17 11:44:50 +09:00
Hajime Hoshi
a8b97c9755 graphicsdriver: Optimize shader (skip color matrix calculation)
Skip multiplying with a color matrix when possible.
2019-02-16 17:33:12 +09:00
Hajime Hoshi
1f46299870 graphicsdriver/opengl: Bug fix: source_size can be optimized out with nearest filter 2019-02-16 15:14:48 +09:00
Hajime Hoshi
09ca873c41 graphicsdriver/opengl: Use glBindAttribLocation instead of glGetAttribLocation
Attribute variables are often optimized out and it is really hard
to prevent this.

Instead of implicit indices of attribute variables, use explicit
indices by glBindAttribLocation.

Bug: #816
2019-02-16 14:35:53 +09:00
Hajime Hoshi
fd250c8d8c graphics: Rename NextPowerOf2Int -> InternalImageSize and add image size adjustment
There is a minimum internal image size on some system like old iOS
devices. This change adds adjustment of the size.

Issue: #810
2019-02-14 23:06:01 +09:00
Hajime Hoshi
c2c3579cde graphicsdriver/opengl: Reduce 'if' in shader programs
Fixes #812
2019-02-12 12:46:18 +09:00
Hajime Hoshi
758b957b01 graphicsdriver/opengl: Bug fix: filter is a preserved keyword (#771) 2019-01-07 11:20:29 +09:00
Hajime Hoshi
454a7d8ef9 graphicsdriver/opengl: Bug fix: misspelling on variables
Fixes #764
2018-12-26 03:03:06 +09:00
Hajime Hoshi
de788603d6 graphicsdriver/opengl: Remove init order dependency 2018-12-25 23:58:01 +09:00
Hajime Hoshi
f1582c2d73 graphics: Add Address representing a sampler address mode
Fixes #761
2018-12-24 17:29:31 +09:00
Hajime Hoshi
7e50ae39c9 graphicsdriver/opengl: Refactoring: Filter as a uniform value 2018-12-24 16:06:25 +09:00
Hajime Hoshi
4149a56524 graphics: Refactoring: Use 12 floats for each vertex
This is a preparation for #761.
2018-12-23 02:36:28 +09:00
Hajime Hoshi
31f15bc5ad Revert "graphics: Change the number of floats for a vertex from 10 to 12"
This reverts commit 7586c660d5.
2018-11-18 00:07:15 +09:00
Hajime Hoshi
d8f337985d graphicsdriver/opengl: Refactoring 2018-11-17 22:40:21 +09:00
Hajime Hoshi
ef08e218c8 graphicsdriver/opengl: Refactoring: Remove framebuffer.projectionMatrix 2018-11-17 22:29:04 +09:00
Hajime Hoshi
14f5a03a79 Merge math and graphics packages 2018-11-17 20:23:12 +09:00
Hajime Hoshi
44d1b137e7 graphicsdriver/opengl: Refactoring 2018-11-17 19:29:52 +09:00
Hajime Hoshi
7586c660d5 graphics: Change the number of floats for a vertex from 10 to 12
This is a preparation for Metal, that forces 4 floats for a vertex
position.
2018-11-17 15:30:11 +09:00
Hajime Hoshi
b2b51fb1bf graphicsdriver/opengl: Refactoring 2018-11-11 22:08:36 +09:00
Hajime Hoshi
734aeabc8d graphicsdriver/opengl: Remove theContext 2018-11-11 03:37:37 +09:00
Hajime Hoshi
241716d0e6 Add package graphicsdriver; Move opengl to graphicsdriver/opengl 2018-11-10 22:52:37 +09:00