geometry-shader

Qt3D geometry shader working in QML but not in C++

混江龙づ霸主 提交于 2020-08-20 06:11:07
问题 Update The OpenGL version seems to be 4.3 at least according to the following code QSurfaceFormat format = view.format(); int major = format.majorVersion(); int minor = format.minorVersion(); so geometry shaders should work and the issue seems to be something else. Original Question While trying to answer this question related to how to create billboards in Qt3D I encountered an issue I found no solution for. I used the code from this GitHub repository which contains C++ and QML. It works

GLSL Geometry shader to replace glLineWidth

喜欢而已 提交于 2020-04-14 04:11:48
问题 I'm trying to write a geometry shader to replace glLineWidth behavior. I want to draw lines with a customizable width (doing this with a uniform suffices for now). The lines should always have the same thickness, regardless of the camera projection or distance to where the lines are. Based on a lot of googling, I've come up with the following geometry shader: #version 330 layout (lines) in; layout (triangle_strip, max_vertices = 4) out; uniform mat4 u_model_matrix; uniform mat4 u_view_matrix;

GLSL Geometry shader to replace glLineWidth

拜拜、爱过 提交于 2020-04-14 04:09:17
问题 I'm trying to write a geometry shader to replace glLineWidth behavior. I want to draw lines with a customizable width (doing this with a uniform suffices for now). The lines should always have the same thickness, regardless of the camera projection or distance to where the lines are. Based on a lot of googling, I've come up with the following geometry shader: #version 330 layout (lines) in; layout (triangle_strip, max_vertices = 4) out; uniform mat4 u_model_matrix; uniform mat4 u_view_matrix;

Calculate Normals Geometry Shader

我的未来我决定 提交于 2020-01-03 03:35:10
问题 Im currently writing my own GLSL shaders, and wanted to have smooth shading. The shading worked when i calculated the normals bevore sending them to a VBO, but the problem here is when I implement animations with bone matricies, the normals are not corect. I am using a geometry shader to calculate the normals, but i cant find out how to smooth them. Here is my geometry shader: #version 150 layout(triangles) in; layout (triangle_strip, max_vertices=3) out; in vec2 texCoord0[3]; in vec3

SceneKit - Map cube texture to box

旧城冷巷雨未停 提交于 2020-01-02 05:46:04
问题 I've a texture for a cube that looks like I'd like to use it on a cube in a SceneKit view. I'm using the SceneKit geometry SCNBox for that. Unfortunately, the result is that the texture is projected entirely on each face, instead of using only the corresponding part: let videoGeometry = SCNBox(width: 1, height: 1, length: 1, chamferRadius: 0) videoGeometry.firstMaterial?.isDoubleSided = true videoGeometry.firstMaterial?.diffuse.contents = UIImage(named: "test")! I know I can use shader

PassThrough Geometry Shader Not Working

眉间皱痕 提交于 2019-12-23 05:45:06
问题 I am using FragmentShader and VertexShader at present, and works absolutely fine. I cannot get my geometry shader working. I am absolutely new to it, below is what I have tried. I am using VBO, lighting and textures along with some geometry, but it works fine before using GeometryShader. the only thing I have changed is the variable names as I had to get the input in the geometry shader and give the output. So I have appended 1 at the end of those variable names those which will go out from

Apply color gradient to material on mesh - three.js

和自甴很熟 提交于 2019-12-20 19:53:36
问题 I have an STL file loaded into my scene with a single colour applied to a phong material I'd like a way of applying two colours to this mesh's material with a gradient effect applied on the Z axis a like the example below.Gradient Vase]1 I have a feeling I may have to introduce shaders but I've not gotten this far with three.js. 回答1: Simple gradient shader, based on uvs: var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera(60, 1, 1, 1000); camera.position.set(13, 25, 38);