Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
5 views

Re-write Shader to be compatible on both Nvidia and AMD

I'm currently working with a very simple GLSL shader written for compatibility with HaxeFlixel that is meant to make an image scroll. It works fine for my computer, which uses an Nvidia graphics card. ...
Riley Reilly's user avatar
0 votes
0 answers
27 views

How can I take care of anti-aliasing/pixelation in QML when using a shader effect?

*Hi, I'm using a shader effect for my speed gauge implementation, and it works perfectly on the desktop application without any anti-aliasing issues. However, when I run the same code on an embedded ...
Raja's user avatar
  • 1
1 vote
0 answers
31 views

How to calculate Gertner waves normals?

I'm unable to properly calculate the normals for gertner waves following the Nvidia article vec3 get_wave(vec4 wave, vec2 direction,vec3 vtx) { // x = SPEED, y = WAVELENGTH, z = AMPLITUDE, w = ...
E F's user avatar
  • 11
0 votes
1 answer
35 views

Handling multiple render targets of differing sizes in Metal

I would like to use a fragment shader with multiple render targets to output YCbCr data from RGB input, where the Y data is written to one texture and the CbCr to another, smaller texture (due to ...
tenuki's user avatar
  • 370
0 votes
1 answer
44 views

How can i calculate the surface Point of a given Object?

I'm implementing ray marching in GLSL to render spherical objects with surface point visualization. The issue occurs when viewing the objects from certain angles - the surface position calculation ...
Sengeki's user avatar
  • 65
0 votes
0 answers
42 views

HLSL Shader, Unreal- Float seems to cause performance problems

I'm building a shader in Unreal using HLSL, and the final piece of it looks something like this- // Check un-overlapped ranges for (int r = 0; r < range_count; r++) { if (combined_spheres[r].y !...
Hadi Soufi's user avatar
0 votes
0 answers
26 views

WebGL Cannot draw gl.POINTS and gl.LINE_STRIP at the same time

I am currently learning WebGL and for that i am creating an app that draws B-Spline curves. In my code i have option of drawing both the vertices and the lines connecting those vertices in my curve. ...
Mauricio Polvora's user avatar
0 votes
0 answers
124 views

How to get shadow from additional light in Unity custom shader? (Self-solved)

I’m working on a project in Unity where I’m using a compute shader to render grass. The rendering path is Forward+, and I’m trying to make the additional lights affect the grass. I want to achieve ...
user16287208's user avatar
0 votes
1 answer
53 views

Three js and glsl multiple texture rendering issue

Hello i am trying to do 3d model configuration example with react, three fiber js and glsl There must be multiple stickers and stickers has to be arrangeable dynamicly(position, scale, rotation) so I ...
Bn'R's user avatar
  • 23
1 vote
1 answer
142 views

Analog speedometer with QML shader

I am trying to develop an analog speedometer in QML using a ShaderEffect, but I have not been able to achieve the expected result. The goal is for the fill shader (a red arc image, referred to as the ...
Webmaster's user avatar
1 vote
1 answer
27 views

Vulkan Wierd Texture Coordinate

To test my renderer, I just render a quad that fills the screen to texture sampling These are my vertex inputs in input assembly. The problem is that I rendered texture coordinates to screen and I ...
yigitEmre's user avatar
  • 101
0 votes
1 answer
39 views

Modifying Color Alpha Based On Distance With Camera in Frag Shader (UNITY 3D)

I have the following shader code: Shader "Ogxd/Wireframe" { Properties { _FadeDistance("Fade Distance", Float) = 3.0 _EdgeColor("Edge Color", Color) = (0 ,0 ,0 ,1) ...
Diveye's user avatar
  • 271
0 votes
0 answers
34 views

How to use NODE_POSITION_VIEW to get the centre of a node in the screen view

All I want is to be able to get the UV coordinate of the centre of a mesh (in this case, to take the colour from). However, in the code below, it gets the UV coordinate of the bottom right corner for ...
epic man's user avatar
1 vote
0 answers
22 views

Is a distance based approach better than a Barycentric based approach to outlining a polygon with many vertices in pixi.js?

I'm trying to apply a fragment shader to a Mesh within pixi.js. The calculation of the geometry of the shape is correct and the application of a shader to change the color of the entire shape works ...
thegraph1csman's user avatar
3 votes
1 answer
72 views

Why is writing to gl_FragDepth fast when using constant values, but slow when using varying values?

I have the following situation: I want to transfer depth values from a framebuffer with 1 sample to a different framebuffer with 8 samples. I think, the only way how this can be accomplished is by ...
j00hi's user avatar
  • 5,900
1 vote
0 answers
148 views

ImGui custom shader using vulkan

Im making gui in imgui, using example from official repository(example_glfw_vulkan), and i encountered a problem, that i cant apply shader to my popup`s background. expected result in this image you ...
Seleran's user avatar
  • 11
1 vote
1 answer
75 views

Error compiling fragment shader in Three.js: 'texture' not found

I'm working with Three.js and am facing an issue when compiling a fragment shader. Here's my code: https://jsbin.com/cigadibeya/3/edit?html,js,output. I tried to implement animation like here: https://...
user26951052's user avatar
1 vote
1 answer
88 views

In Godot 4, Shader not shading the correct pixels

I have a TileSet and I'm trying to apply a custom Shader and ShaderMaterial to one of my tiles. However, it's not shading the right area. I'm a newbie to both Godot and game development, but ...
dx_over_dt's user avatar
  • 14.3k
0 votes
0 answers
62 views

Reaction diffusion with shaders on WEBGL

I'm writing a reaction diffusion simulation with p5js based on a video and this tutorial. The code so far is this: var vertSrc = ` #ifdef GL_ES precision mediump float; #endif attribute vec3 ...
SandWood Jones's user avatar
0 votes
0 answers
26 views

How To Let ShaderMaterial Receive/Cast Shadows

So, I have been playing around with vertex and fragment shaders, and wanted to know if there was a way to add shadows to the fragment shaders? I have tried many unsuccessful attempts, and researched a ...
LeftClickMage's user avatar
-1 votes
1 answer
74 views

GLSL bouncing ball issue

#ifdef GL_ES precision mediump float; #endif uniform vec2 u_resolution; uniform vec2 u_mouse; uniform float u_time; vec3 color_bg = vec3(1.0); vec3 circle_color = vec3(0.0, 0.0, 0.0); void circle(...
David's user avatar
  • 1
0 votes
1 answer
65 views

Fix Incorrect Colors on Godot4 Shader

Inconsistent Results for Grass Shader Sampling Ground Texture Between Different Renderers I'm currently developing a Grass Shader that samples the ground texture in Godot 4. However, I've encountered ...
ilies's user avatar
  • 85
0 votes
0 answers
66 views

Sync issue for gl_InstanceIndex between vertex and fragment shader

I'm trying to implement this OpenGL text-rendering tutorial in Vulkan: https://learnopengl.com/In-Practice/Text-Rendering and the improvements in this video: https://www.youtube.com/watch?v=...
rgos's user avatar
  • 99
0 votes
1 answer
68 views

Issue with reading texture data inside RESHADE Pixel Shader

I am new to reshade, but not new to programming as a whole. I tried to implement a compute shader using modern re shade, who's information was then passed to a pixel shader that passed that data to ...
The Armored Panda's user avatar
0 votes
1 answer
21 views

When using points in ThreeJS there is a black background on each point if using depth writing

I have a scene where I use points, like so <points ref={gPoints} position={position}> <bufferGeometry attach="geometry"> <bufferAttribute ...
user25766836's user avatar
0 votes
1 answer
298 views

GLSL fragment shader Sine wave change the direction and color

I have glsl Fragment shader code need to change the line color, background color and, direction of the sine wave eprecision mediump float; #endif uniform vec2 u_resolution; uniform vec2 u_mouse; ...
Wimal Weerawansa's user avatar
5 votes
1 answer
121 views

OpenGL depth test with unclamped range

I'm using a OpenGL pipeline with a vertex and fragment shader, which is such that early fragment tests need to be enabled. So the depth test is always done with the vertex shader output gl_Position.z ...
tmlen's user avatar
  • 9,052
1 vote
0 answers
43 views

Drawing text over a shader

I have been going through Ebitengine's great tutorial for Kage https://github.com/tinne26/kage-desk/blob/main/docs/tutorials/intro/00_introduction.md (it's own shading language), and haven't been able ...
Ethan Leonard's user avatar
0 votes
0 answers
177 views

How can i use GLSL shaders with raylib-rust?

Right now i'm trying to use a simple shader in my raylib app. This is my simple_shader.fs file #version 330 out vec4 fragColor; void main() { fragColor = vec4(0.0, 0.0, 1.0, 1.0); } This is my ...
Dennis K.'s user avatar
1 vote
0 answers
79 views

Writing to a RWTexture2D in Fragment shaders

I'm new to this topic, and I know this sounds stupid, but I just really want to learn! So I found out I can write to RWTexture2D from my fragment shader(according to forum), but I can't really find ...
phal5's user avatar
  • 11
0 votes
1 answer
73 views

GLSL input/output variables with same name in different sources

I have a GLSL program that contains 3 fragment shader sources that would get linked together, like this: 1. #version 460 core void RunA(); void RunB(); void main() { RunA(); RunB(); } #version ...
tmlen's user avatar
  • 9,052
1 vote
1 answer
67 views

Shadow casted from custom GLSL unity shade doesn't match "surf" method output

Problem: I wrote a custom shader for making animated sprites from a sprite sheet (not going into why I'm doing that rather than use Unity's animation player for this project"). It works well, but ...
Marco Flores's user avatar
0 votes
0 answers
62 views

Finding x/y screen position of a Metal fragment shader modifier for custom ARKit/SceneKit occlusion

I have a simple ARKit/SceneKit app that draws a cube in front of the camera. Using the depth map, I want to hide the cube pixels that are occluded by an object. RealityKit supports occlusion, but ...
Steve Potter's user avatar
  • 1,919
0 votes
1 answer
136 views

Vulkan - Fragment shader doesn't seem to output anything to swapchain image

I started building a little renderer to try out Vulkan (coming from OpenGL). I started by a good old triangle but the fragment shader doesn't want to output anything. My output image (coming directly ...
Dv Senna's user avatar
0 votes
0 answers
46 views

R3F exported NodeToy shader is invisible

I am unable to get my glsl NodeToy dark pink shader to show up on the the arms and legs of the models of the caution symbol and X symbol. The flat dark pink shader that is currently visible is not the ...
Felt_Notebook's user avatar
0 votes
0 answers
108 views

Metal: Blending issues when rendering to a custom render texture

Goal: Render solid color quads with 0.5 alpha to my own transparent render target texture, then map the texture to a quad and render it to the screen. The texture should blend correctly (normal blend ...
Brian Spilner's user avatar
0 votes
1 answer
344 views

Godot Tilemap Tile Shader | Map pixel data to tile color

I've been trying to set the color of a tile based on a color in a texture. The texture's size is equivalent to the size of the tilemap, where each pixel represents one tile. I need this info because I ...
Knight Steele's user avatar
1 vote
0 answers
64 views

What is the use-case off an offset in texture sampling

In HLSL you can sample a texture with a coordinate and you can pass in an offset https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-to-sample The offset is added to texels, ...
samanthaj's user avatar
  • 650
0 votes
0 answers
21 views

How to apply the new vertices to the light in a graph shader

I am doing a shader to "simulate" waves on a plane. Here is my subshader for doing the curves of the waves. It works well, as you can see : The problem is, the light reflection isn't ...
user19013678's user avatar
0 votes
1 answer
339 views

Deck.gl v9 custom fragment shader is broken (Error: Error during linking: Fragment shader is not compiled.)

I'm using deck.gl to visualise a text layer with rounded corners on the _TextBackground sublayer. My code is basically a copy of the following example but it won't work with deck.gl v9 (works fine on ...
IgnorantUser's user avatar
2 votes
1 answer
194 views

Do GPUs perform instruction pipelining?

I usually write and optimize code to be run on the CPU, however I'm currently trying to write shaders for light scattering. I know CPUs have certain optimizations in order to try to get as close to 1 ...
Jam's user avatar
  • 574
0 votes
0 answers
37 views

How to use texture sampler node with texture type of Data

I'm trying to use a texture as data of floats, but I can't find how to do it. I created a tiff image of 3x2 floats using python as follows: import os import numpy as np import tifffile as tiff # ...
audi02's user avatar
  • 661
-1 votes
1 answer
108 views

Two problems in the pixel shader

My pixel shader is not working. I'm very bad at this so I couldn't solve this problem. Below is the pixel shader code: cbuffer CBuf { float4 face_colors[6]; }; float4 main(uint tid : ...
zavoevatelgribov's user avatar
0 votes
1 answer
190 views

How To Customize Alpha Transparency in Augmented Fragment Shader of Three.js Material?

I'm extending the THREE.MeshStandardMaterial with onBeforeCompile to adjust some details of the shader. I got the vertex shader working fine, but I'm having trouble figuring out how to set the alpha/...
Nicholas Westby's user avatar
0 votes
0 answers
28 views

How to convert Vertex Location calculations to Pixel Shader side

For my final project in my shaders class, I am supposed to convert the vertex displacement calculations to occur on the pixel shader side instead. I am doing this in XNA Monogame. My professor made a ...
Andrew Byers's user avatar
0 votes
0 answers
43 views

Add direction bias to a fire spreading simulation with GLSL

I am building a very basic web based 2D fire spreading simulation. I'm using the game of life kind of algorithm to make the fire spread. The problem is that I haven't figured out how to make it obey ...
murume's user avatar
  • 300
0 votes
0 answers
48 views

GLSL Getting a transparent border around my rectangle

I'm trying to create a shader which renders a rounded rectangle with a drop shadow. This is my main fragment shader vec2 center = (u_model_size.xy - vec2(100, 100)) * 0.5; vec2 ...
CrumpledMemories's user avatar
0 votes
1 answer
40 views

GLSL Box with shadows has a "cross" effect near its corner

The following GLSL code: void mainImage(out vec4 fragColor, in vec2 fragCoord) { vec2 uv = fragCoord / iResolution.xy; vec2 windowSize = iResolution.xy; float border = 50.0; vec2 ...
Roy Varon's user avatar
  • 608
0 votes
0 answers
41 views

GLSL fragment shader: How do I prevent seams when sampling half of texture to repeat? (with mipmapping or linear filtering on)

I have this texture One half is the base, the other half is the lit-up magma in the cracks of the rock, which fades in and out using a sine of time passed. The GLSL shader is as follows: // Lava ...
Jordon Moss's user avatar
0 votes
0 answers
35 views

How to draw chart with high point density(>1 point per px) in Unity?

I have big array of values/samples, and i need to draw wave chart in uGUI for it. So i have points with same interval at the coordinate x and i should connect them. I tried to draw it by few methods, ...
Mr. Don't know's user avatar

1
2 3 4 5
31