Questions tagged [shaders]

a computer program that runs on graphics hardware and provides a high degree of control over how scenes are rendered

262 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9
votes
0answers
327 views

Spherical Area Lights do not match reference

So I'm adding spherical area lights to my application, and comparing my results with mitsuba, I am getting some differences (left is my approach, right is mitsuba - a pathtraced reference): What I am ...
6
votes
0answers
277 views

How to draw Shadow Volumes in one draw call?

I've got a simple app that draws 3D cubes using instance rendering and I'm implementing Shadow Volume. Each cube's vertex, uv, normal and index data are statically stored in 4 vertex array buffers. On ...
5
votes
0answers
99 views

How many Pipelines in a Typical Rendered Scene DirectX12

I'm learning DirectX12 right now and I'm missing a few pieces of the puzzle in my own head on the overall structure of how you would setup a game. Specifically, I'm trying to get an idea of how ...
5
votes
0answers
521 views

Irradiance Map ( Irradiance environment map)?

As irradiance map is generated for every possible normal for all the texels in environment map (as every texel act as a light source) so that we can look up irradiance map, based on normal of fragment ...
5
votes
0answers
977 views

How do I make volumetric grass?

I've been extremely interested in volumetric technology, especially for grass. Online resources are extremely scarce on this topic. What is the difference from creating a lot of mesh billboards? ...
5
votes
2answers
5k views

Unity - Water Cube (to 2D game)

I wonder if you can create a cube of water within the unity! I'm starting to use the Unity, and took a sought as to whether there was already something like this ... but have not found any tutorial ...
4
votes
1answer
252 views

Weird shader behavior on different devices

I'm trying to combine an ordinary shader with a Single Distance Field shader (for fonts and scalable icons) into one shader program. The idea is simple - if uv.x is less than 1.0, it is drawn as ...
4
votes
0answers
424 views

Draw Edges in OpenGL

I use blender game engine, and blender use openGL for graphics. How can I draw lines around all 3D objects? Would this be a job for a filter? Mainly, I want my end result to look drawn. I found this: ...
4
votes
0answers
132 views

Raymarching tangents

I've recently started to experiment with raymarching over on shadertoy.com. It seems common to find the normal for a distance field like so: ...
4
votes
0answers
384 views

Sprite outline based on light position in UE4

I have simple sprite (for example black box) and I like to add to it outline (red line on example image) but based on light direction. I know UE4 use deffered renderer, so I cant access to lights, but ...
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 ...
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 ...
3
votes
0answers
317 views

Combine a light and water shader in libgdx glsl

I am trying to combine a light shader with a water shader in libgdx. Shader programming is not one of my strengths at all. This is the water effect rendering nicely: And when I have added the ...
3
votes
2answers
202 views

Fine tuning light shader mechanics

I'm currently trying to implement the lighting technique described in this article. I've done pretty much exactly what is done in the article. My technique is the same, and my shader is the same. ...
3
votes
2answers
1k views

OpenGL GLSL using projection,view and transformation

I have been trying to get a simple triangle to render on the screen. I am using Projection, View and Transformation matrices but am unable to get anything to the screen. Main loop ...
3
votes
0answers
722 views

Particle-system in the GPU in Unity: how to load/store data from/to a texture in the shader?

I have been implementing a simple GPU-based particle system in Unity, for my current game. The setup is indeed not very elaborated: the shader receives a set of coordinates passed trough the position ...
3
votes
0answers
734 views

Unity - reconstruct position from depth

I am using Unity and I want to reconstruct position from depth and frustum corners in pixel shader. I am doing this: In my App, I calculate view-space corners of the far frustum plane and pass them ...
3
votes
0answers
341 views

Using depth values for fake ambient occlusion

I'm using the normalized distance to the camera to get depth information in the fragment shader. When using this value as fragment color, it looks at lot like ambient occlusion (of course only in the ...
3
votes
0answers
382 views

Full screen shader causes performance hit

I basically want to have a shader run that can do something like toon shading, or grayscale the whole screen, or radial lighting. To do this, I create a new bitmap each time the display resizes that ...
3
votes
0answers
429 views

Normal maps in 3dsMax - OgreMax - how to view associated tangent vectors?

Reading this post I found out that 3dsMax might not use the same tangents when rendering normal mapped objects. In my case, I was using Ogre and OgreMax to analyze results and they were very ...
3
votes
1answer
610 views

Fog shader camera problem

I have some difficulties with my vertex-fragment fog shader in Unity. I have a good visual result but the problem is that the gradient is based on the camera's position, it moves as the camera moves. ...
3
votes
2answers
394 views

How can I add a glow effect around a pair of wings in Unity without post processing?

Basically I want to use post processing and then I found a tutorial to achieve my goal. However, the artist want a pure shader to achieve this, without any C# script hanging in the main camera. Any ...
2
votes
0answers
71 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?
2
votes
0answers
92 views

Trying to get Vertexshader to work Monogame 2D

If I don't use the vertex shader, it gives me white textures which is what the default color is. Once I add the vertex shader, the screen is black. I figure it is something wrong with the Matrices I ...
2
votes
0answers
589 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
0answers
260 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 ...
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 ...
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 ...
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
0answers
145 views

