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

0
votes
0answers
33 views

GLSL shader 2d light follow my view around the world

I'm new to GLSL and I try to make a light shader, my current problem is that the light i created follows me around the world when I move the camera around so I would like to know how to fix the ...
1
vote
1answer
714 views

Surface Depth Intersection Shader

I recently asked a question about the creating an accurate Depth Intersection Shader. When creating this in a fragment / vertex shader it could be achieved by the following code ...
5
votes
1answer
1k views

How to write a transparent shader for a sprite that ignores transparent sprites behind it?

I have multiple UI Sprites that have their alpha set so you can see what's behind them. I would like to make these UI Sprites ignore other UI Sprites. So take this first picture. There are 4 UI ...
1
vote
0answers
346 views

Shadow & sorting issues with vertex colored PBR Shader Graph

I'm working on a custom shader using Unity 2018's new shader graph feature. Previously, I was using this shader, which worked great for awhile, but it ended up constantly breaking for seemingly no ...
0
votes
0answers
136 views

How can I achieve a 'warm' scene in Unity using post processing effects?

I've recently fallen inlove with this Cozy Tavern scene by Beholder, and am looking to replicate it's feel the best I can in unity as a learning exercise. A lot of the scene's depth is added through ...
2
votes
1answer
2k views

Depth Intersection Shader

I am trying to create a shader in Unity that shows where intersections occur between objects. Most of the shader I have so far is based off of this youtube tutorial. However, I have made some slight ...
1
vote
0answers
235 views

Unity Mirror Shader double image in HTC Vive / Steam VR

I'm implementing a mirror in Unity for SteamVR / HTC Vive. I'm using the mirror reflection shader for Unity. It looks fine, overall, but the left eye and right eye don't align unfortunately, so it's ...
0
votes
0answers
117 views

What is an alternative method to depth mask for putting holes in geometry in Unity?

I'm trying to put a hole through geometry that another object can visibly go through. A depth mask works perfectly for this, but I've hit a snag: I need objects with transparency to go through the ...
1
vote
1answer
95 views

Ugly Textures in the Distance

I'm here with another question about direct 3d 11 (sharpdx). My terrain engine is working good, but theres a problem with texture mip maps or filter which I can't figure out :/ The problem is basic. ...
1
vote
0answers
213 views

How can I make a collision detection on marching objects?

In a Raymarching project I need to have a collision detection for my Signed Distance Field shapes. I find a project that Implemented simple collision detection.but I need a more stable Physic when ...
0
votes
0answers
38 views

Getting proper shadows in my Disolve shader

So I wipped up this shader that disolves an object. The problem is that the shadow of the object is unaffected from the alpha value. How do I fix this. Full code : ...
0
votes
2answers
131 views

Optimize polygons renderization

I'm developing a game (in Ogre3D) that, in short, consist in a vehicle that moves along a terrain and leaves a colored trail behind it. The trails are basically quads (a), these quads changes their ...
0
votes
2answers
720 views

How to achieve this additive blending effect in Unity shader?

I want to achieve something like this using blending I thought that it might be a simple additive shader but after using Blend One One or Blendop Add I get something like this
0
votes
0answers
54 views

How can I start my health bar at the first target color instead of the whole texture?

I'm using a shader to render the progress of my health bar. Since there are many conditions that change the way this bar animates and behaves, I've decided to make the colors and patterns happen in a ...
0
votes
1answer
62 views

Object Lit/Shader or huge distance from origin problem in large unity project

I have a very large environment where i am getting very weird view of objects as picture given below: As you can see there are black lines/spot, maybe the vertex lit problem. Currently I am using ...
0
votes
0answers
357 views

Unity / Shader : How to draw a gradient through the whole mesh, based on UV?

I have a long and narrow mesh which is generated dynamically - (with the Dreamteck Splines tool). Its like a "long street". Each time the mesh is generated it always has a different size and shape. ...
0
votes
1answer
147 views

LibGDX. How to fill background with shader?

