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
7 views

How can I skew a SpriteRenderer in an animation to grow a side and decrease the opposite side by the same amount?

I am interested in the maths and maybe the shader code. I am almost sure that this would be a great starting point but I do not have any knowledge about shaders and the language they are written in. ...
0
votes
0answers
26 views

Optimizing texture fetches with higher mip levels

Let's say I have some shader program in DirectX or OpenGL rendering a full screen quad. And in a pixel/fragment shader I sample some huge textures at random texture coordinates. That is one same ...
0
votes
0answers
38 views

Compute normal based on Voronoi pattern

I am applying a 3D Voronoi pattern on a mesh. Using those loops, I am able to compute the cell position, an id and the distance. But I would like to compute a normal based on the generated pattern. ...
1
vote
0answers
27 views

Color bands over tile when scaling texture in shader

I want to have tiles with different sprites on the back. Initally I thought I will mix two textures together and then apply mixed texture to game object. I thought that should be easy, but google ...
0
votes
0answers
18 views

Multi pass Surface - erro syntax

I'm trying to make a multiple pass using two [blending] for each one, but he accuses in one place, there is nothing, I don't understand why Parse error: syntax error, unexpected TOK_PASS, expecting ...
0
votes
0answers
51 views

WebGL fragment shader pixel position

I have written a fragment shader, on a shape which is a square made with gl.TRIANGLE_STRIP, and which displays a radar: To build the radar, I'm using distance from ...
1
vote
0answers
28 views

How to have a point light with no falloff in Unity 3D?

Does anyone know of a good strategy to make point lights with no falloff, eg. anything in the radius of the light will be 100% illumination while anything outside the radius will be 0% illumination. ...
0
votes
0answers
32 views

How can I modify the transparency n the shader?

I'm learning how to use transparent surfaces. I am using a texture with black background, but any change in transparency is not showing, what I am doing wrong? Here is my shader code: ...
1
vote
0answers
34 views

How can I unpack texture data following a 16 * 8-bit pattern?

Is possible to unpack texture data following a specific bit packing scheme? I have read that texture data in HLSL can be read in as 4 floats of 32 bits each totaling 128 bits. The packing scheme I'm ...
0
votes
1answer
46 views

Only one triangle drawn

I am trying to render a quad with gl render mode GL_TRIANGLES with using element array buffer. Here is some code to explain process. Only the first 3 elements of indices array are drawn as expected. ...
0
votes
0answers
14 views

How to debug shaders running on Android 4.x devices?

I have tried some of the existing inspectors such as RenderDoc and gapid, but none of them can be used with Android 4.x. Latest version of gapid requires Android 6.0 and RenderDoc requires Android 5.0....
0
votes
1answer
36 views

Unity Shader Blend like ugui Outline

Unity UGUI Outline it create fourfold vertexs, So I wirte shader to optimization ( vertex only create once ), And I want to Keep one pass . (one drawcall) There ...
0
votes
0answers
23 views

Rendering part of an equirectangular video on a plane

For a Unity project I have a 360 camera which produces an equirectangular video. I need to realize preview of this video for putting it on a plane. In most cases the part of the video to be drawn on ...
0
votes
0answers
21 views

SharpDX (DirectX11) Weird depth behaviour creating pixel error

I'm trying to render a simple terrain but I have a problem with the rendering result. The "blue" (it's the backbuffer clear color) pixels are the ones that I don't know where they come from. The ...
0
votes
0answers
42 views

Logic behind a cubic reflection

I'm creating a cube in WebGL made of mirros that have to reflect the object inside of it. At the moment I'm stuck because I don't understand the correct logic to implement to achieve the result. I ...
0
votes
0answers
14 views

Do I have to write #pragma multi_compile_fwdbase in ShadeLab?

Recently I met a problem that if I don't write #pragma multi_compile_fwdbase then the shadows will never be shown. However, if I don't want shadows, it's ok without ...
0
votes
0answers
47 views

