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
0answers
16 views

How to map 2d point on grid/plane mesh to 3d point on sphere with minimal distortion?

I have a grid of voxels that I want to "bend" into a sphere via a vertex shader with minimal distortion. I've tried 2 approaches so far, both of which don't quite give me the desired effect. ...
0
votes
0answers
31 views

How to make under-construction sprites have blueprint graphics?

In my game, every placeable object and structure will only be placed as a blueprint, which the characters will then automatically build. An example from "RimWorld": Objects placed as ...
0
votes
0answers
12 views

Blending / Lerping between textures in a Unity CG Shader

I can lerp between Colors just fine, but lerping between textures just doesnt seem to work? What am I doing wrong? ...
2
votes
1answer
34 views

Making a billboard shader in Unity

I followed this guy's tutorial on making a billboard shader, and it works great, except if you are billboarding things that are tall, like a tree, it looks weird, to put it simply. When the camera's ...
0
votes
0answers
31 views

Blending between multiple textures with Unity CG Shader [closed]

I've been trying my hand at blending between 2 or more textures, so far I found I can lerp between Colors quite easily, but this lacks the detail I'm looking for. So I'm trying to blend 2 or 4 ...
2
votes
0answers
20 views

Unity shader graph slow

Unity 2020.3.12f1 HDRP Whenever I add a single node in Shader Graph, the progress bar "compiling shader" takes around 20 seconds to complete. Multiply that by dozens of nodes and we're ...
1
vote
0answers
11 views

Problem with customFunc in shaderGraph

I am not good at explaining things which I don't know how they work. Generally, in file shaderGraphArray I made a func which I implemented into customFunc node in shaderGraph and like on picture 2 ...
0
votes
1answer
32 views

Debugging shader script in GLSL ES - Game Maker 2 (CompileError)

I am trying to use this shader in the game I am making with Game Maker Studio 2. I tried to convert it for GM2 and here is my result: Shader type I used on GM2 is ...
0
votes
0answers
15 views

handling obj file without normal [duplicate]

I am trying to build an obj file loader and I have written code to read an obj file with face f with v/vt/vn - vertex, texture coordinate, and normal. While going through the obj file, there are so ...
0
votes
0answers
24 views

How can I recreate a material from blender in Unreal engine

I'm new to unreal and I am having trouble finding a way to reproduce the materials for a mesh in blender in unreal. It's a simple material but I can't find a way to reproduce the color ramp ...
0
votes
1answer
25 views

Edge bleeding with opacity map

I want to layer a grass texture with opacity over a dirt texture to form an edge. Both on the same model. But I'm getting edge bleeding from the opacity. I made both textures within Substance Designer ...
0
votes
0answers
22 views

Unity cheap fluids visuals for VR using Post Processing

I'm trying to create a turret in VR that will spray water onto a wall. I need a way that will take the collision of the fluid and transfer that to a splatmap to change the material of the wall. I know ...
0
votes
1answer
24 views

Sprite transparency fails when rendered through shader

I am currently trying to implement a shader to a sprite of mine, but the transparency is completely removed when the texture goes through a Sample Texture 2D node. The sprite under the Sample Texture ...
0
votes
0answers
11 views

Unity, connecting unlit shader output to compute shader?

I'm hoping to learn what my options are for sharing the outputs of simple unlit shaders with compute shaders that will operate on the data. Is my only course of action to use a render texture with the ...
0
votes
1answer
25 views

filter camera output by mesh

(skip to edit for the actual problem) I have a simple plane mesh generated via script (has arbitrary shape). I want the shader to discard (set to black) all pixels that aren't passing through that ...
0
votes
0answers
18 views

Updating Texture in Compute Shader

I am new to compute shaders in unity, and trying to understand how they work. I have distilled the problem to this one: I have a script "Panel.cs" which uses a compute shader "...
0
votes
1answer
29 views

opengl (lwjgl) - only white triangle gets rendered, vertex and fragment shader not responsive

Currently my program can only render my vertices as white and changes in my vertex and fragment shader don't change what gets rendered for some reason i.e: (...
0
votes
0answers
31 views

