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
1
vote
0answers
325 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
113 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
389 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
42 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
133 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
1k 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
1
vote
3answers
108 views

Spatial Jitter 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
268 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
216 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
143 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
525 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
647 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
837 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
2k 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
84 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
301 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 ...
1
vote
0answers
63 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
136 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
432 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
58 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
269 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
660 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
254 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
1answer
941 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
111 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
1answer
133 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 ...
3
votes
0answers
107 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
8k 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 ...
3
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
392 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 ...
2
votes
2answers
224 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
493 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 ...
71
votes
1answer
10k 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?
1
vote
1answer
617 views

Unity shaders - blend edges of tile textures stored in an atlas

I'm creating a tile based game. The tiles can have different textures. All the textures are loaded at startup and dynamically packed in a texture atlas (this is done to make modding easier). Each tile ...
0
votes
1answer
391 views

OpenGL Tessellation Shader Not Working

I've been trying to play around with tessellation shaders in OpenGL for a couple of hours now, but I'm having trouble to get it to work. I've been following The Little Grasshopper Triangle ...
1
vote
0answers
162 views

Recreating A Puzzle Effect Using Stencils

I'm trying to recreate something I saw on reddit a while back. I tried rendering camera output onto planes, but am not getting the results that I want -- this is basically what I'm trying to recreate: ...
1
vote
1answer
595 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 ...
0
votes
0answers
65 views

How to put triangle information into a glsl shader for dynamic shadows?

I am experimenting with how much I can push the GPU with clever optimizations and correct use of hardware, so I know this may lag my computer a lot, that's not the issue. Currently my goal is as ...
1
vote
0answers
206 views

GLSL: sphere galaxy

I'm trying to draw sphere galaxy mentioned in this tutorial: http://martindevans.me/game-development/2016/01/14/Procedural-Generation-For-Dummies-Galaxies/ Here is an image for reference: Basically, ...
2
votes
2answers
3k views

What can I do with the 4th component of gl_Position?

When I set gl_Position I usually assign it such as gl_Position = vec4(in_position, 1.0) where ...
103
votes
1answer
18k views

How can I create a “see behind walls” effect?

Divinity: Original Sin 2 has a beautiful see-through system. When I go behind walls, a splash mask will appear, and when I move around the game, it changes. It's like a dissolve shader, and has a ...
1
vote
1answer
54 views

Customising character appearance though textures

At the moment I am contemplating adding character customisation to my game, however I am unsure what approaches are available when it comes to using textures/decals to add facial features (like facial ...
2
votes
0answers
57 views

Game objects all blue underneath

I have an empty scene with a single object in it, a cube. The cube renders initially as pink, when it has no material attached. When I attach a material though. Any material. Odd things happen. I ...
2
votes
2answers
886 views

Getting scene normals in Unity

When I get the depthnormals with the shaderreplace script, it just replaces all the shaders in the scene and uses the meshes geometry to calculate the normals, ignoring the normalmap textures applied ...
8
votes
1answer
2k views

Moving texture according to position in shader

Divinity Original Sin have beautiful particle effect , When I move around game I see galaxy through particle that move according to my position.how can I make like it? you can see this effect here: ...
2
votes
1answer
1k views

Achieving 2D Lighting for Terraria-Like Game

I'm trying to achieve the fog-of-war lighting style that Terraria and Starbound have. Terraria's lighting system seems to be more blocky/tile based, but Starbound's is a lot more smooth. The Desired ...
0
votes
1answer
876 views

Change shadervalues for different Meshes in Three.js

Hey I am writing a Shader for Three.js. My goal is to have multiple objects with the same shader and each object should have a color set on the object that is then given to the shader. The goal is to ...
11
votes
3answers
3k views

How can I make natural rain drops on screen?

I'm trying to make rain effect drop with metaballs and trail on screen.I find a clue in shadertoy but I didn't understand how implemented: https://www.shadertoy.com/view/ltffzl unfortunately it have ...