Questions tagged [shaders]

a computer program that runs on graphics hardware and provides a high degree of control over how scenes are rendered

Filter by
Sorted by
Tagged with
0 votes
0 answers
13 views

How to deform mesh's actual vertices, based on shader waves code?

I am using a shader that is applying a visual deformation that looks like Gerstner waves. It works great, but I need the mesh's actual vertices to deform based on these formulas as well. How can this ...
0 votes
0 answers
30 views

OpenGL rendering a specific color attachment to the screen

Current fragment shader: layout(location=0) out vec4 output_0; layout(location=1) out vec4 output_1; Here I want to render the output_1 to the screen instead of ...
1 vote
1 answer
58 views

Pack 4 textures into one channel

Can I pack 4 grayscale textures into one channel by converting the textures into uints and packing them? ...
0 votes
0 answers
44 views

Which is better to use C# and Shader to move textures?

We could use C# code Material.SetTextureOffset to move a texture, and ShaderGraph can do the same by Time and ...
  • 101
1 vote
1 answer
38 views

D3D11 ERROR ("invalid arguments") from HLSL shader

I am using MonoGame 3.8.1.303 with Windows/DirectX. I am just rendering a TriangleList using DrawIndexedPrimitives, but I am ...
  • 362
0 votes
1 answer
40 views

Why do my game objects become invisible as soon as I attach the material to which this shader script is applied?

I wrote a shader script that is an extension of the Sprite-Lit shader in previous Unity versions' standard assets in an attempt to feather the edges of a sprite using additive blending. Here is the ...
1 vote
0 answers
26 views

Is there an alternative method do do per-texel lighting in 3D without stream compaction?

Note: I'm not asking for an x% faster method. Work efficiency is an objective measure, it doesn't change because of hardware. I've got a voxel world I'm trying to render, think Minecraft, same texture ...
  • 1,713
-1 votes
1 answer
96 views

Batch rendering model matrix to shader

I'm working on a batch renderer. I'm limited to using one shader per batch (one draw call for everything). I want to use a TBN matrix for my lighting. To calculate the TBN matrix for each object I ...
  • 101
0 votes
0 answers
32 views

Get vertices back from shadergraph?

I am making waterwaves in shadergraph and i want to make a boat that will bop around on those waves, but to do that i need to get those vertices back into the CPU. I am unable to replicate those waves ...
0 votes
1 answer
52 views

Monogame - When to reuse buffers?

So - how do these work exactly? Right now I am making a buffer and setting the data every frame for my object, but I heard you can reuse the buffer, too. If the object is not changing in any way ...
1 vote
1 answer
47 views

How to handle overlapping meshes?

So I want to note that I am a beginner at game dev but an okay coder. I wish to make a game in which the character changes clothes. I have a character and a few clothing meshes that all have the exact ...
  • 111
0 votes
0 answers
78 views

How to replicate the dynamic LOD system for characters from Messiah (2000) in Unity?

I watched this video on youtube and got really curious about replicating the "character system" that it covers. This article linked in the video description goes into further detail on the ...
0 votes
1 answer
93 views

OpenGL 4 tracers

We have implemented a glow map into our renderer. It basically uses a blur filter on the glow map pass. But, I cannot figure out how to do tracers in OpenGL. Someone suggested using a couple of ...
0 votes
1 answer
97 views

OpenGL 4 depth of field

I am implementing depth of field. My fragment shader has the following code in it: ...
0 votes
1 answer
36 views

Is it possible to draw billboards from point data held in a compute buffer?

I'm currently trying to show a galaxy and have developed a compute shader that places/moves "stars". Another vertex/fragment shader reads the buffer and currently places a point at each ...
  • 778
0 votes
0 answers
55 views

How to create a 2d ground fog shader with fake fluid dynamics?

I'm looking to create an effect as seen in the link below for a 2d game. I believe they are using an animated texture for the fog but I would like to recreate the effect using a shader so it would be ...
0 votes
0 answers
46 views

Gaussian blur only blurs the interior of primitive?

I cannot work out why my blur shader based on this example affects only what's inside the illuminated sphere. Below is the loop I'm using to blur an HDR framebuffer 5 times horizontally and vertically ...
0 votes
1 answer
40 views