Simple water reflection is going wrong

i added simple code to my water shader that should add reflections of objects above the water line. The problem is that the reflection is only correct when the camera is in a certain angle to the ...
0
votes
1answer
42 views

Standard Unlit shader doesn't work?

I created a project to download and try out free Unity assets. I then transfer the assets I actually want to use to my actual project which uses the LWRP render pipline. I tried to get some particle ...
0
votes
0answers
6 views

To extract Grabpass image as texture2d via script

We applied it to the plane object using Grabpass. I want to import the image shown in plane through script. I want to make the imported image in texture2d format. Is there a way? Below is the relevant ...
0
votes
0answers
28 views

Convert Rainbow gradient Shader to 3 colors gradient

I am attempting to convert this rainbow shader into just using three colors. I thought I would be able to set the three colors in the shader file, but I can't understand how to link them through the ...
1
vote
1answer
57 views

How to use a sprite mask or shader to mask a text?

I'd like to know what I need to learn to apply a shader to achieve masking on the text. Here is my text object in-game, I'm using a sprite mask to mask the game objects on the card, they're all in ...
1
vote
1answer
40 views

How can I clip my sprite as it passes through a portal in a 2D scenario, using OpenGL?

This is a very simple question, but after a brief search and reading through the "similar questions" I could not yet find an answer. I'm creating a 2D game using OpenGL and came across a problem: Let'...
0
votes
0answers
17 views

Cross section shader for box bounding using amplify Shader in Unity

I am trying to create shader through amplify shader for a cube to cut through plane or any mesh when cross section. I know that I should be using size, rotation and position for that but what exactly ...
0
votes
1answer
28 views

Add single color background to texture using shader

I want to add a single color background to my texture. In my case, in Unity UI, I can simply create two Image components, one on top of another, and use the one on the bottom as a single color ...
1
vote
0answers
34 views

How to make a Material that looks like a sun

I am trying to understand material and shaders in Unity. I would like to make a material to attach to a sphere, and make it emit light like a sun. For the moment I do not care if it's not looking ...
0
votes
1answer
23 views

How to access random material in a renderer besides first without cloning any materials except accessed one?

Clones only first material: renderer.material Clones all materials in the same renderer: renderer.materials[0]
1
vote
0answers
69 views

Procedural sketch / painting shader

So after some google searching apparently I don't even know what this technique is specifically called: I'm trying to figure out how to create an effect in unity that 'paints' a 2d asset on screen. ...
0
votes
0answers
65 views

Unity - Shader Graph not displaying preview in HDRP

I'm working on a new project (Unity 2019.2.4f1, HDRP). I made my first PBR shader and it works correctly when applied to a material, but it doesn't display anything on the Main Preview in the Shader ...
0
votes
0answers
19 views

How to create a fog for baclgro6 which works on mobile devices?

There is a forum entry, which explains how to create a high based volumetric fog, using soft particles ( How can I create a height-based volumetric fog? ). Unfortunately it doesn't work on mobile ...
0
votes
2answers
90 views

HLSL - Shore fading in a water shader

in my desperation while trying to achieve this (I am a HLSL noob) i try to ask my question here. I am modifying an old water shader for the game "MTA San Andreas" (the multiplayer modification). MTA ...
0
votes
0answers
41 views

How to get depth buffer from PUBG?

I have no any experience in game development, I'm doing some research on machine learning tasks and for my project I need to know how to get depth buffer. I tried to google but haven't found relevant ...
1
vote
1answer
143 views

How can I dissolve using dynamic mask objects?

I want to Implement dissolve shader like this youtube video as you can see minions projected light on house to burning it out. I like to know how to make a similar effect.
0
votes
0answers
23 views

Shader for blending meshes needs to run on LWRP?

I got this shader from free asset call "Terrain Blending Starter Kit". Unfortunately, It doesn't support LWRP. I tried to fix/add things to make it run but I failed. Could any one help me with this ...
0
votes
0answers
23 views

