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

How can I roll up a plane like paper?

Hello, I want to twist the plane. The plane looks like this when I try to do it the way I linked below. How can I my plane roll like photos? How can I roll up a plane with a vertex shader? you can see ...
0
votes
0answers
24 views

Need help getting an objects orientation / all my OpenGL rotations are reversed

I'm using OpenGL on Ubuntu Linux with the Eclipse IDE and the GCC compiler. I am bringing blender models into a homemade renderer/game engine. I parse a text file containing object descriptions to ...
0
votes
1answer
13 views

Unity: Opacity over Distance with Surface Shaders

I want to tweak the alpha value based on the distance to the camera. But I see no way of passing the vertex position on to the surface function using surface shaders. Not a problem with frag shader. ...
1
vote
1answer
44 views

Any fast alternative to sine in GLSL?

Should I just use the built-in sin() function or my custom sine function? I'm concerned about performance here. I don't care about accuracy much here because I use it to just get wave effects in my ...
0
votes
0answers
22 views

How can I achieve this “stroked lines” effect?

I have a collection of arbitrary vertices and edges that are connected, but which do not necessarily form triangles. These vertices and edges mostly fall along a flat plane, but have some height ...
0
votes
0answers
43 views

How can I optimize this blur shader?

I'm trying to do a bit of shader development. I found this optimized version of gaussian blur (shadertoy demo), rewrote it in ShaderLab:: ...
0
votes
0answers
33 views

How to texture procedurally generated custom terrain mesh

I am making an infinite procedural terrain for my game and currently trying to apply textures to it. The generated terrain has different biomes, so I want to texturize the terrain based on biome and ...
0
votes
0answers
13 views

How to create a standard pbr material with shader graph?

I want to create a standard pbr material that is editable with the shader graph, but when I install the package and go the Create -> Shader tab, I only have 2 graph options: Empty Shader Graph, ...
0
votes
0answers
25 views

LibGDX Shader that converts sprite to single colour with blurred edges

I made a shader which turns all the colours of the texture to black but I also want it to be blurred at the edges where the opaque sprite turns transparent. Original texture with desired output. <...
1
vote
0answers
38 views

Fragment shader not working as expected

I am porting the following shader into Godot. The results seem not correct though. Apart from the wrong colours there seems to be no change with time. What is the problem with it? ...
0
votes
0answers
9 views

Hardcode per-instance properties into the shader in unity

I am using one of the packages from the asset store and using its Polyline feature for wire rendering. There are thousands of wires and its taking much fps/Batch ...
0
votes
0answers
13 views

How to project a Matcap correctly in Amplify Shader Editor

Unity's Amplify Shader Editor comes with an example of matcap nodes setup, however, the matcap projection in this example is incorrect. As you can see the texture becomes distorted when it's on de ...
0
votes
0answers
8 views

Fade a texture effect as it nears the end of a cylinder mesh

In my game I have a laser beam that travels for about 15m, but abruptly stops due to the mesh the texture is attached to. How can I setup my shader graph so that the end of the texture fades away? I ...
1
vote
2answers
21 views

unsmooth blending with deferred shading and light volumes