Object stuck to screen no matter what eye position is used

I've run into an issue when trying to write a simple rendering program in D3D11. I'm 90% sure it's to do with some faulty matrix multiplication or generation, but I've tried debugging the values of ...
1 vote
0 answers
32 views

Overlap Transparent geometry should Appear with same transparency

I am looking for a way to render overlap trasparent geomery with same trasparency. For better understanding here is the way:
0 votes
0 answers
31 views

Render only part of mesh that is intersected into inother Mesh in Unity

How can i make ZTest only happen inside a object not behind it? my shader is simple unlit with two pass one is ZTest Greater as red one and one is ...
  • 29
2 votes
2 answers
97 views

Compute Shader generating data for use on CPU

I'm trying to create a compute shader that will generate and manage the movement of a point cloud. The shader needs several thousand points to work on and I want to pull back the first dozen or so. ...
  • 778
0 votes
0 answers
18 views

Unity mix multiply shader passess together

Hi i want to create a shader with different passes, first pass has transmission second one has reflection, GI and PBR using surf and third one is outline around using unlit. How can i blend my ...
  • 29
0 votes
1 answer
31 views

Unity clipping volume not working

I am trying to make a transparent clipping volume using shaders. I found this shader code that was supposed to hide everything within whatever volume it's applied to while drawing what's behind ...
0 votes
2 answers
192 views

How is depth buffer written to?

As far as I know you normally can't read and write to the same render target in the same shader pass. But if I understand correctly, depth tests rely on depth writes of things being drawn in the same ...
  • 125
0 votes
0 answers
45 views

How to tear a hole in cloth sail rendered as a plane mesh animated with a shader?

I have a procedurally animated sailcloth. It's just a square flat plane mesh with 144 vertices. I use a shader to manipulate the vertices and make it "fill" with the wind. All of that works ...
13 votes
1 answer
3k views

How to do color post processing in WebGL, when you can not read the color of the current pixel?

In a WebGL 2 GLSL fragment shader, one can not access the pre-existing color value of the current pixel, i.e. the color that is already there in the framebuffer before the pixel that is currently ...
  • 243
0 votes
1 answer
30 views

Unity Shader - Moving one texture around and on top of another texture

I have a shader that applies a texture to a sphere with lighting, making it look like a nicely lit planet: The code for my shader is here: ...
  • 33
1 vote
1 answer
350 views

How to calculate screen space UV coordinates from a specific camera

In Unreal Engine 4.27 I am currently trying to create a material (shader) that maps a texture onto a quad using the screen space coordinates from a specific camera. If I am using the current active ...
0 votes
0 answers
82 views

Shader UV Normals/Direction vs UV Tiling/Stretching for Sprite Shape

I'll be the first to admit I'm not fantastic with shaders, so as far as I know, this may be a very simple solution that I'm just unaware of. What I'm trying to do is to write a shader for Unity's ...
0 votes
1 answer
67 views

How to pass voxel data to shader?

I am working on a voxel game, and I approached the point where I need to add day/night in my world. Apparently, I should just be able to pass the torch and sunlight values into my shader and multiply ...
  • 101
1 vote
1 answer
72 views

How to make a shader which alpha blends against only itself, and is opaque otherwise?

Imagine a scene with a minecraft style world held in a bounded container and is being viewed from a isometric 3rd person camera that has a fixed orientation. I want to create a shader that expresses ...
  • 125
0 votes
1 answer
42 views

How to emulate the look of loading ZX Spectrum title screens in Unity

I am looking to replicate the style of screen loading as seen on the ZX Spectrum in Unity. Not the stripes of colors in the background. Just the title image loading. Specifically the way it looks in ...
0 votes
1 answer
30 views

GLSL Shader r GL_INVALID_OPERATION from glUniform1f error with textureSize

For debug purposes I've minimised the shader to the following: ...
  • 194
0 votes
0 answers
33 views

Unreal HLSL semantics

We have some HLSL shader code that uses the predefined shader semantics TEXCOORDX to map input streams. We now want to support Unreal as rendering back-end and see ...
0 votes
2 answers
125 views