How box can look like cylinder with circle texture

I have 25x25 cubes at scene. I give it a texture with Tiling- offset settings. But i have problem about cubes at corner. i want it repeat like at top surface so i cant see it like 3D object. But as u ...
0
votes
0answers
23 views

Visible object only through the wall

I need to view my object only through the wall (and this object must has his original material). I tried to use CustomDepth - SceneDepth on Opactiy in material of the wall to do transparent place on ...
3
votes
0answers
42 views

Strange normal mapping artifacts - OpenGL / GLSL

I have been following a few tutorials to learn some graphics programming with OpenGL, and recently implemented Normal Mapping. It works well for the most part, especially for objects with normal-...
0
votes
0answers
54 views

Shader: displacement map to the all screen?

I want to recreate this effect shown here So I tried recreating this shader from shadertoy in Godot: This is the my translation in Godot Shading language of the first shader I linked: ...
1
vote
0answers
40 views

What's the most efficient way to implement low poly flat shading style?

I want to know what's the most efficient way to implement low poly style flat shading. I have checked this post, however the options listed in the page don't feel perfect to me. I list them below for ...
0
votes
0answers
25 views

Depth Mask Shader

How can I use this in Unity to render something only at a specific depth, for example : I have small boat on the water surface but I see water surface inside boat.
0
votes
1answer
21 views

How can I apply UV mapping in parent space?

I'm trying to apply UV mapping in parent space - ie. taking into account the object's own transformation matrix but no matrices further up the transformation hierarchy. For example, I'd want to be ...
0
votes
1answer
105 views

Can't Create High Definition Render Pipeline Asset in Unity (Create > Rendering Doesn't Exist)

I've upgraded my project to Unity version 2019.3.0a11. It complains and can't load scripts, mostly because it can't seem to load the original HDRPipeline. I want to make graphics display properly. In ...
0
votes
0answers
43 views

Unity Default Shader Greyed Out

I created a pland in Unity 3D and then tried to alter the material. I looked at it's material component, but all the options are greyed out! how do I fix this problem?
1
vote
0answers
95 views

2D Shader for affecting lights based on y-distance

I've been struggling with this problem for a few weeks (mostly because I'm so new to shaders), but I have an angled camera for my 2D game that uses lights. I saw this link about the '3D light ...
0
votes
1answer
46 views

Rotate mesh to normal

I have some instanced geometry (basic tube meshes) laid out in a grid, and I have a noise texture (normal map) that I want to use to rotate my instances with. So head pixel in my texture is a normal ...
1
vote
0answers
18 views

pixel displacement with shader

Having started learning shaders and experimenting with tools like Shadertoy, I am attempting to make stereoscopic (anaglyph or autostereogram) shaders as an exercise. For this, I need to displace each ...
3
votes
2answers
266 views

Seamless 2D wrap-around effect

I am trying to show multiple images on a grid system which are randomly generated and the grid is moving from right to left. What my client wants is when a part of a picture goes off the left edge of ...
1
vote
1answer
243 views

How can I achieve this top-down water effect in Unity?

I want to create a virtual fish pond similar to this in Unity (full video): The ocean floor and fish are not a problem, but the effect of moving water that displaces the content below the surface is ...
3
votes
1answer
78 views

OpenGL Fragment shader: not all fragments showing colors

I'm writing a simple 3D renderer and while the model loads fine, the colors are off. Quite a few fragments in the model show no color at all. Here is the render: The locations of the blacked out ...
2
votes
1answer
75 views

OpenGL Textures: Texture contains color lines when object is further away that some distance

I tried searching on the web but couldn't find a reason for this. When I render an object close to the camera, the object and texture renders fine. But further away from a fixed distance, it starts ...
3
votes
0answers
90 views

How can I make a tendril flame like aura visual effect?

I am a bit new to UE4 and I'm trying to get a tendril flame like aura like the picture below. Does anyone know how I would go about this? Should I use post processing or particles?