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
1
vote
0answers
70 views

How to give node sillouhette when behind wall in Godot

I am working on a boss-rush fps game. I want it to be like the eye of cthulu fight from terraria, with the enemy flying towards you and then turning around to try again if it misses. However, in order ...
0
votes
1answer
35 views

Fresnel shader excluding one axis

I'm trying to get an outline like effect shown on the right in this video. Using fresnel seems to make the whole thing go white at certain angles. How do I prevent that? I'm using amplify to make this....
8
votes
2answers
2k views

How to create a spiral brightness gradient

I am stuck on creating a brightness gradient that looks as below(the values are continuous from the inner circle). What formulae can create such brightness gradient? So that when _Time is added to it, ...
0
votes
2answers
92 views

Is there a simpler way to simplify the if statement? [closed]

The code below generate angle and radius based brightness gradient. As you can see I need to use 3 if statement to define 3 circle, wonder is there a single code that can create nth circle ...
0
votes
1answer
45 views

Pass equations into shaders to define graphics - HLSL or other shaders

Is it possible with HLSL (or other popular shader languages) to pass instead of an image, an equation that would define the pixel color / position output by the shader? This would allow for more ...
0
votes
1answer
121 views

Help understanding radar sweep effect in shader code

Several days ago I asked about this question: How to construct a propeller clock in Unity? But I don't understand how the answer works. I have 0 knowledge about shaders, so I picked up a tutorial to ...
0
votes
2answers
78 views

How do you have the clothing mesh hide the body mesh underneath?

How do you have the clothing mesh hide the body mesh underneath, to prevent odd patches of body from sticking out in tighter modular clothing? Is there some sort of shader trick that can have the ...
0
votes
1answer
18 views

Mesh contents get flipped

I am using below shader with my mesh object that is showing a webpage. It is showing fine but the problem is the web page has flipped: ...
0
votes
1answer
60 views

Cylindrical billboarding around an arbitrary axis in geometry shader

I found an answer on this site relating to this question already, but it doesn't seem applicable in the context of my project. Basically I'd like to create a method which fits this signature: ...
0
votes
0answers
122 views

Create Mesh in gap between tiles (in Unity3D)

I am loading two kinds of tiles (meshes in tile format) in Unity, both are placed in the environment correctly but there is a gap between these two tiles (see the picture below). I want to fill this ...
0
votes
0answers
24 views

Trouble projecting pixel back to worldspace in PixelShader [DX11]

For the last two days, I've been trying to get some code working to project pixels back to world space in my pixel shader. Im working on a fairly basic deferred renderer, and I'm using this world ...
0
votes
0answers
74 views

How does DrawProceduralIndirect use MeshTopology.Triangles?

I'm working on a voxel terrain generation system. Currently I'm running into issues using DrawProceduralIndirect. In the call, you are able to choose how the GPU should render the data you are passing....
0
votes
1answer
118 views

Unity: Alpha and color issues with opaque projector/decal shader

I have been attempting to make a simple "overwrite" version of Unity's projector shader. I can either respect the color, or respect the transparency, but not both. I have simplified the ...
1
vote
2answers
183 views

How to hide player when in Shadow using Unity 2D Light System?

I have been looking for this for a couple of days now and cant find an answer; how can I hide a player when they are in the shadow when am using Unity 2D Light System? I know I can choose not to cast ...
0
votes
0answers
82 views

Checkerboard like rendering does not save performance

I have a simple scene in Unity with a camera and a quad facing the camera filling the whole viewrect. The quad has a material with the following shader: ...
0
votes
0answers
27 views

How are writing shaders different in Unity's scriptable render pipeline vs the standard pipeline?

So I want to start learning how to write shaders because the shadergraph seems very limited at the moment. I've done some research and it seems that I should learn the HLSL language which is used by ...
0
votes
1answer
152 views

For dynamically batched objects the `unity_ObjectToWorld` shader variable is always set to default?

I'm using the standard render pipeline and the unity_ObjectToWorld variable for some calculations in my shader. After I enabled dynamic batching these calculations ...
2
votes
1answer
37 views

