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
13 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
0answers
13 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
1answer
15 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....
0
votes
2answers
2k views

Limit Color Pallete Using Shader (Unity)

Basically, what I want to do is take a primary input image texture (which is a render texture in-game) and a secondary pallete texture (contains X number of colors, and is X by 1 pixels in size). What ...
3
votes
2answers
124 views

How to render thin glass with proper refraction?

I want to render thin bumpy glass with refraction. But it offsets too much(look at the black frame of the glass). Looks thick. How to do thin glass refraction properly? Or is it possible to exclude ...
0
votes
1answer
99 views

Passing touch position to compute shader

I am working on a game where I have to mix colored liquids as shown here. I am working with a plugin (StableFluids) to get this effect: Effect Problem: The shaders used in the plugin are able to ...
5
votes
2answers
439 views

Weird shader behavior on different devices

I'm trying to combine an ordinary shader with a Single Distance Field shader (for fonts and scalable icons) into one shader program. The idea is simple - if uv.x is less than 1.0, it is drawn as ...
0
votes
3answers
150 views

2D Camera Movement Temporal Reprojection

Having an Orthographic Camera with its View Projection Matrix given from the current and last frame, how to reproject the previous frame to the new one?
1
vote
1answer
139 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
2answers
488 views

Overlap color between objects

I'm currently trying to build a game with Ogre3D that is basically a moving vehicle that leaves a green trail (2D manual mesh) in it's path, what i'm trying to achieve is exactly what this image shows:...
0
votes
0answers
34 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'...
0
votes
1answer
276 views

why my shader is black in the game mode?

I used this useful blending modes It's good but it just work in Editor mode. what is the problem?! ...
1
vote
0answers
32 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 ...
2
votes
1answer
26 views

LIBGDX ShaderProgram not passing uniforms

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

LibGDX - Draw multiple textures with different positions with one shader?

currently I'm optimizing my render calls by drawing multiple textures with one shader. The background textures who all share the same position are no problem. But now I want to draw some Textures with ...
0
votes
2answers
237 views

GPU Gems Chapter 1, update normal

Had plans to follow GPU Gems to gain knowledge in Shaders - but my journey came to an abrupt end. ...
1
vote
1answer
398 views

Particles not rendering over projectors

I am using projectors for shadows...When I use particles for bike speed up i.e., nitro speed the particles get cutout by those shadows.... Here is screenshot of it, Here is my shader code of ...
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 ...
23
votes
3answers
5k views

How can I implement a short-cut grass effect?

I've been looking at some screenshots from games like Rocket League and FIFA: and I started wondering one would achieve the short-cut grass effect. Is it a shader? Is it actual geometry? Or just ...
1
vote
1answer
132 views

How can I write an additive mesh shader that splits the RGB channels while accounting for depth?

I'm trying to create a sort of "hologram" effect. So far, what I have is an additive, three-pass shader that uses ColorMask for each pass to separate the RGB channels. The problem is that doing so ...
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
1answer
96 views

using a wire-frame shader on a plane how can i also fill in the squares with a solid color so that each square's color can be changed?

I'm not sure if using a shader is the best way for what I'm trying to achieve, but I would like to apply a color to each of the squares like in the picture and have the ability to change each color ...
0
votes
0answers
21 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"...
2
votes
1answer
2k views

Unity procedural skybox shader texture stretching

I am using the procedural skybox shader that Unity provides, but have tweaked it so that I can have a cloud texture. The problem I have, is that the texture is not tiling correctly, even though it is ...
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

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 ...
2
votes
1answer
106 views

How to detect syntax error in unity shader scripting

Hi. I'm following shader scripting tutorial and I often make syntax mistakes. like other languages, can you have visual studio automatically underline with red color?
0
votes
1answer
62 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
1answer
108 views

Generating the distance of an intersection through a box from the camera in Unity C#

So, I recently saw this fantastic video by Sebastian Lague about planetary generation- https://www.youtube.com/watch?v=lctXaT9pxA0&t=1100s And I decided to replicate it, however, on a flat plane, ...
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 ...
0
votes
1answer
29 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 ...
4
votes
2answers
1k views

OpenGL GLSL using projection,view and transformation

I have been trying to get a simple triangle to render on the screen. I am using Projection, View and Transformation matrices but am unable to get anything to the screen. Main loop ...
1
vote
1answer
240 views

OpenGL texture2d/image sampling issue. Strange artifacts in texture

I have an issue when using textures in OpenGL, strange artifacts occur where geometry overlaps, but not always. Video Reference. I am using a GL_TEXTURE_2D with <...
0
votes
1answer
42 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
1answer
347 views

How to do "Screen Space Texture" mapping on a Unity UI Image?

So I'm fairly new to the shader and I've been trying to achieve this kind of effect from Ronja Tutorials, but instead of using it for normal mesh object, I'm trying to use it for Screen Space UI Image ...
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 ...
1
vote
0answers
26 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
22 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: ...
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
11 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
18 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: ...
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. ...
4
votes
2answers
255 views

Fine tuning light shader mechanics

I'm currently trying to implement the lighting technique described in this article. I've done pretty much exactly what is done in the article. My technique is the same, and my shader is the same. ...
1
vote
2answers
121 views

Is there a way to set a shader define in Löve?

I know I can use shader:send() to change variables, but is there a way to set/change a #define?
0
votes
0answers
42 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 ...
2
votes
1answer
82 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
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
1answer
1k views

Drawing a grid over a terrain using a mesh - Shader Depth and Z-Buffer

What I'm trying to achieve is rendering a (huge) tile grid over a terrain. For that I'm using a generated mesh of quads, one for every tile, whose vertices Y value is the same of the terrain to "shape"...
0
votes
1answer
169 views

Issues to display a texture loaded with libPNG with opengles 3.0

I'm trying to load a texture loaded with libPNG on a XY coordinates. I know the width and the height of the texture (32x32). The texture is already loaded successfully and I have his Id. Here is my ...

1
2 3 4 5
37