Generating color for mesh in Texture3D or shader?

In Unity, I'm trying to choose between two ways of procedurally colorizing meshes (with vertex color). The main concern here is performance, knowing that my software is already GPU bound (more ...
2
votes
0answers
2k views

Overlap transparent particles without blending? (Unity)

I'm trying to create a continuous output of light from an object (like the exhaust of a space ship), and I thought I'd use particles to achieve this. But I'm running into a problem with alpha blending....
2
votes
2answers
4k views

Writing and reading Computebuffer in a Shader

I'm trying to write into a Computebuffer in the fragment shader, but it doesn't work. Its pretty hard to get the Depth-Value in the Compute Buffer, so it would be so easy to just use the Pixel/...
2
votes
0answers
228 views

Geometry Shader crashing

I keep getting some strange errors in my Geometry shader and when I search for the cause of the errors, it returns nothing substantial. Here is the code. Shader ...
2
votes
0answers
543 views

Keeping a mesh entirely at the GPU and changing its vertices there with a ComputeShader (Unity5)

In a Unity game I have an object whose mesh is made of around 10k vertices and I have to make changes to these vertices (position, color, etc) almost every frame. Considering that such object is ...
2
votes
0answers
170 views

OpenGL ES 2.0 not drawing images with shadows

I'm using OpenGL ES 2 to program a simple game 2D for Android mobile phones. I'm coding the rendering portion of the software, using the GLES20 default library. All my sprites are rendered from a ...
2
votes
0answers
68 views

Is there a way to identify, within a shader, the current GPU thread ID?

My question is rather simple: within a shader, is there a way (that works both in DirectX and OpenGL) to retrieve the ID of the given GPU thread being executed at the given iteration? I am using ...
2
votes
0answers
92 views

DirectX 11 - Problem with low resolution decals

I'm trying to add a decal system in my DirectX engine but i'm facing some problems with the quality of the textures projected. Every other no decal texture look fine, but these ones look really bad. ...
2
votes
0answers
691 views

How can I create a wind visual effect like Ori?

I'm working on a mobile game in Cocos2D. The game mechanic is very similar to Ori and the Blind Forest's parachute (Kuro's feather) mechanic. I want to be able to render a visual effect for wind ...
2
votes
0answers
323 views

How to have a gradient blur in objects on Unity?

This is related to a previous question I've asked here: How to blur entire scene but a specific spot in Unity? At the time I managed to solve my problem with a "hard" cutoff on the blurred and non-...
2
votes
0answers
71 views

How can non-CG shader code in Unity be included?

In Unity shaders, #include, #define, and other preprocessor commands seem to not be able to be used outside the CGPROGRAM section of the shader. Since these are required for compiling multiple shader ...
2
votes
0answers
403 views

Subsurface Scattering - Transmittance

I have a question related to SSS and especially transmittance. I've looked at several papers about that topic, most of them from Jorge Jimenez, which are very interesting and, I admit, a bit hard for ...
2
votes
0answers
71 views

Consistent Shadow Map Filtering

I want to filter my shadow map generated by PSSM, but the problem is that I have a inconsistent filter size. The problem is that the shadow map sources rotate to find the best fit for the camera ...
2
votes
0answers
332 views

Ways to get around the limiting default terrain shaders in Unity

I am trying to use the Toon Rim Light shader for Unity however there are a few problems when trying to use any custom shaders for a terrain in Unity. The most well known is of course, that all ...
2
votes
0answers
122 views

Phaser: Shader Chain

I want to implement lighting via shadowmaps. I see process as: 1) render something to RenderTexture1(size as game) 2) create RenderTexture2 (custom size) 3) add it to Image2 (custom size) 4) apply "...
2
votes
0answers
97 views

Texture shader using model's texture

I'm trying to get a model rendered in monogame using a texture shader. I'm using the code from this tutorial project: http://kgiannakakis.github.io/MonoGameEffects/ I created a simple textured cube ...
2
votes
0answers
285 views

Generate a large data structure using a compute shader

I know that RWTexture2D Result; void CSMain (uint3 id : SV_DispatchThreadID) { Result[id.xy] = float3(1,2,3); } will result in an texture ...
2
votes
0answers
66 views

postprocessing shader destroying viewport on linux?

Basically I implemented gamma correction into a q3 based game to get rid of the annoying SetDeviceGammaRamp. On windows and macosx everything works fine, but on linux it draws garbage. It looks like ...
2
votes
0answers
320 views

OpenGL: Avoid geometry shader for cubemap framebuffer

I want to render an environment map into a cubemap framebuffer but I dislike the fact, that I have to use the geometry shader to set gl_Layer because the geometry ...
2
votes
0answers
837 views

How can I combine my scrolling effect with the vertex lit shader?

I want my shader to work in both Forward and VertexLit rendering modes. I'd written a texture scrolling shader, but I also want to consider lighting which is produced by Vertex lit shader. I can't add ...
2
votes
0answers
336 views

How to fix problem in serpentine case using Blinn/Loop algorithm

I'm trying to implement Blinn/Loop algorithm to render cubic bezier on shader. I calculate the curve type using code below (v0, v1, v2, v3 are cubic bezier segment): ...