Why Unity Corrupts textures when used on a Sample Texture node shader

I am trying create a glow effect on a background, to do this I am using shaders, when I use the main texture everything is okay, but when I put the emission map the texture corrupts Here's the ...
0
votes
0answers
29 views

How to 3 triangle could generate hundred of fragments? [duplicate]

I am just watching the Shaders intro video from here where the Youtube is saying 3 vertices make up a triangle and Could generate a couple hundred fragments based on how much of the screen that ...
0
votes
0answers
53 views

How to add a falloff (transparency) to projector shader in Unity?

I am new to Unity shaders and I was wondering if it was possible to add a falloff variable to control the transparency of the projected color. Here is the shader code : ...
1
vote
0answers
85 views

Line of sight shader

Strategy games (such as Door Kickers) use a player's unit's line-of-sight as a major game feature. To provide feedback to the player regarding which areas are in view and which are not, different ...
0
votes
0answers
54 views

In a shader how to map UV coordinates of texture to the UV coordinates of a tile in a tile set?

I am writing a fragment shader for a tile set. In the shader I have the UV coordinates of the whole texture, however, I am interested in the UV coordinates of the current tile that is being rendered. ...
0
votes
0answers
85 views

XNA games C# application executable work on one win7 not the other one

Our company wrote a game in XNA studio 4 almost ten years ago. we try to reinstall it in win7 with only the executable. Both installed XNA Game Studio 4.0. Below is the environments parameter I can ...
1
vote
1answer
231 views

How can I blend grass LOD's smoothly in unity, similar to the method in BOTW?

This is basically what I mean. I tried to imitate the LOD effect in unity using crossfade LOD but it's not nearly as seamless. I've done some research into the subject but can't seem to find anything ...
0
votes
0answers
29 views

How to convert this shader from Worldspace into Localspace?

Based on this question (LINK) ...
0
votes
0answers
48 views

Compute Shader vs Pixel Shader

I am pretty new to game development and graphic stuff. I find that compute shader is somehow more powerful and flexible than Pixel Shader for almost everything I need so far. But Pixel/Fragment shader ...
0
votes
0answers
36 views

Would it be possible to randomize LOD distance in unity like in BOTW grass [duplicate]

I was studying the BOTW grass shader and noticed how the grass appears uniform at a distance but complex up close. From watching gameplay it appears the LOD is randomized to make the transition ...
0
votes
0answers
14 views

BIM Model clipping issues in Unity 2020

I have BIM model that I am using in 2018 version of Unity engine. When import the model into my project on 2019 OR 2020 version of the Unity engine, clippings on certain surfaces of the model occurs. ...
1
vote
1answer
595 views

How can I incorporate subsurface scattering into a custom shader graph?

I'm working on some 3D grass in Unity with HDRP (the grass is not a 2D asset on a plane, it's a mesh). I did a shader to make it move following a tutorial, it works great. I would like to add ...
1
vote
0answers
44 views

GLSL link fails with C9999 (too many buffer declarations?)

I'm receiving a C9999 (*** exception during compilation ***) linker error for an OpenGl 4.6 compute shader. It seems to be related to the number of SSBOs I have declared (14 separate declarations), ...
0
votes
0answers
36 views

PBR texture conversion

Is it possible to convert from specular/glossiness to metallic/roughness textures for UE4?
0
votes
2answers
47 views

glDrawArrays draws nothing

I am trying to draw a triangle using shaders in LWJGL, but nothing is being drawn on the screen, and no error is being produces. I can't figure out what I'm doing wrong. To create a vao, I use: ...
0
votes
0answers
85 views

Shader Graph - Surface type change

Is there any way to control what surface type is used in shader graph insted of changing it in PBR Master? I'm creating dissolve effect for albedo/emission/transparent surfaces (https://www.youtube....
0
votes
1answer
34 views

Geometry shader vertex position to point at camera

I have a shader that takes an array of points. At each point, a geometry shader creates a quad oriented towards the camera. This works fine when the camera and point are at around the same Y value, ...
1
vote
0answers
32 views

