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
21 views

Why is my shader's call to UnityObjectToClipPos() causing my *other* shaders to be invisible?

I created a shader via a node-based shader tool called Shadero Sprite, and I'm trying to debug an issue with it. Since the code was generated by the node-based tool, I'm not entirely sure what the ...
0
votes
0answers
16 views

Ensuring world curving shader is not affected by object scale

I've made a shader shown below which essentially acts as a "world bend / curve" shader by "bending" objects depending on their position from camera. It's a subgraph that outputs ...
0
votes
0answers
16 views

How to generate a randomly-positioned leaf quads with a geometry shader?

Does anyone have any idea how to implement a shader that manages to make this effect in Unity? I found a post that explains, but I'm still learning shaders so I didn't really understood how to go ...
0
votes
1answer
19 views

Unity world curve shader graph, how to start curving from a specific distance?

I've made simple world curving shader following some online tutorials and cleaning few things up. It's doing its job, however I have small issue where it curves objects that are very close to a camera....
1
vote
1answer
156 views

What is a efficient way for adding and removing vertices and indices in C++?

So I have this middle-large mesh that is composed from vertices and respective indices. At some point I need to add new ones and remove some. But that brings me into trouble. Because if I have, for ...
1
vote
0answers
37 views

How to create a seamlessly wrapping procedural brick material with a shader?

How do you create a shader that seamlessly wraps a brick pattern around the whole object, so that there are no "Stitches" at any edges/corners? Take this screenshot for example: On the left ...
0
votes
0answers
39 views

Render 3 textures into an RGB texture?

Flutter has support for external textures, but they have to be RGB. I want to render YUV video to Flutter. On OpenGL I used to create 3 textures, and upload Y,U,V to each corresponding texture. Then I'...
2
votes
1answer
28 views

LIBGDX ShaderProgram not passing uniforms

I'm trying to implement a Shader that turns any RGB values below 190 into black. LIBGDX code: ...
1
vote
0answers
38 views

Faster Alternatives to Jacobi Pressure Solving in Navier Stokes Simulation

While Jacobi itself is quite simple it needs at least 10 iterations to produce acceptable results. However that results in a higher total time cost than the rest of the Navier Stokes Simulation ...
1
vote
0answers
34 views

Why my output image is not seamless?

I offset a region of an image but when I tried to restore it using same method it doesn't look right. here is my input and output: And this is the code I used to restore : ...
0
votes
0answers
22 views

Is there a technique to properly illuminate a PBR material when using directional light?

I use the following formula to calculate PBR color for each light source. For the sake of this post, let's assume that there is only one directional light. I am using Vulkan; so, +Y is "down"...
1
vote
0answers
41 views

In a shader, what is the meaning of l()?

For instance, l(2.000000) or l(1.000000, 1.000000, 1.000000, 1.000000). This is in HLSL. Example in use: ...
0
votes
1answer
30 views

Relocate texture regions with pixel shader

I'm new to DirectX and pixel shader development. I want to know how to relocate region of input image in post processing. What I want to achieve is to divide my image into 4 pieces and then relocate ...
0
votes
1answer
68 views

OpenGL Vertex Shader "joint matrix * weight" multiplication performance

Trying to implement animation on my engine. I'm at the first stage, rendering default pose of skinned meshes. Working as expected but very slow. With the below calculation, the shader takes 6ms to run....
0
votes
0answers
43 views

Spawning noise-based fire effect with code, no prefabs

i'm a beginner in Unity, and I'm taking a Graphics course about algorithms of procedural textures/modeling. I would like to write a noise-based fire shader like this one: I would like to then be able ...
1
vote
0answers
29 views

Given a point, create a triangle with it through shaders in Stride

Need help in writing shaders in Stride. I have a vertex list. I need to create triangle from each of the vertex. For each vertex, it will be considered as a center point and three new points are ...
0
votes
0answers
18 views

How Do I Get A Shader To Stop Glowing

I am trying to make a top down game. Sometimes the enemys are invisible to the camera if they go behind objects, and I want to be able to always see those enemies. I followed this tutorial to get to ...
0
votes
0answers
12 views

Particles look different in scene view and game view?

I'm rendering particles and I'm not happy how it looks in the game view. Why is there a yellow outline in the game view (right) instead of fading nicely into the background like the scene view (left)? ...
0
votes
0answers
21 views

How to split an object in half with vertex shader?

I have a mesh of a house with roof and interior. I'd like to use a vertex shader to cut the roof off and move it over so I can see inside. However, when I do this: ...
1
vote
0answers
32 views

How to have different world states on each client but treat them as though they were the same?

I've got a voxel-based, Minecraft-like, 3rd-person isometric multiplayer game with camera rotation. Roofs are always the same height. Players can walk on roofs, and shoot or be shot while standing on ...
0
votes
0answers
11 views

How to show a marker (aka secondary texture) on a sphere at a specific location using shader?

I have a 3D Earth and I would like to show some specific marker at a specific location based of latitude and longitude. I figured out how to calculated world coordinates from Lat|Long and pass it to ...
0
votes
0answers
28 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
44 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
23 views

Blending / Lerping between textures in a Unity CG Shader

I can lerp between colors just fine, but lerping between textures just doesn't seem to work. What am I doing wrong? Here's my code: ...
2
votes
1answer
137 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 ...
2
votes
0answers
23 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
16 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
46 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
17 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
29 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
32 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
23 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
30 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
13 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
27 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
31 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
39 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
33 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
49 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
105 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
72 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
26 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
15 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
270 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 ...
6
votes
1answer
871 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 ...
1
vote
1answer
118 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 ...
1
vote
0answers
13 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 ...
2
votes
1answer
38 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
108 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 ...

1
2 3 4 5
37