I want to make background of my game like lava via perlin noise. I've read some tutorials but they were too old and some api calls aren't exist already. If I understand right in libgdx I need to ...
1
vote
1answer
128 views

How to make a prefab of a blood effect using provided shader/materials in 2D?

I want to create a blood splat effect as shown in this link: https://gfycat.com/CharmingThickFlies The developer was nice enough to leave the source explain how to apply this. But I cant seem to ...
1
vote
0answers
114 views

What's wrong with my normal mapping, and how can I fix it?

I'm trying to implement Normal Mapping in Directx and I'm very close to creating it but I'm getting these weird black colors on some objects. This is how it looks like without the Normal Mapping: And ...
2
votes
1answer
914 views

How can I create an outline shader for a plane?

All these toon shaders I have been seeing render an duplicated mesh behind it and extrude the normals of the vectors to make it look like it has a border, but it feels a bit hacky to me. Basically I ...
0
votes
1answer
372 views

How can i achieve an outline effect?

I have a small shader that does the following things: (First cgprogram block) Copy the current mesh and scales it along the normals Assign a color to the inflated mesh Draw the inflated mesh (...
3
votes
1answer
360 views

How can I make Iridescence material In unity?

One of the characters of the Dota2 that Is called Nyx Assassin has an interesting material effect If you look at the body and feet you can see this effect.It looks like poily/polluted water.I like to ...
1
vote
0answers
552 views

Unity Standard surface shader with tessellation

So I'm experimenting with tesselation to try and make a custom snowshader and after I finnaly manage to compile the shader without any errors. The plane I'm using the shader on simply become ...
3
votes
0answers
1k views

2D Lighting like Terraria or Starbound [closed]

I have a map with a lot of sprites. I could add a material to the sprite with diffuse shading and than add lots of lights. But that won't give me the result I want. Examples In the first image you ...
0
votes
1answer
872 views

how to use a .mtl file in unity?

I want to use a .mtl file to draw my objects in unity. Can I somehow convert a .mtl file into a normal "unity material"? my .mtl file is like this: ...
1
vote
2answers
81 views

Color change effect, with a sharp line separating the old & new colors

I want to achieve some sort of "transformation" effect in Unity while changing colors in a mesh. For instance, when changing its color from red to blue, I have a line going around the mesh, where ...
0
votes
0answers
18 views

OpenGL ES 3.0 - Uniform Buffer Object non-static indexing

I've encountered a very strange issue while testing UBO on Android device: if I try to index UBO array with non-constant index, the program fails to link with log: ...
1
vote
0answers
137 views

How to figure out why a given shader compilation causes an invalid operation error?

I have 2 versions of a program. The only difference being that in one, a geometry shader is compiled and in the other it is not. In all other regards both programs are identical, character by ...
0
votes
0answers
49 views

Trying to create a quad via Geometry Shader

Im currently working on a shader-driven particle system, but I have some problems with geometry shaders. Im currently givin the shader a point with the position of the particle, and let the shader ...
1
vote
0answers
46 views

A question about HLSL debugger in Visual Studio Graphic Diagnostics

Here 's the thing. I developed a graphic project using SharpDx. Every time I actived the graphic diagnostic and debuged some hlsl code in my shaders, It always showed me the disassembling code rather ...
0
votes
1answer
70 views

What does declaring a const float within a function do? (CGFX)

I've been working with this piece of code to get the mip map level that I should sample for a texture that I got off a forum somewhere. I noticed that they use a const float. Now from what I ...
1
vote
1answer
292 views

Pixel Shader stage did not run

I can't figure out why the pixel shader won't run. I'm using the Blinn-Phong per-pixel shader from here. Only change I've made is that I pass an aditional color per vertex which gets multiplied by the ...
0
votes
1answer
57 views

Why does this floor() call appear to have no effect?

I'm trying to get an effect where my material forms a mosaic which is aligned to the material. So I slapped a simple quad in the scene with a new material on it and set a new shader to that material. ...
0
votes
1answer
161 views

Unity - Fading mesh particles

Is there any ways to fade mesh particles like color over lifetime method with addictive shader. I have little to no understandings of shader coding, and fade rendering issue kicks in even with vertex ...
0
votes
1answer
513 views

How to create pixel perfect noise shader?

I would like to know how they created the pixel perfect noise shader in monument valley 2 in that b/w level (example picture). I think it starts with a billboard shader, but I have no clue how to ...
0
votes
1answer
168 views

Wavy effect/shader in LibGDX

HaxeFlixel has a nifty built-in shader called FlxWaveEffect. Video Demo (Flash required) if you start the game and steer the player into an enemy. Usage (search ...
0
votes
0answers
647 views

How to implement a curved world effect without using a shader?

Curving your game world can be a very effective yet simple effect to add a lot of flavor to your games. This is mostly used in endless runners and other mobile games, but also used in big titles ...
0
votes
1answer
733 views

Noticeable quality loss on texture captured using Graphics.Blit vs Shader output directly to a mesh

I'm currently using a GPU shader to generate a texture. I want to be able to capture the output of this out I'm using Graphics.Blit to output the shaders result to a ...
0
votes
1answer
96 views

How can you pass a large amount of textures or equivalent to the fragment shader in OpenGL?

I am adding shadow mapping to a game engine I am working on. For this effect, each light source needs it's own associated shadow map cube texture. I am going to be exaggerated and say there can be ...
0
votes
0answers
52 views

Albedo not working on .blend model in Unity

I've successfully imported a 3d model from Blender to Unity and the object works fine in game. However, I can't get the Albedo part of the shader to display properly. It affects the model's overall ...
0
votes
0answers
20 views

How would I convert dts to an easier format like .obj, .blend, anything that is supported by blender [duplicate]

Title explains most of it. How would I convert a .dts (from torque) to a .blend to make edits to a model? I don't just wanna use the go to technique, code it yourself. That is because I absolutely ...
0
votes
1answer
130 views

How to create a depth-recording shader for shadow mapping?

I am attempting to implement shadow maps. I am first going to implement spotlights over directional lights (I am aware this is harder). Since I was already rendering the geometry, my attempt was to ...
4
votes
0answers
97 views

Writing a leather shader

I'm trying to write a leather material shader. I have a normal map, bump map (grayscaled), specular map, diffuse map, cube maps. I have done the following ...
68
votes
1answer
7k views

How can I replicate Quantum Break's distortion particle effect?

Quantum Break has this fantastic particle effect, it's a distortion effect like broken glass. I want know how I can replicate this effect? You can see it below, and a full video is available on ...
4
votes
0answers
93 views

Phantom objects in ray tracing

I am attempting to add volumetric shadowing to an application I am working on to test some things. For this effect I wrote the following fragment ...
0
votes
1answer
293 views

Camera and multiple shaders

What is the best way to handle a moving camera inside many shader programs? I believe most games need to have one common projection matrix inside all shader programs to use a moving camera. Currently ...
0
votes
0answers
56 views

Change something that affects everything under -Y value to use normal orientation instead

I'm starting to get a grasp of shaders and I have this one from here and would like to modify it so that instead of just affecting the area under a specified Y value it can be depending on how the ...
2
votes
2answers
168 views

In a shader, what is the meaning of “<some float>.xy?”

I'm trying to research this in Unity manuals online, and I'm finding plenty of references to .xy but not sure what it is. While this is for Unity, I'm assuming ...
1
vote
2answers
374 views

Creating color texture from greyscale heightmap in shader

I'm trying to create a shader that takes a grayscale map as input, and returns a colored albedo that I want to use as texture for my PCG planets, I think that the code below should work, but it only ...
70
votes
1answer
8k views

How can I make a “wet surface”/“shallow puddle” shader in Unity?

In my game I need to create dynamic water puddles but I cannot find a tutorial that shows how I can make such an effect (an example of which is shown below). How can I do it?