Questions tagged [shader]

A shader is a program to perform calculations on geometry or pixel data in computer graphics.

shader
Filter by
Sorted by
Tagged with
0 votes
0 answers
71 views

Creating a Fading Trail Behind a Moving Object in SFML?

I'm working on a project using SFML where I want to create a visually appealing, fading trail behind a moving object. I've attempted a couple of methods, but each seems to fall short due to what ...
nowox's user avatar
  • 27.5k
0 votes
0 answers
32 views

Render emissive light of an object even when the object is behind another object in Unity

I using Unity 2022.3.14f1 and URP rendering. I would like to render a light neon effect for an object which is under and other object in order to just see the emission like that : image rendered in ...
eva maurer's user avatar
0 votes
1 answer
97 views

Trouble Rendering Dynamic Texture from OffscreenCanvas in Three.js Shader

I'm working on a React Three Fiber project where I'm trying to render a dynamic texture from an OffscreenCanvas that's being updated in a WebWorker. However, all I'm getting is a black render on my ...
Joseph Ghaida's user avatar
1 vote
0 answers
65 views

Iteration of each pixel of a large bitmap in Unity Compute Shaders

I am trying to clone the map generation system of the game Europa Universalis IV. The game has a large sized bitmap and each province is colored in a unique color. I want to use compute shaders to ...
Emir Can Akgöl's user avatar
0 votes
0 answers
54 views

What are the expected packing/unpacking operations for signed octahedron normal encoding?

I'm looking to encode a 3-float normal to something smaller for passing to a compute shader, and "signed octahedron normal encoding" appears to be the standard (according to the addendum at ...
Mark A. Ropper's user avatar
0 votes
0 answers
23 views

How to pass data to shader constant buffer register bN (N > 15)

[Environment] DirectX11 (FeatureLevel 11.0) HLSL Shader Version vs_5_0/ps_5_0 I defined common constant buffers in my code (named Common.hlsli) float4x4 g_VS_Test0 : register( b0 ); float4x4 ...
RoXusNeXus's user avatar
0 votes
1 answer
37 views

How to smoothly blend a texure into near-black colours?

Are there shading methods that allow you to smoothly blend a texture into full blackness without those 'colour-bleeding' artifacts that can be seen on this picture: Screenshot taken in Unity using ...
marai.hmm's user avatar
0 votes
0 answers
25 views

Why is my SparkSL shader code behaving differently with and without an if statement with an unreachable condition?

I'm writing a shader for Meta Spark Studio which creates a wavy pattern: vec4 wavy(function<vec4(vec2)> tex, float waveAmplitude, float waveFrequency, float timeMultiplier) { vec2 coords = ...
Can Poyrazoğlu's user avatar
0 votes
0 answers
74 views

Unity URP my shader graph does not function when both input render textures are the same resolution

I created a decal shader for a fog of war effect for my RTS it functions as intended when different resolution the Vision texture is from a top view orthographic camera while the explored texture is ...
BobulosPrime's user avatar
0 votes
0 answers
83 views

Merge two scenes in Three.js and React Three Fiber

I’ve been dedicating my free time for the past 2 months to learn Three.JS and R3F, at least the basics to add details on my projects. Unfortunately, I can’t say I’ve progressed a lot, I am stuck with ...
Monospace's user avatar
0 votes
1 answer
90 views

How do you display a webcam feed in GLSL, using Three.js?

