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
1answer
7 views

Rotate a Polygon node in Shader Graph

I have a hexagon in the Polygon node I would like to rotate so the pointy side is upwards. Applying the rotation nodes, however, simply changes the color of the hexagon from white to a color in the ...
3
votes
1answer
296 views

How to write shaders that can be compiled for DirectX, OpenGL, and Vulkan

I recently finished writing the DirectX renderer for my game engine. Now I have an OpenGL, DirectX as well as a not yet finished Vulkan renderer. Well, the majority of the renderers work perfectly now ...
0
votes
2answers
38 views

Performance of many canvas drawImage calls is very slow

I'm developing a top-down 2D tile-based canvas game. I have a single sprite sheet of all my tiles, and then a JSON tile map array of where they're placed. Previously I would render all the layers of ...
1
vote
1answer
46 views

mapping texture uvs to sphere for skybox

I've been trying to learn shader coding, specifically procedural skyboxes. I've been using this guide here which is a shader graph tutorial and try to write out the steps in code. However, I'm stuck ...
0
votes
1answer
27 views

OUT.worldPosition effect on shader

I am trying to follow a shader tutorial from 2016 for unity. I reached the point where the author is distorting the text by changing OUT.wordPosition ...
0
votes
1answer
26 views

OpenGL GLSL ES 3.10 - Referencing a uniform variable, causes the vertex shader to not draw anything

I have this project, that has a default shader, that just draws models and textures. Recently I decided to add a second shader that does a fancy effect, and is used only on some of the objects drawn. ...
3
votes
1answer
115 views

Shading a concave cube as a convex cube with forced perspective

Context I'm building a graphics pipeline for voxel volumes. I'm using an existing game engine (Bevy) which provides a way to put an object in 3D space. In my application, the voxel volumes can be ...
0
votes
1answer
17 views

HLSL Converting View Direction into Equiangular UVs

In Unity, I am attempting to create a custom skybox that use a single render texture to create a flat unmoving skybox (the render texture source will do it's own movement) and reflect off objects as ...
0
votes
0answers
64 views

How to implement PCSS properly?

I'm trying to implement PCSS in OpenGL/GLSL, but I have problems understanding the details especially the conversions between the coordinate spaces. The existing implementations are so different from ...
1
vote
0answers
52 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
21 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
83 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
25 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
82 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
61 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 ...
-1
votes
1answer
23 views

Calculate angle of rotation around a local y axis to face projected point

I need to write code (in HLSL) which will take an arbitrary point A in space, a plane normal, and a point P on that plane, and produce an angle representing the rotation (from the plane's x axis, ...
0
votes
1answer
17 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
44 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
69 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
21 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
29 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
23 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
1answer
67 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
50 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
22 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
37 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
26 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
25 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
24 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
45 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
26 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
82 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
99 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
27 views

How to convert this shader from Worldspace into Localspace?

Based on this question (LINK) ...
0
votes
0answers
34 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
34 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
13 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
229 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
42 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
18 views

PBR texture conversion

Is it possible to convert from specular/glossiness to metallic/roughness textures for UE4?
0
votes
2answers
40 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
36 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
23 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
21 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
110 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
21 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
89 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
81 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
44 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 ...

1
2 3 4 5
35