What is the best approach to using videos to animate a weapons' display screen in Unity?

My job is to create, model and animate sci-fi weapons', and create Unity assets out of them so they are ready to use. This particular weapon has two side displays. I've animated some text in After ...
0
votes
0answers
25 views

I cannot use TextureSample with custom HLSL gaussian blur function

I am relatively new in HLSL, I am trying to implement gaussian blur for my new dynamic shadow material project. I can input Texture Object, but not TextureSample, and getting an error, Is there is any ...
2
votes
0answers
55 views

Collapse a 3D model to 2d with Shader?

I'm trying to recreate an effect of 3D sprites similar to Ocotpath Traveler (2d sprite similar to billboards/imposters in 3D space, showing 8 sides of the character based on where they're facing), ...
0
votes
0answers
28 views

View space positions from depth in DirectX

I have a depth texture and I'm trying to output the view space positions on the screen. In renderdoct I get the following image, and there are two 3D Models a plane and another model. I'm using an ...
1
vote
1answer
71 views

How to fix shadow not casted to terrain when rendering using default and terrain shader (depth shader included)?

Given that I have the TerrainShader class and DefaultShader class. Also a FBO (Frame Buffer Object) shadow map The ...
0
votes
1answer
23 views

OpenGL translation based on “scaled” pixels? (Not physical pixels)

My (2D!) game runs in a “scaling mode” so to speak, and I’ve yet to find anyone asking this question anywhere. Basically, I want to achieve a sort of “scaling algorithm” whether graphics are ...
1
vote
0answers
13 views

Unreal Engine 4- Post Processing material isnt working on different viewports except perspective

I would like to render a silhouette of models, I found stencil would be the best way to capture. But when I am working with stencil post-process material its does not work with other viewports except ...
1
vote
1answer
111 views

Difference between ComputeBuffer and GraphicsBuffer in Unity?

At first I thought that ComputeBuffer's could only be used in compute shaders and that GraphicsBuffer's could only be used in ...
5
votes
1answer
846 views

Invert the colour of pixels where 1 bit sprites are overlapping

I have a simple scene in Unity that makes use of some simple art that uses either white or transparent colours to create a 1-bit art design. The image below shows this. I want to have a that if two ...
0
votes
1answer
30 views

How to use Texture2DArray with Normal map and Normal Unpack node in Shader Graph

I am extracting Normal Map from Texture2DArray in shader graph and then converting it to normal using ...
0
votes
0answers
11 views

Attach a DXR state subobject to a library using the DirectX Shader Compiler

Suppose I've got two IDxcBlob's libraryBlob and localRootSignatureBlob obtained from calling ...
0
votes
1answer
29 views

Unity Texture2DArray is too noisy

I've generated a Texture2DArray from array of Texture2Ds and for some reason, when my shader is using Texture Array the output ...
0
votes
0answers
30 views

Converting Shader to ShaderGraph for URP conversion

I know there are a bunch of threads asking for help with converting old shaders to ShaderGraph, and this one is no different. I spent a lot of time trying to get a shader to cast shadows from sprites ...
0
votes
0answers
22 views

Rotating UVs by X degrees

I would like to make a tileable texture with UV noise in Unity Shader Graph only, but I have a problem. After creating simple noise from UV, I want to rotate it by 90 degrees, but the node ...
0
votes
0answers
24 views

How many texture units are available per shader stage when compared to the total number available on hardware?

The answer to the question How many textures can usually I bind at once?, given here, explains that: OpenGL 3.x defines the minimum number for the per-stage limit to be 16... and that there can be a ...
0
votes
1answer
31 views

How to best select a texture pair to use in height blending when using a splatmap shader

In my project, I'm implementing a shader to combine up to 4 textures in a terrain using a splatmap texture (https://en.wikipedia.org/wiki/Texture_splatting). I want to combine the splatmap blending ...
0
votes
0answers
13 views

Updated Unity project from 2020.2.1f to 2021.1.7: lighting is messed up, scenes are brighter

