Comments (4)
I'll use the workaround. Thanks for such a quick answer!
from glslviewer.
I found this example, is slightly different because it encode the direction that the vertex needs to take on the a_normal
vertex attribute.
shader.vert
#ifdef GL_ES
precision mediump float;
#endif
uniform mat4 u_projectionViewMatrix;
uniform float u_radius;
uniform float u_width;
attribute vec4 a_position;
attribute vec4 a_color;
attribute vec3 a_normal;
attribute vec2 a_texcoord;
varying vec4 v_position;
varying vec4 v_color;
varying vec2 v_texcoord;
void main() {
v_texcoord = a_texcoord;
v_position = a_position;
v_color = a_color;
v_position.xyz += a_normal * u_width;
gl_Position = u_projectionViewMatrix * v_position;
}
from glslviewer.
Hi @snibbe! So happy and honored seeing you here! Just send you a quick mail, this is one of those cases. GlslViewer geometry loaders mostly know to work with points and triangles at the moment. I usually work with lines them by creating collapsed geometry composed of triangles.
The trick require:
- creating a spline (a line constructed of triangles). where each pair of vertices at each side of the spline is send to the same position.
- using the
a_texcoord
attribute then I extrude it dynamically on the vertex shader.
I know a bit convoluted.
I will try to bring supporting for them when I have some time.
from glslviewer.
If you happen to have an example vertex shader that does this, I would be very grateful if you posted it here. The solution I just tried uses gl_VertexID, but for some reason the glsl version on my Mac in glsViewer is limited to 1.2 and doesn't support gl_VertexID.
from glslviewer.
Related Issues (20)
- Can virtual cameras be opened as streams in Windows?
- Screenshots are twice the resolution specified
- Crash when clearing loaded models
- Spaces cauing issues without syntax errors
- Missing Include and installation docs for Suse
- glslViewer does not compile. HOT 8
- Setting Icon= in desktop file not always working HOT 1
- glslViewer looks for libavdevice.so.58, but I have 59 (Debian 12.1) HOT 4
- 3.2.2 win64 Record video rate not being set correctly HOT 1
- A way to pipe the image output directly to STDOUT instead of saving to a file in headless mode?
- Installer
- [bug] Segmentation fault within the `ncurses` console because of a race condition HOT 1
- [BUG] macro expansion causes syntax error
- Launch with file that doesn't have .frag extension HOT 2
- Audio - NULL Capture Device on Mac HOT 1
- Raspberry PI 5 HOT 4
- Fullscreen window disappear when losing focus
- Unable to install [email protected] on scoop for windows build HOT 2
- Webcam input fails with "Failed to decode packet: End of file"
- "GLFW error 0x1000c: Cocoa: Regular windows do not have icons on macOS" on M1 mac HOT 2
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 glslviewer.