How can I make the hue of a material change over time?

I'm working on a small psychedelic-style game that needs to be done in Unity, with which I have no prior experience. I'd like to achieve an effect where the material of my objects can change colors ...
0 votes
0 answers
48 views

Rounded Line Shader

I am trying to achieve a rounded Line where Line will go through point A to point B with GLSL. I am able to do it on Shader Graph however I don't want to create my project while using Universal Render ...
  • 3
0 votes
0 answers
30 views

unity instanced shader can't get quads to look at camera

i'm almost using this code exactly: https://docs.unity3d.com/ScriptReference/Graphics.DrawMeshInstancedIndirect.html the second shader "Instanced/InstancedShader". i've been trying to ...
0 votes
1 answer
62 views

Custom Unity shader makes mesh look different

I am very much new to custom shaders. My actual problem is that I want to fade a mesh in and out via C# in Unity. However, the materials on the mesh I am using are opaque and setting them to ...
0 votes
0 answers
35 views

Generate Uniform distances in Distance Field without Square Textures?

Following this Godot Tutorial I've been implementing a shader for 2D global illumination. In the tutorial it mentions adding a UV to World aspect ratio change within the raymarching function to ...
0 votes
1 answer
321 views

Decal Projector equivalent in unity's standard shader pipeline

I have a script in my Unity project that creates glowing outlines around objects when highlighted in a scene. The shaders don't work properly with the URP or HDRP. However, I want to create a move ...
0 votes
1 answer
60 views

Applying texture in a circular rotation to 2D object

I am trying to apply texture along the ring by using shaders. I am trying to avoid unnecessary mesh creation. I am trying to achieve it by using Shader Graph in Unity however I couldn't make it work ...
  • 3
0 votes
1 answer
92 views

Change environment saturation based on exposure to "light source" - Unity

I am trying to make a game where particular "light sources" bring color to an otherwise grey world. I am extremely new to the world of custom graphics processing. I assume it will require a ...
  • 3
0 votes
0 answers
90 views

How do I make a shader that simulates acrylic paint being smeared on a surface?

I know something about shaders, I have written some very basic shaders. This is the most advanced shader I have written so far. It's been several days since I conceived the idea of trying to recreate ...
1 vote
0 answers
144 views

Unity URP Water Shader working in Scene View, in the Preview Window... but all white in Game View?

I downloaded an URP compatible Water Shader from the asset store. First I tried it with 2022.1 but for some reason while in Scene View it looked great, in Game View it's all white. (Sometimes a watery ...
  • 641
0 votes
1 answer
76 views

What would be a good approach to create an abstraction for a game object without textures?

I am practically pretty new to OpenGL development and right now doing some research in Java with LWJGL. But it's really not a question about Java or C++ (GLFW, etc.). It is about OpenGL > 3 api. ...
2 votes
1 answer
934 views

How to deal with insane amount of shader variants waiting to be compiled in Unity >= 2021.2 / URP >= 12?

Since Unity 2021.2.0b7 (that is, URP 12.0.0), there has been a well known problem with absurd number of shader variants wanting to be compiled for even a somewhat simple shader (i.e. shaders generated ...
  • 98
0 votes
0 answers
70 views

Prevent the vertex normals from being recalculated when a skeletal mesh is deformed?

I am trying to create a game with stylized shading like Arc System Works Style, which requires the normals to be edited by hand (I do so in Blender). However, after importing to Unreal Engine, these ...
0 votes
0 answers
53 views

Unity paint texture isn't working when a shader is selected

I'm trying a create a custom shader for my terrain. I'm a beginner so at this moment I was just trying to experiment with texture blending (and I might not be following best practices). I have created ...
  • 101
0 votes
1 answer
38 views

Tangent Space View Direction based factor value remap

I'm trying to setup a mask similar to what Fresnel produces. Unfortunately Fresnel gives pretty bad results at grazing angles so I ended up using this : ...
  • 1,045
1 vote
1 answer
440 views

How do I implement this distortion ripple effect?

I would like to implement the following running effect in Unity. When the player character moves, it creates some sort of rings around it to give the impression of high speed. I have searched for ...

1
2 3 4 5
38