geometry-shader


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);

Apply color gradient to material on mesh - three.js

穿精又带淫゛_ 提交于 2019-12-20 19:52:41
问题 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);

Apply color gradient to material on mesh - three.js

穿精又带淫゛_ 提交于 2019-12-20 19:52:11
问题 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);

Receive and cast shadows (custom GEOMETRY Grass Shader) - Unity C#

ぃ、小莉子 提交于 2019-12-13 03:19:27
问题 I was following a tutorial made by Sam Wronski aka. World of Zero (Tutorial by World of Zero) where he codes a geometry shader for a point cloud grass generator. Great tutorial but I am wondering (and didn't find a proper solution after days of research) how I could implement shadows to the shader (casting and receiving shadows). I am trying to dig deeper into shaders, but this is a level to high for me yet. My question is : how can I implement shadow casting and receiving for this grass

Geometry shader doesn't do anything when fed GL_POINTS

时光怂恿深爱的人放手 提交于 2019-12-12 19:32:07
问题 I'm trying to use geometry shaders to turn points into line segments (GL_POINTS to GL_LINE_STRIP), but no line segments appear. If I change the input to GL_LINES, and just repeat the vertex, then I get the behavior I'm expecting. What's going on? Here's a complete program that demonstrates the behavior. As-is, I get nothing but a black window. Setting USE_POINTS to False gets me the rotating psychedelic flashing lines I'm expecting. #!/usr/bin/python from OpenGL.GL import * from OpenGL.GLU

Single-pass wireframe issue

拟墨画扇 提交于 2019-12-11 04:16:22
问题 I am trying to implement single-pass wireframe, but I have got couple of issues in the process. Question #1 For some reasons I get only wireframe without (like with glPolygoneMode - lines) filled geometry after my geometry shader worked. ) But if I disable the geometry shader I get my geometry: What I really like to achieve is both geometry and its wireframe. Question #2 Actually, my primitives are triangle strips. I use them to avoid using on quads to improve performance. How can I skip

Wide lines in geometry shader behaves oddly

▼魔方 西西 提交于 2019-12-07 05:25:05
问题 I'm trying to render arbitrary wide lines (in screen space) using a geometry shader. At first it seems all good, but on certain view position the lines are rendered incorrectly: The image on the left present the correct rendering (three lines on positive X, Y and Z axes, 2 pixel wide). When the camera moves near the origin (and indeed near the lines), the lines are rendered like the right image. The shader seems straightforward, and I don't understand what's going on my GPU: --- Vertex Shader

工具导航Map