Commit Graph

62 Commits

Author SHA1 Message Date
Hajime Hoshi
690c3cf981 graphics: Embed 'scale' part of the color matrix
If the color matrix includes only 'scale' part, they are embedded
into vertices in order to reduce draw calls.

Fixes #662
2018-08-10 23:20:55 +09:00
Hajime Hoshi
77e905eb25 Revert "graphics: Embed color matrices values to vertices (#655)"
This reverts commit 5a9235aaf9.
2018-08-06 01:44:31 +09:00
Hajime Hoshi
5a9235aaf9
graphics: Embed color matrices values to vertices (#655)
Fixes #531
2018-07-26 11:37:27 +09:00
Hajime Hoshi
e6d0943366 graphics: Rename color_matrix -> color_matrix_body 2018-06-06 02:46:54 +09:00
Hajime Hoshi
d7d892f2d6 graphics: Allow a little margin for edge pixels 2018-05-13 23:00:06 +09:00
Hajime Hoshi
a1dd7b39a3 graphics: Remove roundTexel function
Actually, at least 704d4cf464,
examples/moire doesn't work well without roundTexel on MacBook Pro.
However, now other parts are fixed (e.g. highp is used), it looks
like roundTexel is no longer needed.
2018-05-13 22:30:22 +09:00
Hajime Hoshi
b402cddd01 graphics: Bug fix: wrong refactoring in shader 2018-05-13 14:20:54 +09:00
Hajime Hoshi
efaa5aa17a graphics: Refactor shader 2018-05-13 03:31:28 +09:00
Hajime Hoshi
09166a6c42 graphics: Fix shaders cleaner way 2018-03-21 03:36:36 +09:00
Hajime Hoshi
0a5deab0a2 graphics: Reland Bug fix: More strict calculation for the nearest filter (#558)
Better version of bae8f9d874
2018-03-21 02:40:26 +09:00
Hajime Hoshi
b157f2d6d0 Revert "graphics: Bug fix: More strict calculation for the nearest filter (#558)"
This reverts commit bae8f9d874.

Reason: TravisCI failed
2018-03-20 04:16:37 +09:00
Hajime Hoshi
a40dc5cf22 graphics: Refactoring shader 2018-03-20 04:05:09 +09:00
Hajime Hoshi
bae8f9d874 graphics: Bug fix: More strict calculation for the nearest filter (#558) 2018-03-20 04:05:03 +09:00
Hajime Hoshi
927a4388b5 graphics: Bug fix: rounding texels is required even on the nearest filter
Fixes #558
2018-03-19 10:37:18 +09:00
Hajime Hoshi
efea65ee58 graphics: Bug fix: wrong texels were used (#546) 2018-03-11 04:11:49 +09:00
Hajime Hoshi
af64f8689a graphics: Fix screen filter calculation 2018-02-24 04:25:07 +09:00
Hajime Hoshi
9fba60ca03 Revert "graphics: Adjust texel positions for consitency"
This reverts commit 816fb314a4.
2018-02-24 01:52:49 +09:00
Hajime Hoshi
816fb314a4 graphics: Adjust texel positions for consitency
On second thought, given pixel coords represent a center of texels...
2018-02-24 01:52:05 +09:00
Hajime Hoshi
7c66d884d4 graphics: Adjusting position is no longer needed
Now pixel position is treated as left-upper in linear filter
2018-02-24 01:32:48 +09:00
Hajime Hoshi
e5a2cf29c0 graphics: Bug fix: pixel coord is upper-left by default 2018-02-24 01:16:32 +09:00
Hajime Hoshi
c76ff5ceb2 graphics: Bug fix: fix screen filter calculation
Fixes #512
2018-02-23 23:13:20 +09:00
Hajime Hoshi
b036cac616 graphics: Fix screen filter calculation 2018-02-23 02:36:12 +09:00
Hajime Hoshi
591e0ad995 graphics: Add 'screen' filter for fast rendering (#509) 2018-02-23 01:28:35 +09:00
Hajime Hoshi
4bbb4b0445 graphics: Remove unneeded comments (#491) 2018-02-03 03:32:03 +09:00
Hajime Hoshi
52350c1b1b graphics: Bug fix: TestImageEdge failed on MacBook Pro (#491) 2018-02-03 03:30:09 +09:00
Hajime Hoshi
beaa060ce3 graphics: Adjust texel values that can be exactly on the edges of the source rect (#491) 2018-02-03 02:07:46 +09:00
seebs
0b7ba8e573 Do GeoM projection on CPU (#477)
Handling GeoM projection on CPU may seem like a weird choice, given
how fast GPU is, but it pays off:

* You only have to do a very small subset of the actual matrix
  multiply.
* You don't have to construct a matrix in the vertex shader.
* Six fewer float32 values per vertex.
* You do still have to do the matrix computation for each vertex,
  though.

Signed-off-by: Seebs <seebs@seebs.net>
2018-01-14 16:01:55 +09:00
Hajime Hoshi
e13bb0769b graphics: Add 'not-reached' clause 2017-12-21 00:57:36 +09:00
Hajime Hoshi
0a99103bc1 graphics: Call roundTexel only on linear filter (#461) 2017-12-21 00:38:22 +09:00
Hajime Hoshi
8e72906f3d graphics: Separate GLSL programs for filters (#461) 2017-12-21 00:33:08 +09:00
Hajime Hoshi
f072e8f1c5 graphics: Optimize GLSL 2017-12-18 03:10:04 +09:00
Hajime Hoshi
44dc9f6220 graphics: Optimize fragment shader 2017-12-16 18:35:45 +09:00
Hajime Hoshi
6eb148b9a1 graphics: Fragment shader optimization (#461) 2017-12-16 05:05:21 +09:00
Hajime Hoshi
078d107c24 graphics: Bug fix: vertex position should be highp 2017-12-16 03:30:52 +09:00
Hajime Hoshi
d45a975e3d graphics: Remove one unnecessary check from fragment shader (#461) 2017-12-16 01:42:36 +09:00
Hajime Hoshi
d6878d6887 graphics: Remove one bound check from fragment shader (#461) 2017-12-16 01:33:35 +09:00
Hajime Hoshi
98532d8983 graphics: Add TestImageOutside 2017-12-14 00:25:35 +09:00
Hajime Hoshi
704d4cf464 graphics: texel should be represented as highp for precision
Fixes #460
2017-12-13 23:45:05 +09:00
Hajime Hoshi
aea2e491c3 graphics: Temporary hack for mobile browers
roundTexel doesn't work well on moible browsers
2017-12-12 03:27:56 +09:00
Hajime Hoshi
723d153800 Reland(2): graphics: Appropriate rendering of edges on linear filter 2017-12-12 00:03:01 +09:00
Hajime Hoshi
362d1c417f Revert 'graphics: Appropriate rendering of edges on linear filter (Reland)' (#458) 2017-12-11 20:30:54 +09:00
Hajime Hoshi
7b74a8f29f graphics: Improve roundTexel implementation 2017-12-07 03:24:46 +09:00
Hajime Hoshi
1152439e65 graphics: Appropriate rendering of edges on linear filter (Reland)
Fixes #456
2017-12-07 02:26:16 +09:00
Hajime Hoshi
8091aa5190 Revert 'graphics: Appropriate rendering of edges on linear filter' #456 2017-12-06 23:40:29 +09:00
Hajime Hoshi
bc0432f310 graphics: Appropriate rendering of edges on linear filter
Fixes #315
2017-12-06 21:40:24 +09:00
Hajime Hoshi
2e1e4adb84 graphics: Fix some variables in GLSL 2017-12-03 19:07:12 +09:00
Hajime Hoshi
8e7e960b56 graphics: Limit source-rectangle range
Remove texture adjustment introduced due to #317
2017-12-02 23:13:44 +09:00
Hajime Hoshi
ee98148b54 graphics: Use default precisions in the fragment shader 2017-07-29 04:08:03 +09:00
Hajime Hoshi
84a7787ac9 graphics: No need to specify precision on vertex shaders (highp is default) 2017-07-29 02:57:56 +09:00
Hajime Hoshi
d46d9ac7c2 opengl: Remove GlslHighpSupported 2017-07-24 22:59:25 +09:00