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

2
votes
2answers
295 views

Sobel Edge Detection on Depth Texture

I'm currently trying to implement contour shading via edge detection on a depth texture. I'm rendering the color and depth information onto two textures. In my post processing shader I do the ...
0
votes
0answers
172 views

Chaining Multiple Shaders Together (Unity)

this is probably a really stupid issue, but I just don't know how to do it I have shader A: This one does pixel lit sprite shading. It's a cs file that just includes a ton of cgcinc files then I have ...
1
vote
1answer
350 views

Lava flow shader with Shader Forge in Unity

I am just starting with shader programming and after reading a bit, I tried creating a shader that is simulating the flow of lava on rocks. Got a placeholder rock texture from internet and everything, ...
0
votes
0answers
26 views

Make a object render behind/trough another but make hide it if its behind some other object

So first of all sorry for this strange title... I know it may sounds worse and a bit complicated... But heres my problem : My player belongs to the "Player" layer. He stands somewhere on my map, ...
3
votes
1answer
139 views

Cutout fragment shader pixels arent square

It has been solved, link to the final shader: Shader The problem (as portrayed by the image below) is that the pixels seem to be, for lack of a better word, cut off. I wish to either display a pixel, ...
1
vote
1answer
127 views

Unexpected lighting on cube

I am following a tutorial for 3D game development in Java, using LWJGL. I have completed all chapters up to chapter 14 - Terrain, inclusive. The tutorial is in Java, but I'm using Scala. My full code ...
0
votes
1answer
58 views

CompileFromFile syntax error upon compilation

I am using visual studio c++ 2003 edition and I am trying to use the function CompileFromFIle function from DirectX SDK February 2010 SDK to add bloom to my source code for a mod I am working on and I ...
2
votes
0answers
462 views

In Unity's Shader Graph how do you access parameters from code?

I recently rewrote a shared I was using into Shader Graph. As an example I carried out the color as an external parameter. In my traditional shader to set the color I would call something like ...
2
votes
2answers
82 views

Which part of the rendering pipeline compiles shaders?

Generally, video games and other graphical software that use vertex and fragment shaders will have said shaders in the form of actual shader source code (typically in glsl or hlsl), and will compile ...
0
votes
0answers
4k views

Is there a way to convert shader graph to shader code for older version?

Editing Shader in a graph is brilliant feature, however it's only works in Unity 2018 with Lightweight RP template. So I want to use the shader made from shader graph in Unity 2018 to older versions, ...
0
votes
1answer
829 views

Correct way to project a texture with alpha and colors onto surfaces in Unity

I am experimenting with Unity and wanted to project a unit circle beneath a unit and my very first naive approach was to create a child plane below the unit, assign the material to it and stretch it ...
2
votes
1answer
118 views

OpenGL Outlining Cubes in a Greedy Meshed Mesh

So I've managed to get myself a greedy meshing algorithm implemented for a little voxel game I'm developing to teach myself LWJGL/OpenGL, and it's going great. The thing is, I don't plan on using ...
0
votes
0answers
66 views

Load normal-/bump-map data into shader with libgdx

I'm currently applying shaders and want to create bump and normals maps and access those data from my shader. How do I load these separate textures/images into the shader though? Currently I just ...
0
votes
0answers
128 views

What would be a good worley noise feature point function?

I read through various introductions on worley noise and couldn't find a good definition for its feature point generation function. For example there is the book of shader's worley example, and they ...
2
votes
0answers
244 views

Fog of War in Unity

I know that my question will not fall into the type of questions normally asked here (no coding presented). I just need some tips and advise on how to proceed (e.g. pipeline or something). I'm making ...
0
votes
1answer
146 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
vote
2answers
1k views

Unity Shader Graph, set blackboard properties from code

I have a Shader Graph shader with a blackboard property that I want to change from within my code. The property is called Highlight here are the things I have tried:...
0
votes
0answers
49 views

Render problems (black, purple and blue effects) in old GPU and Unity3D 5.6 project on Unity 2018

Well, I have a PC that has a GPU from 2009, and now I have some problems with a fork. The project was on Unity 5 (2015) and I have upgraded it to Unity 2018.1.0, without any problems. But some times,...
0
votes
1answer
70 views

Opengl Postprocessing draws only white

I'm currently trying to implement post processing into my project. First I configure my framebuffer: ...
0
votes
1answer
751 views

Using a Compute Shader in Unity to convert a texture to a float array

I have a fairly simple requirement for a compute shader (DirectCompute through Unity). I have a 128x128 texture and I'd like to turn the red channel of that texture into a 1d array of floats. I need ...
2
votes
2answers
166 views

What are “free vertex indices” in WebGL 2 and how do they relate to geometry shaders?

In January Notch tweeted about WebGL 2: WebGL 2 is happening. Bye, compatibility! Hello, 3d textures and pixel buffers! oh god it's got free vertex indices in the shader. That is basically a ...
0
votes
0answers
34 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
857 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
420 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
168 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
274 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 ...
1
vote
1answer
102 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. ...
2
votes
0answers
267 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
39 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
917 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
1answer
64 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
1answer
190 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
146 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
125 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
1k 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
425 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
449 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 ...
2
votes
0answers
672 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
1k 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 ...
1
vote
0answers
224 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
63 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
52 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
93 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
342 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. ...