So I implemented deferred Shading with a single full screen light pass (picture 2) (by passing the light-data as an array to the shader) and deferred shading with point light volumes (picture 1) (by ...
1
vote
1answer
33 views

Make part of albedo transparent

I have a shader which creates a circle inside of a plane mesh. I would like to get get rid of the parts around the circle, which are the r and ...
0
votes
0answers
23 views

spatial mapping with realworld texturing hololens 2

For a project I'm trying to texturise the spatial mapping of the hololens 2 with photographes. I found a pretty good project witch made exactly what I want the problem is that is a Unity 5.6 / ...
0
votes
1answer
56 views

Specifying a root signature in the HLSL code of a DXR shader

I've noticed that I cannot specify a root signature in the HLSL code of a DXR shader. For example, if I got a ray generation shader with the following declaration ...
3
votes
0answers
48 views

Generate a 2D field-of-view cone

I have a bunch of randomly generated boids flying around on my screen, but I want a function that can give them a field-of-view where they can "see" other boids or obstacles. The code I ...
0
votes
0answers
35 views

Masking cameras for Voronoi splitscreen

I would like to mask a camera to only render to a certain (non-square) region of the screen, to be used as an overlay, for splitscreen, or any other application. The goal is obviously to prevent any ...
0
votes
1answer
29 views

Get a warning about extension when compile GLSL code with glslc compiler shipped with vulkan SDK

Trying to compile my pixel shader,and a warning generated: D:\CS\ComputerGraphics\vulkan\WindowsProject1>D:\ProgrammingTools\vulkan\Bin\glslc shader.frag -o frag.spv shader.frag:3: warning: '#...
0
votes
1answer
27 views

Checkerboard using Shadergraph

In Unity Shadergraph, how can I create a checkerboard pattern that works independently of the size of the quad that it is applied to? Here's what I got so far. Since I have set the Frequency to 10x6, ...
0
votes
0answers
52 views

Unity HDRP transparent material back-face rendering/front face culling

I try to render an object with 2 different transparent materials. One should only render the back faces (higher opacity/more color) and one only the front faces (lower opacity/less color). The purpose ...
0
votes
0answers
32 views

How to include a FX shader to my game?

I have an old game source from 2004, the game runs DirectX9, and I want to improve the graphics. I downloaded NVIDIA FX Composer 2.5, and I created a “...
0
votes
1answer
30 views

Improving the look of a character with solid parts inside a translucent jello exterior

So my problem is a bit hard to explain. I have a character made out of a jello shell, with an internal skeleton. So let me introduce you to ma boi "Chonker McJello" The problem is, that I ...
0
votes
1answer
22 views

Batches Count increase when applying GPU instancing

I have camera across a very weird issue where my batches count significantly increase if I enable GPU instancing: Before applying GPU instancing" After Applying Gpu Instanching: I have a pylon ...
0
votes
0answers
101 views

Difference between putting shaders in “Always Included Shaders” vs “Preloaded Assets”

I am developing an mobile AR application with Unity AR Foundation. After a successful android build, I was told one of the shaders was not found. ShaderNotFoundException: GLTF/PbrMetallicRoughness ...
0
votes
1answer
37 views

Convert a UV shader to Triplanar

I am doing procedural environment generation using Houdini and Unity. There are two main shader features I want: Vertex-Color Height Blending - I currently have a shader for this which I purchased. ...
1
vote
1answer
76 views

Why does my stencil buffer allow pixels through?

I'm rendering a scene using OpenGL. The scene consists of a grassy environment and a small lake (visible as two surfaces). To achieve water surface transparency, I'm using a stencil buffer to render ...
0
votes
0answers
17 views

Converting to LWRP in unity leads to everything being purple

I was trying to use Unity's shader graph which leads me down the path of needing to convert to lightweight render pipeline. When I did I found everything is now pink, not just one or two assets like ...
0
votes
0answers
12 views

Dynamic UI Canvas on Mesh

I have dynamically generated images in WorldSpace Canvas and I need to put them somehow on shield that crashes. Is it possible tu put that canvas on mesh shader texture or render it on texture? How ...
0
votes
0answers
13 views

Applying a shader operation to an existing shader

My procedural game has blocks that can be selected. When selected, I'd like them to to fade a bit; I can achieve such an effect in Shader Graph by applying a Blend → Lighten operation to the block ...
5
votes
1answer
95 views

Is it possible to debug shaders in GLSL level instead of assembly language level?

I'm writing some Vulkan code and write my shader in GLSL. I tried to use Renderdoc to debug my shader, but I only got disassembly code. Is it possible to debug shaders at the level of GLSL if I have ...
1
vote
1answer
51 views

Why is my tessellation output failing to reach my geometry shader?

I'm attempting to render grass using GLSL tessellation and geometry shaders. For vertex input, I'm using position and normal. For reference, here's an image of the grassy field without tessellation (...
1
vote
1answer
82 views

Apply multiple Shaders to one texture with DirectX

I'm beginning with DirectX development and I'm quite confused by the documentation about how to do the following: I have 1 image (Texture2D), I'd like to apply 2 independent HLSL, one after the other, ...
0
votes
0answers
99 views

Using Jump Flooding Alghorithm for pathfinding?

I am creating a distance-to-river texture. I am using the Jump-Flood Alghorithm in a compute shader to do this using simple distance() and it works well. See code below. I want to augment this by ...
0
votes
0answers
18 views

Subtract waves from tilemap

I'm wondering how I could create a shader that would turn a randomly generated shape like this: And turn it into something more like this: Essentially just creating a top down view of ocean waves ...
0
votes
1answer
11 views

Rotate a Polygon node in Shader Graph

I have a hexagon in the Polygon node I would like to rotate so the pointy side is upwards. Applying the rotation nodes, however, simply changes the color of the hexagon from white to a color in the ...
3
votes
1answer
410 views

How to write shaders that can be compiled for DirectX, OpenGL, and Vulkan

I recently finished writing the DirectX renderer for my game engine. Now I have an OpenGL, DirectX as well as a not yet finished Vulkan renderer. Well, the majority of the renderers work perfectly now ...
0
votes
2answers
66 views

Performance of many canvas drawImage calls is very slow

I'm developing a top-down 2D tile-based canvas game. I have a single sprite sheet of all my tiles, and then a JSON tile map array of where they're placed. Previously I would render all the layers of ...
1
vote
1answer
82 views

mapping texture uvs to sphere for skybox

I've been trying to learn shader coding, specifically procedural skyboxes. I've been using this guide here which is a shader graph tutorial and try to write out the steps in code. However, I'm stuck ...
0
votes
1answer
36 views

OUT.worldPosition effect on shader

I am trying to follow a shader tutorial from 2016 for unity. I reached the point where the author is distorting the text by changing OUT.wordPosition ...
0
votes
1answer
32 views

OpenGL GLSL ES 3.10 - Referencing a uniform variable, causes the vertex shader to not draw anything

I have this project, that has a default shader, that just draws models and textures. Recently I decided to add a second shader that does a fancy effect, and is used only on some of the objects drawn. ...
3
votes
1answer
125 views

Shading a concave cube as a convex cube with forced perspective

Context I'm building a graphics pipeline for voxel volumes. I'm using an existing game engine (Bevy) which provides a way to put an object in 3D space. In my application, the voxel volumes can be ...
0
votes
1answer
23 views

HLSL Converting View Direction into Equiangular UVs

In Unity, I am attempting to create a custom skybox that use a single render texture to create a flat unmoving skybox (the render texture source will do it's own movement) and reflect off objects as ...
0
votes
0answers
73 views

How to implement PCSS properly?

I'm trying to implement PCSS in OpenGL/GLSL, but I have problems understanding the details especially the conversions between the coordinate spaces. The existing implementations are so different from ...
1
vote
0answers
62 views

How to give node sillouhette when behind wall in Godot

I am working on a boss-rush fps game. I want it to be like the eye of cthulu fight from terraria, with the enemy flying towards you and then turning around to try again if it misses. However, in order ...
0
votes
1answer
27 views

Fresnel shader excluding one axis

I'm trying to get an outline like effect shown on the right in this video. Using fresnel seems to make the whole thing go white at certain angles. How do I prevent that? I'm using amplify to make this....
8
votes
2answers
2k views

How to create a spiral brightness gradient

I am stuck on creating a brightness gradient that looks as below(the values are continuous from the inner circle). What formulae can create such brightness gradient? So that when _Time is added to it, ...
0
votes
2answers
86 views

Is there a simpler way to simplify the if statement? [closed]

The code below generate angle and radius based brightness gradient. As you can see I need to use 3 if statement to define 3 circle, wonder is there a single code that can create nth circle ...
0
votes
1answer
30 views

Pass equations into shaders to define graphics - HLSL or other shaders

Is it possible with HLSL (or other popular shader languages) to pass instead of an image, an equation that would define the pixel color / position output by the shader? This would allow for more ...

1
2 3 4 5
36