Comments (8)
I should comment that our GPU is quite beefy (P6000) and I'm not implying there won't be a performance hit on other GPUs. I would think a user would naturally select between the implementations by using floats vs doubles when creating lines.
from jplotter.
Hey there,
Thanks for posting here! I've come across this issue of too little precision before and as you mentioned, there are a few possible work arounds which would solve this, but require quite some implementation effort (e.g. rescaling coordinates) to work with the coordinate system.
I'm definitely curious about the GL double precision variant of the Lines
and LinesRenderer
classes! Maybe the prototypical adaption carry over easily to the other renderers as well.
How come such a high version of GL is required? I thought double precision was supported starting from 4.0.
from jplotter.
Hi hageldave,
You are right about OpenGL version: the API calls work with GL40., although the GLSH scripts require #version 410. I have implemented Lines
and Points
, with a crude binary switch (from an external class) to choose float vs double. I've attached the relevant files. I'm sure you'll find a nice way to auto-trigger the right shader and code - e.g., use the vertex types the user provides. Let me know if you have any questions.
from jplotter.
@nasamaher thanks for contributing your code :) I will make the other GL renderers (Text, Triangle, Curves) also capable of using double precision and come up with a mechanism for choosing/autosetting the precision.
I found a bug that you may want to fix in your own code base. It has to do with dashed line rendering. I fixed it already in the new branch, see
here the parameters
scaleX
and scaleY
need to be passed to the methods instead of passing 1,1from jplotter.
Happy to contribute. Thanks for the bug warning.
from jplotter.
Double precision in GL rendering has been implemented for all of the 'basic' renderers (lines, points, curves, triangles, text).
The respective renderers, as well as CompleteRenderer
and ChainedRenderer
, provide a method setGLDoublePrecisionEnabled(boolean enable)
to enable double precision rendering. We chose this mechanic over the alternative of using a flag in the Renderable
(i.e. specifying in a Lines
object that it wants to be rendered with double precision) since it would cause costly changes of render programs while running the render routine of a Renderer
This led to a few breaking changes in the API of GenericRenderer
and its subclasses (i.e. the basic renderers) and corresponding Renderable
implementations (i.e. Lines
, Curves
, Points
, ...) related to the render and updateGL calls. These are internal however, and most likely nothing a user of this library would touch anyway.
This functionality is now on the master branch as of 8480130 and will be part of the next release of JPlotter.
There is also a little test class for checking out the effects of double precision rendering. Zoom in until it gets messy, then turn on double precision in the GUI.
@nasamaher I hope you are happy with this solution ;)
from jplotter.
@hageldave, wonderful! I think the "high-level" flag is appropriate. Thank you for your efforts.
from jplotter.
finally released in v0.6.0 (bd7cf5c)
from jplotter.
Related Issues (20)
- Ready-to-use line chart class
- Glyph associated with a Points objects does not have to be final
- Global saturation change of basic renderables (Points,Lines, Triangles...)
- Triangle Glyphs broken in GL
- PDF Rendering: rendering issues in various renderers HOT 2
- GUI for exploring/debugging renderers of a canvas HOT 2
- Enhancement - log axes? HOT 3
- Key Masking HOT 2
- make Legend more interactive
- possibility to adapt view to aspect ratio of coordinate system HOT 1
- Line drawing stalls on small ranges HOT 2
- Isolines not rendering the entire view HOT 5
- SVG rendering inconsistency HOT 1
- Overview of the branches' progress currently being developed
- Issue with text rendering in SVG
- BarycentricGradientPaint triangle does not overlap with a triangle painted using drawPolygon HOT 14
- Please help with java.util.ConcurrentModificationException HOT 2
- HiDPI scaling creates flickering and scaling artifacts HOT 17
- Dependency update HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jplotter.