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

View space positions from depth in DirectX

I have a depth texture and I'm trying to output the view space positions on the screen. In renderdoct I get the following image, and there are two 3D Models a plane and another model. I'm using an ...
1
vote
0answers
45 views
+50

How to fix shadow not casted to terrain when rendering using default and terrain shader (depth shader included)?

Given that I have the TerrainShader class and DefaultShader class. Also a FBO (Frame Buffer Object) shadow map The ...
0
votes
1answer
15 views

OpenGL translation based on “scaled” pixels? (Not physical pixels)

My (2D!) game runs in a “scaling mode” so to speak, and I’ve yet to find anyone asking this question anywhere. Basically, I want to achieve a sort of “scaling algorithm” whether graphics are ...
1
vote
0answers
7 views

Unreal Engine 4- Post Processing material isnt working on different viewports except perspective

I would like to render a silhouette of models, I found stencil would be the best way to capture. But when I am working with stencil post-process material its does not work with other viewports except ...
0
votes
0answers
27 views

3D Cartoon Graphics. Default Materials in Unity, Maya, Blender etc. Do I need to learn shader coding? [closed]

If there was a Stack Exchange for CG, I would post there instead. But since there is not and I know there are a lot of knowledgeable and very helpful people here, I thought I might save a lot of time ...
1
vote
1answer
38 views

Difference between ComputeBuffer and GraphicsBuffer in Unity?

At first I thought that ComputeBuffer's could only be used in compute shaders and that GraphicsBuffer's could only be used in ...
5
votes
1answer
811 views

Invert the colour of pixels where 1 bit sprites are overlapping

I have a simple scene in Unity that makes use of some simple art that uses either white or transparent colours to create a 1-bit art design. The image below shows this. I want to have a that if two ...
0
votes
1answer
18 views

How to use Texture2DArray with Normal map and Normal Unpack node in Shader Graph

I am extracting Normal Map from Texture2DArray in shader graph and then converting it to normal using ...
0
votes
0answers
10 views

Attach a DXR state subobject to a library using the DirectX Shader Compiler

Suppose I've got two IDxcBlob's libraryBlob and localRootSignatureBlob obtained from calling ...
0
votes
1answer
23 views

Unity Texture2DArray is too noisy

I've generated a Texture2DArray from array of Texture2Ds and for some reason, when my shader is using Texture Array the output ...
0
votes
0answers
23 views

Converting Shader to ShaderGraph for URP conversion

I know there are a bunch of threads asking for help with converting old shaders to ShaderGraph, and this one is no different. I spent a lot of time trying to get a shader to cast shadows from sprites ...
0
votes
0answers
13 views

Rotating UVs by X degrees

I would like to make a tileable texture with UV noise in Unity Shader Graph only, but I have a problem. After creating simple noise from UV, I want to rotate it by 90 degrees, but the node ...
0
votes
0answers
19 views

How many texture units are available per shader stage when compared to the total number available on hardware?

The answer to the question How many textures can usually I bind at once?, given here, explains that: OpenGL 3.x defines the minimum number for the per-stage limit to be 16... and that there can be a ...
0
votes
1answer
18 views

How to best select a texture pair to use in height blending when using a splatmap shader

In my project, I'm implementing a shader to combine up to 4 textures in a terrain using a splatmap texture (https://en.wikipedia.org/wiki/Texture_splatting). I want to combine the splatmap blending ...
0
votes
0answers
12 views

Updated Unity project from 2020.2.1f to 2021.1.7: lighting is messed up, scenes are brighter

I've updated my project from 2020.2.1f to 2021.1.7 (also tried 2020.3.8), and now my scenes are much brighter for some reason: Any tips? Current I use the standard pipeline I think, because the ...
0
votes
0answers
26 views

Tree batching problem in Unity

I have some problems with batching trees. I'm using the default unity terrain system and trees. My problem is that trees won't get batched together (I've set up static, dynamic, and GPU instancing) ...
1
vote
2answers
101 views

How to use vertex and fragment shaders without using VBOs and VAOs?

Recently, I am trying to make a 3D game in LWJGL 2, not LWJGL 3, just because I am more familiar with LWJGL 2. Since LWJGL decided to shut down their legacy wiki website, I've been researching alot ...
0
votes
0answers
35 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
1answer
49 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
21 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. ...
2
votes
1answer
81 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
26 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
48 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
39 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
17 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
27 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
41 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
12 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
17 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
10 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
23 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
25 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
64 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
56 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
37 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
47 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
41 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
126 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
35 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
31 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
28 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
194 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
43 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
85 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
19 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
14 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
14 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
102 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
59 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
2 3 4 5
36