Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [shaders]

a computer program that runs on graphics hardware and provides a high degree of control over how scenes are rendered

1
vote
1answer
52 views

Why does my terrain texture fail to load? (OpenGL)

I'm currently using a vertex shader and a fragment shader for loading my texture onto the terrain I made. Here is my vertex shader ...
0
votes
1answer
88 views

Glow effect shader for mesh generated at runtime

I'm using the leap motion-paint module and i would like the ribbons that are generated at runtime to have a glow effect, I tried editing the existing shader by adding a glow property but the colors ...
0
votes
1answer
167 views

Water cut off effect in UE4

Working on a side scroller game in Unreal Engine 4 and I need to create a water cut off effect like seen in the screenshot of Ori and the Blind forest. Basically need a side perspective on water ...
1
vote
1answer
108 views

Low fps on Arm Mali GPU

I was trying to google and understand my problem in two weeks but i am defeated, so i am asking for help. The main problem is that my custom unlit frag shader after certain amount of time on devices ...
0
votes
0answers
85 views

UNITY_UV_STARTS_AT_TOP seems not work on iPhoneX in Unity

I followed this blog's method to do an optimized projector in Unity, it's working fine on iPhone6/7/8. However, on iPhoneX its render texture inverses in y axis. So I followed this to fix it but it's ...
0
votes
0answers
32 views

Cascading Shadow Maps - Spotlight Projection

In all the cascading shadow map explanations I have read, the final projection into the shadow-map is done using an orthographic projection. This makes sense for a directional light because a ...
0
votes
1answer
151 views

Why does Unity heavily blur edges of a single cube despite 8x antialisaing

I was messing around a random project and everything was working perfectly, when all of a sudden jagged edges appeared on all objects. I've been trying to resolve this issue for the past two dails, ...
0
votes
1answer
82 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 ...
0
votes
1answer
158 views

Unity run-time creating material has performance impact?

Just found creating a material in a script for the first time would have performance impact. (Using Unity 5.6.5f) A very simple script for testing is to create a game object with MeshRenderer in ...
0
votes
2answers
280 views

What's the difference between length function and distance function in Unity Shader?

I'm confused about the two functions, do they return the same thing?
0
votes
1answer
41 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 ...
1
vote
1answer
95 views

Unity: How do I only show parts of objects that overlap [2D]

I'm working on a 2D Unity project where the player can only see objects in their field of view. I have successfully created a mesh that overlaps anything that would be in the player's field of view, ...
0
votes
0answers
158 views

Unity: Custom Multiple Texture Shader

The built-in Unity Terrain offers a way to paint different textures onto it. As you can see here sand has been painted onto the main grass texture. I prefer to import Terrains as fbx files. However ...
1
vote
1answer
117 views

The number of shaders a large game or game engine has

Wondering the scale basically. The number of shaders a large game or game engine has. I've seen some metal repos but they typically just have 1 or 2 shaders for small demos. I think I've seen a few ...
3
votes
2answers
281 views

How can I add a glow effect around a pair of wings in Unity without post processing?

Basically I want to use post processing and then I found a tutorial to achieve my goal. However, the artist want a pure shader to achieve this, without any C# script hanging in the main camera. Any ...
0
votes
1answer
615 views

Unity: Water shader vertex offset - how to add mesh collider which updates with vertex offset?

I have written a shader (in the new LWRP shader graph) which simulates an ocean with vertices which offset to create a moving "waves" effect. I believe that in order to have objects "float" on my ...
0
votes
0answers
199 views

Dissolving fog of war when entering a room

I want to achieve a similar effect to what you see in the following clip from Enter the Gungeon. When a character enters a new area, I want a dissolving fog of war which begins dissolving at the ...
1
vote
1answer
49 views

How to organize passing data to shaders in cross-API render system?

I try to create rendering system that supports DirectX and OpenGL. I am trying to create class for constant buffer, but DirectX constant buffers and OpenGL uniform buffers have different memory ...
1
vote
1answer
350 views

How to access an uniform array with a float as index in GLSL?

I'm trying to do basic multitexturing of terrain in OpenGL. Im building the terrain with an image representing different elements (beach, water, jungle...) : Im trying to map each color of this ...
1
vote
1answer
13 views

Normal doesn't appeared on shadow/dark area in Mobile Shader

Let's look at this picture: You can see the red rectangles, those are shaded by normalmap. Here, is the same model with different light angle, there's no normal shading in dark area. It only ...
1
vote
0answers
45 views

Custom Transparent Shader rendering order is wrong on iOS

In Unity Engine, I wrote a custom transparent shader(I use blend to achieve) for crystal effect and it's totally fine on Windows. However, when it's on iOS platform, the crystal always culls ...
1
vote
1answer
40 views

How to store shader output to VRAM?

This is really ungrateful question to Google. Basically, I would like to know, regarding openGL, what are various methods to do some kind of computation in one of the shaders and have the results ...
0
votes
1answer
2k views

Unity LWRP & Projection Shader

I recently added the Lightweight Render Pipeline to my project as I'd like to start experimenting with Shadergraph to see if I can get a better basic understanding of shaders. Everything has gone ...
1
vote
2answers
108 views

Combining multiple diffuse textures into one leaves strange distortions?

I made 3 models, each has own material. And after texture painting, I combined each their texture to single textures for optimization. Currently making Mobile Game with Unity 2018 and using Mobile/...
1
vote
1answer
97 views

Does texture splatting always sample 4 x N textures per fragment (regardless of the weights)?