There are multiple examples on how to display a webcam video using ThreeJS by creating a video texture like so : video = document.getElementById( 'video' ); const texture = new THREE.VideoTexture( ...
Steve's user avatar
  • 7
0 votes
1 answer
423 views

Convert custom shader to URP in Unity

I'm working on a VR project in Unity that involves rendering 360 videos inside a sphere GameObject. Originally, the setup worked well using a custom shader that allowed the material to render inside ...
Руслан Василев's user avatar
0 votes
0 answers
128 views

SwiftUI colorEffect shader alpha not respected in Dark Mode

Xcode 15.0.1, iOS 17.0.2 Problem: when drawing a shader in Dark mode, a SwiftUI colorEffect shader does not respect the alpha channel of the given color. This occurs in the Xcode Canvas (Preview), the ...
Womble's user avatar
  • 5,171
-1 votes
1 answer
300 views

DirectX 11 - Why constant buffers D3D11_USAGE_DYNAMIC are update by the CPU and not the GPU?

So I'm trying to wrap my head around the D3D11 constant buffers, my current understanding is that constant buffers are used to store data that remains constant for an entire draw call but may change ...
IRP_HANDLER's user avatar
0 votes
0 answers
57 views

How to create anime speed lines in shader code?

I am using an unlit shader in Unity (Universal Render Pipeline) with HLSL. The Aim I am trying to create anime speed lines, similar to the picture below. The Problem I don't know how to proceed from ...
Magnality's user avatar
0 votes
2 answers
187 views

Metal Shader function with variadic arguments, called from SwiftUI?

My app requires to render a field strength in a SwiftUI View, i.e. to assign a color with a coordinate dependent opacity to each point of the View. This can be done using Canvas, as described here, ...
Reinhard Männer's user avatar
0 votes
0 answers
90 views

Implementation/algorithm to approximate AE white balance (temp/tint) in a shader

I'm trying to figure out the implementation/algorithm behind Adobe After Effects' Lumetri Color white balance controls to create a similar or approximate version in a GLSL shader. Specifically, I'm ...
OpherV's user avatar
  • 6,847
1 vote
1 answer
98 views

How can you invoke a MetalPerformanceShadersGraph directly from Metal Shaders?

There are many resources on Apple's developer documentation showing how to use Metal from Swift for ML to infer, or more specifically how to call a Metal Performance Shader graph of a neural network ...
dimroc's user avatar
  • 1,194
1 vote
1 answer
403 views

Vulkan compute shaders: Most efficient way to tranfer buffer to/from GPU? Retrieving the buffer seems to be slow

I am trying to use Vulkan now for some GPGPU work and am struggling to get decent performance on my GTX 1070. Let's say I want to run a compute shader against a block of data and write the result into ...
Caius Cosades's user avatar
1 vote
1 answer
41 views

SFML shaders (GLSL) calling texture2D() has side effects?

I am trying to use two textures with different resolutions (and thus different texture coordinates) in my shader. However, if I call texture2D() (or texture(), doesn't matter) on the second texture ...
doomista's user avatar
  • 511
0 votes
1 answer
66 views

How can I modify my shader code to make the background transparent?

I'm trying to work with this shader, but I need a transparent background and it renders a black background. I realized that this is done within the fragmentShader, but I haven't figured out how to ...
neo's user avatar
  • 1
0 votes
1 answer
38 views

WebGL trouble drawing two different 3d objects

In this WebGL code, it's meant to draw 3 3d monkeys, and 1 3d floor/plane. But whenever I create a buffer for that one floor shader program, it breaks the monkey shader program. So instead of ...
Brandon's user avatar
  • 15
0 votes
0 answers
14 views

Is there fallback strategy if user device or browser does not support vertex shaders of specific precision and ThreeJS crashes?

Our team facing more often than before with problem that may be related to wider spread of some (mobile?) devices that are already support (small or large) subset of WebGL. Even browser vendors think ...
Kote Isaev's user avatar
0 votes
0 answers
90 views

Unity URP custom line shader rendering flickering/artifacts, especially at high angle and distance

screenshot As you can see lines disappear at the end and it also flickers when moving the camera. I am rendering these lines using shader graph UV node and smoothstep. there is nothing suspicious ...
Lumi's user avatar
  • 1
0 votes
1 answer
33 views

Creating a shader why the compiled code in the editor show error identifier '_FillAmount'?

I checked so many time and the variable is declared but still it can't find it. The Fillamount should set how much the circle will be filled for example value 0 the circle will be like ring and value ...
Daniel Lip's user avatar
  • 10.8k
1 vote
1 answer
94 views

How to create a ring of circles in shader code?

I am using the Unity game engine with shader code (I'm a beginner). The Aim I am trying to create a ring of circles, similar to the picture below (I'm not concerned with the colours right now). The ...
Magnality's user avatar
0 votes
0 answers
43 views

GLSL: Separate sources and standalone validation

I want to be able to do these things: Write GLSL shaders Separate my sources for reusability purposes Validate all my sources before building the main application, and exit if anything fails The ...
Devsman's user avatar
  • 488
0 votes
0 answers
54 views

How to change the circle radius size smoothly when using shader?

The range of both variables Outer Radius and Inner Radius lines number 8 and 9 was 0,1 but I want to be able to change the circle radius to much bigger size so I changed the range on both to 0,1000 ...
Daniel Lip's user avatar
  • 10.8k
0 votes
0 answers
64 views

Debugging using Metal shader function

I use shader functions as modifier params for SwiftUI Views Is there a way to debug shader function in Xcode, to print values or set up debugging points? [[ stitchable ]] float2 someFunc(float2 ...
Igor Shel's user avatar
1 vote
0 answers
65 views

How to compile shader by code in unity3d?

I wrote some shader code in unity editor: Assets > Create > Shader > Standard Surface Shader then after created I did double click on it and visual studio 2022 opened with the shader code. I ...
Daniel Lip's user avatar
  • 10.8k
0 votes
0 answers
76 views

How to access SwiftUI Metal Shader source code in GPU debug sessions?

I want to step through a simple SwiftUI Metal Shader (a [[stitchable]] shader used with layerEffect(_:maxSampleOffset:isEnabled:)) in the GPU frame debugger. I set the appropriate build settings, but ...
Geri Borbás's user avatar
  • 16.3k
0 votes
0 answers
49 views

OpenGL draws a black triangle instead of coloured vertices

I try to implement a trivial graphical engine for my app based on OpenGL (glutin + glow). Below is my draw_object() function: fn draw_object(&mut self, object: &Object) { unsafe { ...
Denis Steinman's user avatar
0 votes
1 answer
382 views

Godot vertex shader to bend a mesh along a path (similar to the Blender's "Curve" modifier)

Similar question: Bend a mesh along spline Related: How to bend geometry with geometry nodes Related: Unity Curve Modifier What I'm trying to do: I want to create a Godot vertex shader that bends ...
reptofrog's user avatar
1 vote
1 answer
223 views

Create shader in code using Metal for .generateText on visionOS

I am trying to use Metal shaders to apply text effects to text made using .generateText on visionOS. I am using the following UI code, and I am able to assign SimpleMaterial like this: RealityView { ...
user7289922's user avatar
3 votes
0 answers
131 views

Seams on noise WGSL shader, porting gdshader to wgsl (bevy)

left is wgsl, right is gdshader Bevy MRE here I am trying to port a water shader written in gdshader to WGSL (in Bevy). However I noticed that there is some seaming going on. After some time I figured ...
Racid's user avatar
  • 353
3 votes
1 answer
235 views

how to configure Angular 17 builder to work with .glsl files?

Does anyone have a solution to work in the context of angular 17 with .glsl files (shaders) ? We used to be able to create a custom webpack builder but now angular uses vite... What do we do now ?
Brett's user avatar
  • 1,759
2 votes
1 answer
267 views

Convert Shadertoy Shader to glsl webgl

I need to convert this shadertoy shader to glsl , besically it turn-off the texture anti-aliasing, it is manual nearest neighbor filter void mainImage( out vec4 fragColor, in vec2 fragCoord ) { //...
NewPal's user avatar
  • 37
0 votes
0 answers
125 views

How to use a GLSL shader in Android

I'm new to the world of shaders especially in Android. I want to apply a GLSL shader to an image or a video in Android and see how it looks like. This repo has a few shaders that I would like to try. ...
angel_30's user avatar
0 votes
0 answers
28 views

Unity Shader Graph alpha has a blue red tint

Not sure why this is happening. I have a fire texture I generate, and I mask it with a vertical gradient which I used to feed into the output alpha. That worked perfectly. No blue hue as it got higher ...
Sailor Usher's user avatar
0 votes
0 answers
40 views

normalizing a radius in a shader via mix

I am trying to understand this Godot shader: shader_type canvas_item; render_mode unshaded; uniform float circle_size : hint_range(0.0, 1.05); uniform float screen_width; uniform float screen_height; ...
Another_coder's user avatar
0 votes
0 answers
34 views

Smudge fragment shader shows weird circle at the point of the smudge

I'm trying to create a "smudge" effect which will essentially push pixels around based on your mouse position. I've been able to get something kind of like what I'm going for, but it shows a ...
Arlo's user avatar
  • 31
0 votes
1 answer
201 views

What will be the command to generate app bundle in flutter with SkSL warmup

Using flutter SkSL warmup you can generate apk's using following command flutter run --profile --cache-sksl My Question is the same command will be used for build app bundle for android flutter build ...
Muddassar's user avatar
  • 451
0 votes
0 answers
46 views

Unity 2D lines shader (Built_in RP)

I want to create a shader that draws multiple lines inside an object like this Not exactly like this, but you get the idea. The width doesn't matter either, the line can be even 1 pixel thick. So ...
certrue's user avatar
  • 11
0 votes
0 answers
66 views

How to create a slice contour effect of a 3d object in Unity?

Task: Realize an effect that can be represented as follows. If this effect is applied to an object, for example, a sphere, then at a certain height (y-axis coordinate), a slice of this object will be ...
Cloud Factory's user avatar
0 votes
0 answers
62 views

FFT Implementation issues (GPU Shader)

I am trying to implement an FFT in a shader to run on the GPU. I grabbed the algorithm from here: https://github.com/jbouny/fft-ocean ... nShader.js However, when implemented and compared with other ...
ndivuyo's user avatar
0 votes
0 answers
18 views

Setting alpha in Custom Shader not working in cocos2dx

I want to fill the sprite with white and make it transparent but it doesn't work. What's wrong with this code? #include "HelloWorldScene.h" #include "SimpleAudioEngine.h" ...
lolyoshi's user avatar
  • 1,536
0 votes
0 answers
28 views

How to decide which stencil shader instance overwrites the other one?

in our game, we have a stencil shader for shadows. However, as the player moves to the shadows, the player shadow overwrites the tree shadows, resulting in the player feet not being in the shadows (...
KarelianPoem's user avatar
0 votes
0 answers
114 views

Python Moderngl Rain Ripple Shader

I am trying to recreate the ripple effect from the following article in python with glsl shaders and window managment via pygame https://web.archive.org/web/20160418004149/http://freespace.virgin.net/...
MiX's user avatar
  • 11
1 vote
0 answers
70 views

Vulkan + GLFW : How to write color to screen buffer as unsigned integer(s)?

I am learning about Vulkan by creating a little program that will render 3D scatter plots. Every point in the scatter plot has an (x,y,z) position and an rgba color. I am packing the rgba color into a ...
NewToVulkan's user avatar
0 votes
0 answers
96 views

(Unity shader). Problem with screen position

So I need to get the objects screen position, and here is the code I use for it: v2f vert(appdata_full v) { v2f o; o.vertex = UnityObjectToClipPos(v.vertex); o.uv = ComputeScreenPos(o....
certrue's user avatar
  • 11