How to share constant variables between Compute Shaders?

So, I have two compute shaders A and B (using unity and HLSL). Right now, before every dispatch, I send my mouse coordinates to both of them every update. So, from my understanding, you can actually ...
0
votes
0answers
346 views

Unity: Efficient way to get the average pixel color for a portion of the camera viewport

At it's core, the problem I'm trying to solve is this: I have a camera (not main) that I would like to project to a 2 pixel RenderTexture. I would like the first ...
0
votes
1answer
45 views

How do I keep vertex position when changing material?

I've created 2 shaders using shader graph which I'm applying to a sphere to simulate a ball of water/ice. The water shader distorts the shape of the sphere over time to look like it's flowing a bit. ...
0
votes
1answer
147 views

How to make player walk through layers of 2d fog smoothly?

I'm trying to recreate the fog effect that Graveyard Keeper has, with several layers, so taller objects will get less fog. I'm using the approach described here: the devs post on Gamasutra The problem ...
0
votes
1answer
172 views

Why don't ShaderToy shaders work with LibGDX?

Can someone tell me what is different about the shader implementation in LibGDX that makes it incompatible with the shaders from ShaderToy? It looks like you can use ShaderToy shaders directly with ...
0
votes
1answer
96 views

How to convert from frag position to UV coordinates when my viewport doesn't cover the screen?

So, I'm implementing SSAO as part of my rendering pipeline using OpenGL/GLSL. It works pretty well when I have a camera that takes up the entire screen. However, when my camera is smaller than the ...
0
votes
1answer
424 views

How to get neigbor pixel coordinates in Unity HLSL shader

I am writing Mandelbrot set shader for Unity. I wrote an Image Effect shader and it works. Unfortunately, each point "shimmers" on translate scale. This is because, for each shader call I ...
0
votes
0answers
17 views

Is it possible to have 2D and 3D properties of the shader in Unity?

In properties of standard objects there are both 2D and 3D properties, like this On the other hand, in properties of a shader, I can apparently specify only 1D and 4D properties. Is this true? Is the ...
0
votes
0answers
28 views

Quixel asset to unity

I downloaded asset from Quixel, I'm using Unity HDRP, the problem I am facing is how to properly create a mask map cause the asset from Quixel doesn't have metalness map where in HDRP mask map it ...
0
votes
0answers
22 views

Per-component Shader Blend in Unity

Context : I'm writing a 2D mobile game in Unity where the graphics are essentially black lines drawn on a background image plus some lighting. Running full RGB calculations for every step seems like a ...
0
votes
0answers
26 views

Send Geometry Data to Multiple Shaders

So I am implementing a deferred rending model for my engine, and I want to be able to send all scene geometry into a single shader to calculate ambient, diffuse, normal, ect thats not the question. ...
0
votes
2answers
4k views

Understanding Screen Position Node in Unity Shader Graph

I'm struggling to understand what exactly the Screen Position node outputs in Unity's Shader Graph. I'm using the screen position with scene depth to calculate the distance between two objects. Every ...
0
votes
0answers
68 views

Rendering Mode transparent is not applying in webgl build

I am using this method to convert opaque rendering mode to transparent. ...
0
votes
0answers
45 views

How to highlight edge of movement range

I am working on a small tactical game like X-com. I now have a working-ish version and would like to treat myself to some aesthetic upgrades! I have been thinking hard about the following but I can't ...
0
votes
1answer
28 views

How can I sample objects color based on position and apply to an object in a shader?

I think what I want to achieve is similar to how grass can get the terrain color so it looks more blended, though this is not what I will be doing. My texture is a palette of colors: I have created a ...
0
votes
0answers
12 views

Interactive texture modification (such as fluid mixing) in Unity [duplicate]

I am working on a game where I want to allow users to mix multiple colors (similar to shown in this video): https://youtu.be/11UFYyv8hjs?t=316. I have the following questions: I am expecting that ...

1 2
3
4 5
37