Texture splatting - usually - is done by vertex painting, where each channel R-G-B-A is assigned as a different texture weight. Due to the way shaders are executed, doesn't it mean that the fragment ...
1
vote
1answer
50 views

Wrap texels between desired values

I'm using a basic pixel shader here ...
0
votes
0answers
210 views

Computing depth from position of fragment in world space

I have a raymarching shader which computes the location of a hit on the scene in world space. float3 worldPos = ... ; I can verify that the world position is ...
0
votes
1answer
80 views

Why is clip-space 3 dimensional?

A vertex shader is basically a transformation function that converts a vertex in your world space to a space that can be rendered on screen. Since the screen is a 2 dimensional surface whats the ...
0
votes
0answers
70 views

Unity shader pixelated on Android/ WebGL

I'm writing an image effect shader that should display an overlay texture on the screen using the following code in the fragment function: ...
0
votes
0answers
124 views

Implementing a wobble effect for speech bubbles in Unity?

I'm working on a little game in Unity 3D and I'd like to replicate the wobble effect seen on the speech bubbles in the game "Night in the woods", as seen here: https://www.youtube.com/watch?v=...
0
votes
0answers
607 views

Amplify Shader for mobile

I'm recently learning Amplify Shader to make shader more easily. It's visual shader editor for Unity that allows to create shader by connecting nodes. Right now I need a shader for Android project ...
0
votes
1answer
601 views

Emission for Mobile Shaders?

I need to use Emission texture to my model, but I can't find any emission parameters in mobile shaders. I searched this on google, but there's nothing helpful to me. How do I add emission for mobile ...
1
vote
1answer
461 views

Additive, Alpha Blended, Unlit, Lit differences?

Short question, what's the difference between the shaders used for particle, and how they affect the visual. Additive Alpha Blended Unlit Lit
0
votes
1answer
539 views

How to do “realistic” plastic material?

How can i do "realistic" plastic material in Unity 3d , using standard shader or other shader ? Can you suggest me options ? Thanks
0
votes
1answer
1k views

Using ShaderGraph for UI elements with transparency

I am trying to design some UI elements using shader graph. In this case specifically a lifebar that is transparent where empty. For a normal lifebar with a filled and empty color I got it working ...
0
votes
1answer
319 views

Unity Surface Shader Using “worldNormal” While modifying Normals Turns Shader Black

So I was writing a simple triplanar mapping shader and while doing so encountered a bug where when using IN.worldNormal in code while writing to ...
1
vote
1answer
661 views

How to create a 2D fog shader?

I am trying to write a fragment shader in GLSL for a fog effect in a 2D game. Here are some links showing what I'm after. Here the fog is in the foreground and near the ground: https://twitter.com/...
1
vote
1answer
801 views

Dissolve object starting from the bottom

I'm currently getting into using the new "Unity Shader Graph"s and have made an OK dissolve shader that looks like this: My next goal is to move this effect so the object dissolves bottom-up. This is ...
1
vote
1answer
125 views

Does it make sense to do more calculations in the fragment shader if there are more vertices than pixels?

I'm very new to graphics programming, and as I understand it vertex shaders are called per vertex and fragment shaders are per pixel (ignoring anti-aliasing). When it comes to optimization all sources ...
0
votes
1answer
145 views

Tilemap shader confusion

I am trying to setup a system for utilizing uvs to tile a texture and reduce draw calls. I'm using Unity. I create a texture which records the x index of the tile from a tileset into the red channel ...
0
votes
1answer
29 views

Unity2D: Sprite Mesh Lighting Issue

I am trying to make my 2D mesh render sprites with the same brightness as the original file. On the below picture, the mesh on the left is darker than the UI Image on the right, which is an exact ...
1
vote
0answers
146 views

Unity Pink Texture On WebGL

I'm trying to follow a youtube tutorial for my new game(images puzzle) and by using it's implementation on github to upload it later on facebook. When I run the game inside unity editor its work ...
4
votes
1answer
283 views

Show Unity Line Renderer as 3d cable or wire

I am dynamically making a line renderer which is pull by the character to show that a character is pulling a wire. The line renderer working fine but unfortunately its display is not according to my ...
0
votes
0answers
82 views

Half-shaded pixel artifacts on 2d dynamic lighting shader

I'm working on a shader for dynamic lighting in a 2 unity game. I'm new to shaders but I've managed to get something close to the effect I was looking for, although not 100%. As you can see in the ...
4
votes
1answer
227 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 ...
1
vote
0answers
191 views

Is there a way to convert a shader code to shader graph?

I would like to ask if there is a way to convert a Coded shader into the new Shader graph, beacause i want to edit my shaders in more efficient way. Any help is appreciated.
1
vote
1answer
150 views

Separate game engine from game

I'm building a simple game engine (or mostly rendering engine) and I would like to separate the "engine" part from the "game" part. So, I've come up with an idea to build "engine" part as a library (...
1
vote
1answer
97 views

GLSL shader time uniform freezed?

I have a simple fragment shader to simulate "falling water". I'm using Ogre3D and opengles2, this is my code: ...
0
votes
1answer
156 views

World space coords for 2d images

How can I make an 2d image using World space coords with a shape? Like a circle instead of a quad.In 3d you can modify the vertices but if I want a smooth circle there will be too much vertices. What ...
1
vote
1answer
469 views

Old tv effect in shader graph

I am trying to use Unity's shader graph to create this old tv effect: I thought about using a noise node, and somehow randomize the noise's seed. Can anyone help me?