Commit Graph

37 Commits

Author SHA1 Message Date
Paul Chote
1f849e9f7d Add antialiasing support for paletted sprites. 2020-01-26 20:22:49 +01:00
Paul Chote
7d887f0332 Fix NV shader compile errors in combined.frag. 2019-12-27 20:20:42 +01:00
Paul Chote
860117daf9 Implement optimized pixel-art antialiasing mode for non-integer world zoom. 2019-12-13 21:29:43 +01:00
Paul Chote
ce8112fb5a Migrate rendering to OpenGL 3.2 / OpenGL ES 3.0. 2019-09-12 18:58:37 +01:00
Paul Chote
95c5c683e3 Limit samplers to 8 in combined.frag.
The additional palette sampler wasn't accounted
for in the original PR.
2018-11-01 14:38:57 +01:00
Paul Chote
cc9da63323 Fix sampler index check
The index values are round numbers. Checking agaist
the half-values improves robustness against small
floating point delta errors that occur on some GPUs.
2018-10-06 15:10:43 +01:00
Paul Chote
2f2a7724d5 Rename shp.(frag|vert) to combined.(frag|vert). 2018-06-04 23:33:57 +02:00
Paul Chote
bfcbe8c004 Improve batching by binding up to 8 simultaneous textures. 2018-06-04 23:33:57 +02:00
Paul Chote
131496ebf8 Merge RGBA sprite rendering into SpriteRenderer.
Renderer.RgbaSpriteRenderer is kept as a thin
wrapper to maintain compatibility with consumer
code.
2018-06-04 23:33:57 +02:00
Paul Chote
c307b3e291 Encode channel attributes in a more sensible way. 2018-06-04 23:33:57 +02:00
Paul Chote
a329711011 Render lines using SpriteRenderer without breaking the batch. 2018-05-23 23:28:22 +02:00
Paul Chote
dc4c3fd546 Rename VoxelRenderer to ModelRenderer. 2017-06-14 18:56:06 +02:00
Paul Chote
d1b7d0e0fb Use the MATLAB Jet colormap for displaying depth data. 2016-08-28 11:52:16 +01:00
Paul Chote
50da18cd22 Add depth buffer support to RgbaColorRenderer. 2016-08-27 15:43:20 +01:00
Paul Chote
f0306e7cc2 Render voxels with an approximately-correct z-offset. 2016-08-21 12:43:16 +01:00
Paul Chote
3a37551812 Remove SheetType.DualIndexed from terrain rendering. 2016-04-15 16:53:37 -04:00
Paul Chote
b68fee9521 Remove SheetType.DualIndexed from voxel rendering. 2016-04-15 16:46:47 -04:00
Paul Chote
7c67b10d28 Add a secondary texture coordinate to Vertex. 2016-04-15 16:46:47 -04:00
Paul Chote
2634643d91 Write z data to the depth buffer. 2016-04-15 09:42:29 -04:00
Paul Chote
dabea59b7d Pass depth scale factors to vertex shaders. 2016-04-10 09:41:01 -04:00
Paul Chote
be29ec5342 Use explicit shader attributes. 2015-12-26 12:50:33 +00:00
Paul Chote
02dedf9acf Introduce RgbaColorRenderer class. 2015-12-10 23:22:07 +00:00
Paul Chote
83949b250a Add a visualisation mode for depth sprites.
For now this displays the raw sprites.  It will
eventually be repurposed for rendering the proper
depth data.
2015-10-17 22:35:47 +01:00
Paul Chote
9a5483fea7 Send TS terrain depth data to the GPU. 2015-10-17 22:34:46 +01:00
Paul Chote
d5fd8e5828 Use varyings for masks instead of overloading gl_TexCoord. 2015-10-17 22:28:19 +01:00
RoosterDragon
8c2fdb9097 Add CopyToArray method for IPalette.
By allowing a palette to be copied to an array, a speedup can be gained in HardwarePalette since palettes can be block copied using native magic rather than having to copy them item by item. We transpose the buffer in HardwarePalette in order to allow a contiguous block copy into this buffer, transposing again in the shader to keep everything correct.
2014-12-07 20:46:46 +00:00
RoosterDragon
7030d8b2b6 Changed HardwarePalette.ApplyModifiers to be more efficient.
- Add separate ImmutablePalette and MutablePalette classes since the distinction is extremely important to HardwarePalette.
- Keep a cache of palettes in HardwarePalette to avoid reallocation them every time ApplyModifiers is called.
- Palettes that are not allowed to be modified are copied to the buffer once when added, rather than every time ApplyModifiers is called.
- The AdjustPalette method now takes a read-only dictionary to prevent the dictionary being messed with.
- Added a constant for the palette size to remove its usage as a magic number in several areas.
- The ColorPreviewManagerWidget is annoying in that it needs to actually permanently update a palette after it has been added. To allow this, HardwarePalette now allows a palette to be replaced after initialization. The WorldRenderer therefore now also updates the PaletteReference it created earlier with the new palette to prevent stale data being used elsewhere.
2014-06-28 01:11:48 +01:00
Paul Chote
c5337cdcf3 Reimplement voxel rendering with a FBO. 2013-06-15 19:31:52 +12:00
Paul Chote
7d09e78655 Add WorldRgbaSpriteRenderer. 2013-06-15 19:16:08 +12:00
Paul Chote
a00696ec3b Add core voxel rendering code. 2013-06-04 20:40:24 +12:00
Paul Chote
a166815348 Remove duplication between world/chrome shaders. 2013-02-23 09:53:46 +13:00
Paul Chote
926b396605 Fix bogus naming of Shaders/Renderers. Split LineRenderer into world and chrome variants. 2011-07-25 22:23:16 +12:00
Paul Chote
493631cd90 Switch to the ARB apis and add capability and compile/link status checking. 2010-11-21 13:10:19 +13:00
Paul Chote
37edd072a6 shp shaders 2010-11-21 13:10:18 +13:00
Paul Chote
00358e9fe8 Working line shader 2010-11-21 13:10:18 +13:00
Paul Chote
518e00c78a Fix setting uniforms; chrome-rgba shader works, but lacks alpha blending. 2010-11-21 13:10:18 +13:00
Paul Chote
f2a20a182e Begin work on the glsl renderer. Renders blue blocks for chrome-rgba. 2010-11-21 13:10:18 +13:00