I've updated my project from 2020.2.1f to 2021.1.7 (also tried 2020.3.8), and now my scenes are much brighter for some reason: Any tips? Current I use the standard pipeline I think, because the ...
0
votes
0answers
29 views

Tree batching problem in Unity

I have some problems with batching trees. I'm using the default unity terrain system and trees. My problem is that trees won't get batched together (I've set up static, dynamic, and GPU instancing) ...
1
vote
2answers
122 views

How to use vertex and fragment shaders without using VBOs and VAOs?

Recently, I am trying to make a 3D game in LWJGL 2, not LWJGL 3, just because I am more familiar with LWJGL 2. Since LWJGL decided to shut down their legacy wiki website, I've been researching alot ...
0
votes
0answers
40 views

How can I roll up a plane like paper?

Hello, I want to twist the plane. The plane looks like this when I try to do it the way I linked below. How can I my plane roll like photos? How can I roll up a plane with a vertex shader? you can see ...
0
votes
1answer
52 views

Need help getting an objects orientation / all my OpenGL rotations are reversed

I'm using OpenGL on Ubuntu Linux with the Eclipse IDE and the GCC compiler. I am bringing blender models into a homemade renderer/game engine. I parse a text file containing object descriptions to ...
0
votes
1answer
22 views

Unity: Opacity over Distance with Surface Shaders

I want to tweak the alpha value based on the distance to the camera. But I see no way of passing the vertex position on to the surface function using surface shaders. Not a problem with frag shader. ...
2
votes
1answer
117 views

Any fast alternative to sine in GLSL?

Should I just use the built-in sin() function or my custom sine function? I'm concerned about performance here. I don't care about accuracy much here because I use it to just get wave effects in my ...
0
votes
0answers
27 views

How can I achieve this “stroked lines” effect?

I have a collection of arbitrary vertices and edges that are connected, but which do not necessarily form triangles. These vertices and edges mostly fall along a flat plane, but have some height ...
0
votes
0answers
53 views

How can I optimize this blur shader?

I'm trying to do a bit of shader development. I found this optimized version of gaussian blur (shadertoy demo), rewrote it in ShaderLab:: ...
0
votes
0answers
57 views

How to texture procedurally generated custom terrain mesh

I am making an infinite procedural terrain for my game and currently trying to apply textures to it. The generated terrain has different biomes, so I want to texturize the terrain based on biome and ...
0
votes
0answers
17 views

How to create a standard pbr material with shader graph?

I want to create a standard pbr material that is editable with the shader graph, but when I install the package and go the Create -> Shader tab, I only have 2 graph options: Empty Shader Graph, ...
0
votes
0answers
30 views

LibGDX Shader that converts sprite to single colour with blurred edges

I made a shader which turns all the colours of the texture to black but I also want it to be blurred at the edges where the opaque sprite turns transparent. Original texture with desired output. <...
1
vote
0answers
44 views

Fragment shader not working as expected

I am porting the following shader into Godot. The results seem not correct though. Apart from the wrong colours there seems to be no change with time. What is the problem with it? ...
0
votes
0answers
13 views

Hardcode per-instance properties into the shader in unity

I am using one of the packages from the asset store and using its Polyline feature for wire rendering. There are thousands of wires and its taking much fps/Batch ...
0
votes
0answers
21 views

How to project a Matcap correctly in Amplify Shader Editor

Unity's Amplify Shader Editor comes with an example of matcap nodes setup, however, the matcap projection in this example is incorrect. As you can see the texture becomes distorted when it's on de ...
0
votes
0answers
12 views

Fade a texture effect as it nears the end of a cylinder mesh

In my game I have a laser beam that travels for about 15m, but abruptly stops due to the mesh the texture is attached to. How can I setup my shader graph so that the end of the texture fades away? I ...
1
vote
2answers
23 views

unsmooth blending with deferred shading and light volumes

So I implemented deferred Shading with a single full screen light pass (picture 2) (by passing the light-data as an array to the shader) and deferred shading with point light volumes (picture 1) (by ...

1
2 3 4 5
36