Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [shaders]

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

459 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
12 votes
0 answers
550 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 ...
tobspr's user avatar
  • 410
8 votes
0 answers
399 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 ...
XPac27's user avatar
  • 458
7 votes
0 answers
926 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 ...
user2259784's user avatar
7 votes
1 answer
1k views

Draw Edges in OpenGL

I use blender game engine and blender uses 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: <...
ruckus's user avatar
  • 193
6 votes
0 answers
190 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 ...
FAtBalloon's user avatar
6 votes
2 answers
8k 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 ...
Igor's user avatar
  • 219
5 votes
0 answers
223 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: ...
user673679's user avatar
5 votes
0 answers
425 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 ...
Martin's user avatar
  • 151
4 votes
0 answers
82 views

Simple shader to draw lights on a skyscraper

I have some basic shapes in the background of a scene that represent a small city. There is a stage where the scene becomes a nights scene. I would like to have the city come to life at night with ...
Charl Cillie's user avatar
4 votes
0 answers
185 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 ...
andre ahmed's user avatar
4 votes
0 answers
3k 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....
eternal's user avatar
  • 341
4 votes
2 answers
290 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. ...
grimrader22's user avatar
4 votes
0 answers
782 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 ...
ASteer's user avatar
  • 303
4 votes
0 answers
648 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 ...
Thraein's user avatar
  • 83
4 votes
0 answers
464 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 ...
teodron's user avatar
  • 3,301
4 votes
1 answer
635 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. ...
MaT's user avatar
  • 1,045
3 votes
1 answer
82 views
+50

Is it possible to use a pre-existing texture buffer containing vertex data to initialise a vertex buffer for rendering in OpenGL v4.6?

I'm generating a heightmap in a compute shader in OpenGL v4.6 and storing it to a texture. Lets say I actually store the full vertex data in that texture instead of just the height, which is a trivial ...
Iron Attorney's user avatar
3 votes
0 answers
84 views

Smooth self shadow on dense foliage

I don't know how to achieve or research smooth lighting on foliage, like in this screenshot of theHunter: Call of the Wild. The grass is translucent, but blocks light smoothly when it's tall and ...
Cebbi's user avatar
  • 171
3 votes
0 answers
562 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 ...
ELSTADT's user avatar
  • 31
3 votes
0 answers
121 views

Help in understanding atmospheric scattering shading

I have a made a planet and wanted to make an atmosphere around it. So I was referring to this site: Click to visit site I don't understand this: As with the lookup table proposed in Nishita et al. ...
TheCodeDemon's user avatar
3 votes
0 answers
325 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-...
cstr_'s user avatar
  • 31
3 votes
0 answers
221 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?
John's user avatar
  • 31
3 votes
0 answers
485 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 ...
NeoMorph's user avatar
3 votes
0 answers
2k 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 ...
Andrey's user avatar
  • 230
3 votes
0 answers
452 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 ...
JDoeBloke's user avatar
  • 143
3 votes
0 answers
2k 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 ...
Uri Popov's user avatar
  • 3,027
3 votes
0 answers
226 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 ...
David's user avatar
  • 118
3 votes
0 answers
554 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 ...
zimspy's user avatar
  • 347
3 votes
0 answers
324 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 ...
0xen's user avatar
  • 453
3 votes
0 answers
769 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 ...
AndraSol's user avatar
  • 177
3 votes
0 answers
274 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 ...
Andrea Algeri's user avatar
3 votes
0 answers
83 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 ...
AndraSol's user avatar
  • 177
3 votes
0 answers
853 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 ...
blastb's user avatar
  • 31
3 votes
0 answers
493 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-...
César Augusto's user avatar
3 votes
0 answers
80 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 ...
Ben's user avatar
  • 2,141
3 votes
0 answers
493 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 ...
MaT's user avatar
  • 1,045
3 votes
0 answers
919 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 ...
bravo13's user avatar
  • 31
3 votes
0 answers
454 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): ...
azer89's user avatar
  • 131
2 votes
0 answers
157 views

Is it possible to extract both the color and the depth texture from one RenderTexture and use it in a Shader?

I can access the same with duplicating the cameras AND the rendertextures, but that seems like a lot of overkill of just getting the depth buffer. I don't need a very precise depth buffer, so it can ...
Dirk Boer's user avatar
  • 139
2 votes
0 answers
209 views

How can I modify the TMP Text shader to add a Venetian blinds effect in Unity?

Is there a way to modify a TMP shader so it has Venetian Blinds effect (text appearing in like blinds pattern) like in Adobe after effects.I found a shader that does that the problem is how do I get ...
Ivan's user avatar
  • 337
2 votes
2 answers
1k views

How can I create a shader which makes an object transparent in bright light and opaque in low light?

I'm trying to set up a shader that, as the title says, functions similarly to the effect appearing in the "Lights Out" horror short film. Cut down to the very basics, I'm looking for advice ...
Willixir's user avatar
2 votes
0 answers
1k views

Collapse a 3D model to 2d with Shader?

I'm trying to recreate an effect of 3D sprites similar to Ocotpath Traveler (2d sprite similar to billboards/imposters in 3D space, showing 8 sides of the character based on where they're facing), ...
Gregor A. Lamche's user avatar
2 votes
2 answers
490 views

How to render thin glass with proper refraction?

I want to render thin bumpy glass with refraction. But it offsets too much(look at the black frame of the glass). Looks thick. How to do thin glass refraction properly? Or is it possible to exclude ...
bao007fei's user avatar
  • 151
2 votes
0 answers
2k views

Trying to convert Unreal shader graph to Unity, what nodes are a close equivalent in the Unity shader graph?

I am trying to convert an Unreal shader graph to a Unity Shader Graph. https://api.unrealengine.com/udk/Three/VolumetricLightbeamTutorial.html I am struggling with understanding which nodes to use ...
JacketPotatoeFan's user avatar
2 votes
0 answers
716 views

Is there a way to convert a shader code to shader graph?

I would like to ask if there is a way to convert a Coded shader into the new Shader graph, beacause i want to edit my shaders in more efficient way. Any help is appreciated.
Cubemation's user avatar
2 votes
1 answer
3k 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 ...
JacketPotatoeFan's user avatar
2 votes
0 answers
198 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. ...
Guille's user avatar
  • 21
2 votes
0 answers
910 views

Pixel Perfect Texture Sampling

Right now I am using the following two shaders to render a sprite from a texture used as a sprite atlas onto a canvas that has canvas_size pixels in screen ...
salbeira's user avatar
  • 579
2 votes
0 answers
92 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 ...
tobspr's user avatar
  • 410
2 votes
0 answers
348 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 ...
Jacob Neal's user avatar

1
2 3 4 5
10