7,009 questions
Advice
0
votes
2
replies
30
views
Is optimization done at graphics pipeline creation time between stages?
The reason I'm asking this question is because I have cases in a vertex shader where I have:
layout (location = 0) out float3 outEyeSpacePosition;
layout (location = 1) out float2 out_tex_coords;
And ...
Advice
0
votes
0
replies
60
views
Webgl Threejs canvas performance optimization
Hi guys i am trying to make a website with 3d model in it and you can apply patterns designs texts stickers on the model i am doing it with canvas atlas which is every assets renders inside the oen ...
0
votes
0
answers
67
views
Drawing a color wheel with fxc shader in a WPF app
I want to achieve something like this with fxc shader in a WPF application.
So far, with the below hlsl (High-Level Shading Language) code, I managed to produced this picture:
The problem is that I ...
1
vote
0
answers
101
views
Unable to render sprites in batches / instances using SDL3 GPU API and Odin. SSBO is not available to shader
I am new to graphics in general, so I am trying to learn from others.
After drawing a triangle, a quad and then a sprite on top, I have been trying to get a batch of them on screen using instancing.
...
3
votes
1
answer
142
views
Ursina Engine Shaders MacOS
I have freshly installed ursina in a virtual environment. I am trying to set up a basic scene with some lighting:
from ursina import *
class Pivot(Entity):
def update(self):
self....
0
votes
0
answers
63
views
RenderingServer cannot access global shader params
in Godot 4.4.1 I'm trying to access shader variables in code to do some math for my game. However, Even though I have set these shader parameters in global/shaders in project settings they don't show....
1
vote
2
answers
138
views
GLSL shader not showing anything in scene in THREE.js - why?
I'm trying to make my own shader for a THREE.js project I'm working on, and I wanted to make a GLSL shader as part of it for one of the meshes in my scene. However, despite writing very basic code for ...
0
votes
1
answer
190
views
I'm trying to use shaderc to compile a shader but keeps throwing an error that doesn't even seem relevant to my shader code
I'm on Linux and I am trying to compile basic shaders for bgfx using shaderc.
My Compile Lines:
shaderc -f ./vs_triangle.sc -o vs_triangle.bin --type vertex --platform linux --profile spirv --...
-2
votes
1
answer
57
views
Unity - Shader Graph - Channel Mixer [closed]
I started learning Unity and Shader Graph. Right now I try to understand, how the Channel Mixer is working internally.
I put in a color R 50,G 100,B 150 and the configuration on the output-R channel ...
0
votes
0
answers
136
views
How would I resolve this redefinition error in HLSL, despite not redefining anything?
I am currently learning how to write shaders in Unity, as the Unity environemt is most comfortable for me to use.
I want to create a procedural terrain, and currently trying to light it using ...
0
votes
0
answers
72
views
Flutter shaders: aurora points blending
I have an application that displays the northern lights on a map.
I receive a lot of points that need to be rendered (2000+ points).
Here’s what the final result should look like:
Since this puts a ...
0
votes
0
answers
60
views
Why is my shader's linear map range function not smooth?
I am trying to port a Blender shader to WGSL. My plan is to port over every node I need as a WGSL function (unless the node already has an equivalent in WGSL). Currently, I am trying to create an ...
1
vote
0
answers
83
views
How to set the default texture for a reuseable shader?
I'm making a small space shooter game to learn unity, and I want to use shaders so that the player and the enemies flash white whenever they're hit. However I don't know how to set the default texture ...
1
vote
1
answer
101
views
Black screen when using GL3 (OpenGL) with Maven and JOGL
I am trying to begin working with OpenGL by drawing a quad with the simplest of shaders, but when using GL3 capabilities, I just get a black screen. I wasn't able to really debug this because (a) I ...
1
vote
1
answer
85
views
Unexpected "does not contain #version" error adding basic shader to Ursina/Panda3D
My game project is built in Ursina, which is just Panda3D under the hood with some convenience functions.
I've tried adding a basic glsl vertex and fragment shader to a test file I have, and every ...
0
votes
0
answers
66
views
Flutter persistent canvas widget between navigation without redraw/rebuild that has to be part of the transition animation
Each screen in my app has this structure
Scaffold(
backgroundColor: Colors.red,
// params,
body: Stack(
alignment: Alignment.center,
children: [
// Remains ...
1
vote
1
answer
54
views
How to convert float4 color to half3 in Metal surface shader
In a Metal surface shader (for a custom material), the color = params.geometry().color() call returns a float4 type.
I guess that color is the interpolated color for the fragment in the triangle.
I'd ...
2
votes
0
answers
47
views
GL.DrawBuffers with DrawBuffersEnum.None crashes OpenGL
I use one shader that writes to 5 different textures bound to the FBO. Sometimes I want to ignore output values, i.e. at location = 0. I set it with this:
GL.DrawBuffers(5, new[] {
DrawBuffersEnum....
0
votes
2
answers
83
views
Is it possible to take references to avoid copies in shader languages?
I have used GLSL and Slang, and in my GLSL code I have very verbose code because I repeat the same code over and over:
obj_scaling = vec3(object_info_arrays[nonuniformEXT(...
0
votes
1
answer
124
views
PIXIJS v8: "Uniform type undefined is not supported" when passing float array uniform to a custom shader
I’m on PixiJS v8.1 (WebGL2) + TypeScript, trying to pass five RGB colors as a flat float[] into my fragment shader—but I keep getting:
Error: Uniform type undefined is not supported. Supported uniform ...
1
vote
0
answers
51
views
Artifacts in PCSS realization
I'm trying to write my own 3d renderer. I'm stuck in the shadow stage. I can't figure out what I'm doing wrong with the PCSS implementation. At the edges of tall objects, the shadow becomes sharp.
I ...
0
votes
0
answers
62
views
Noise pattern has subtle difference between glsl and hlsl
I'm using a noise algorithm from here, the code is
highp vec3 mod289(highp vec3 x) {
return x - floor(x * (1.0 / 289.0)) * 289.0;
}
highp vec4 mod289(highp vec4 x) {
...
0
votes
0
answers
34
views
Unwanted colored area while rendering Godot shader
I am writing a Godot shader that outlines edges based on normal buffer and depth buffer. Here's how it looks like:
Here's how it should look:
Here's the code:
} else {
float central_depth = ...
0
votes
2
answers
181
views
Fastest way to accumulate (reduce) a StructuredBuffer<float> in a compute shader
I've got a RWStructeredBuffer<float> tau I'm writing to in a ray generation shader rayGen. The DispatchRays dimension are (tauWidth, tauHeight, 1) and tau has exactly tauWidth * tauHeight ...
2
votes
1
answer
84
views
webgl canvas with shader not filling screen
how do I fill the full canvas with the full webgl shader layer? The canvas is filling the full window width and height, but the webgl shader layer is stuck to the top right quadrant of the screen at ...
0
votes
1
answer
53
views
How to draw a transparent sphere using scenekit + shader modifiers?
Is it possible to create a sphere with an opaque center and increasingly transparent closer to the surface, as in the image, using scenekit + shader modifier?
I thought I could use a fragment shader ...
1
vote
0
answers
66
views
Smooth per-pixel motion vectors relative to camera
I have searched the existing questions on my issue but could not find anything that helped me. I hope I didn’t miss anything, but if I did, please point me to it.
I have a problem with calculating ...
1
vote
1
answer
182
views
Do I reuse pipeline layout for shader objects in Vulkan?
I noticed that in the new Vulkan spec, Render Pass objects are obsoleted in favor of the newer Render Pass instance. And there's a newer mechanism to compile and use shaders: Shader objects - which ...
3
votes
1
answer
83
views
p5js filter shader causing graphics object transparency to turn black
I'm attempting to simulate wind blowing across plants on a p5js sketch and came across a lovely fragment shader that does pretty much what I want (// https://github.com/GameMakerDiscord/wind-shader
).
...
0
votes
1
answer
273
views
Creating a halftone effect with Three.js
I'm trying to create a reverse halftone effect using Three.js, specifically with Threlte. This is my reference image:
There are a couple of layers of dots, with some rather large areas of ...
0
votes
1
answer
98
views
I'm trying to add a glass effect to my GLB model in React Three Fiber based on the angle
I need the same effect like the screenshot below. Here is the sandbox
import React, { useEffect } from "react";
import { useGLTF, OrbitControls } from "@react-three/drei";
import { ...
-1
votes
1
answer
122
views
Implement effect of 3d card tilting
I want to achieve the effect of card tilting. When the mouse pointer approaches one corner of the card, this corner of the card will tilt downward. The current problem is that the card is not ...
2
votes
0
answers
184
views
raylib - input attribute to vertex shader
I have simple vertex shader
#version 330 core
in vec4 vertexPosition;
in vec4 vertexColor;
out vec4 v_color;
uniform mat4 mvp;
void main()
{
v_color = vertexColor;
gl_Position = mvp * ...
0
votes
0
answers
87
views
Using texture sample values in a critical section of WGSL fragment shader
I am getting errors when using a variable that is dependent on the value of a texture sample in the critical section of my fragment shader.
From what I understand, one should not sample textures in ...
3
votes
1
answer
87
views
How to optimize palette cycle in Unity shader?
I have a problem with badly optimized palette cycling function of the background shader:
Shader "Background/Earthbound"
{
// 6 things to solve
// X palette cycling
// X background scrolling
/...
0
votes
1
answer
62
views
rustgpu input SSBO disappearing?
I am encountering a strange error in rustgpu. I had a shader that was compiling through a custom wrapper around rustgpu, but I recently switched to cargo gpu.
In that shader I have an array input that ...
2
votes
2
answers
119
views
How to remove random noise from shader?
While working with a custom shader in hsls in unity 6 which swaps out the colors on an image with another set of colors I managed to get the colors to be recognized and swapped out properly but I now ...
1
vote
1
answer
123
views
How to support InstanceMesh / BatchedMesh in custom ShaderMaterial?
I have no idea how to extend my shader. It is quite simple. I have geometries with custom focus attribute with value between 0-1 and based on that I render plane colour. But for BatchedMesh this ...
0
votes
1
answer
65
views
Push Constant not a constant integer expression for setting uniform buffer array size
I'm trying to create a fragment shader for a Vulcan application that takes an array of texture2Ds. I have this working however i need to set the size of the array at application run time rather than ...
2
votes
0
answers
68
views
Passing depth buffer values as a texture to pixel shader
I'm very new to shader programming, so forgive me for any knowledge gaps or mistakes I've made.
I am currently following a technique discussed in Nvidia's GPU Gems: https://developer.nvidia.com/...
2
votes
2
answers
104
views
Alpha Gradient over mesh geometry in shader code
I have this scene and for the half transparent box geometry I want to create a shader that gradually reduced the alpha value of gl_FragColor going over the long axis (in this case the z axis in three ...
0
votes
0
answers
42
views
How to apply fragment transformation after vertex transformation
Hey I'm using GLSL Shader inside Godot, I "glued" these 2 shaders. One "pixelate" the TEXTURE on its local UV space and one displace thevertex in a sinusoid shape with TIMe (much ...
0
votes
1
answer
84
views
Material parameters being reset after setting via script
var node = currently_selected_MeshInstance3D
var materials = []
for i in range(node.get_surface_override_material_count()):
var mat_or = node.get_surface_override_material(i)
if mat_or and ...
2
votes
2
answers
279
views
Why is non-uniform dynamic indexing of descriptors/uniforms so hard to do?
Non-uniform dynamic indexing of descriptors is hard to do. I assume this is the case as it is (or was) only an "extension" in Vulkan, and many (or most) Android devices don't support Vulkan ...
0
votes
0
answers
40
views
Suggestions on how to fix holes appearing in 2D image rotation shader?
I have a HLSL shader I am using in unity and the idea is to take a 2D image and a depth map of that image, and rotate them based on an euler input. Right now it's rotating exactly how I want it to, ...
3
votes
1
answer
123
views
Three.js smooth particles opacity cut on depthTest
I have a particle system in three.js 0.173.0 with soft particle edges, and when z soring occurs the opaque pixels overwrite the scene rather than additionally drawn on the top, when the particle's ...
-1
votes
1
answer
61
views
Text shrinking problem on 3d model through shader and canvas
Hello currently i am developing a configurator but have some issues with texts. I am trying to render text on off canvas on 3d model through shaders but its acting weird. i can not set width and ...
0
votes
1
answer
111
views
Why is the grid visible through my custom shader in Unity?
In Unity's Editor Scene view, the grid is not visible through an object with the default Lit URP shader, but an object with my custom simple shader appears transparent to this grid. I don’t understand ...
-1
votes
1
answer
63
views
Is reading the depth buffer in the fragment shader supposed to drop performance? [closed]
I knew there were performance implications for writing to the depth value in the fragment shader. However I've found if I so much as read glFragCoord.z (only z, not x and y), my framerate drops from ...
0
votes
1
answer
72
views
How can I fix the cloud shader error "assignment to function"?
I was making a sky shader in Godot, but I encountered an error with the following code:
vec2 sky_uv = EYEDIR.xz / EYEDIR.y;
vec3 Clouds = texture(Cloud_texture, sky_uv * Cloud_scale * TIME * ...