Questions tagged [transparency]
30 questions
18
votes
1 answer
Why integrate over a hemisphere (and not a sphere) to solve the rendering equation?
In most text books that I have seen, this is how the rendering equation is written:
$$L_0( \omega_0)= L_e(\omega_0)+\int_{\Omega}{f(\omega_i, \omega_0)L_i(\omega_i)\,\mathrm{d}\omega_i}$$
Where $\Omega$ is defined to be a hemisphere (and all those…
Mon ouïe
- 283
- 1
- 3
16
votes
3 answers
What are some methods to render transparency in OpenGL
Alpha blending can be turned on to make surfaces transparent, like so:
glDisable(GL_DEPTH_TEST); //or glDepthMask(GL_FALSE)? depth tests break blending
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
But this only works if…
jozxyqk
- 669
- 5
- 16
13
votes
1 answer
Is this the correct way to implement Beer's Law?
When I implement Beer's law (color absorption over distance through an object), it never looks very good for some reason.
When i have the color behind the object, I calculate the adjusted color like this:
const vec3 c_absorb =…
Alan Wolfe
- 7,711
- 3
- 29
- 72
12
votes
3 answers
How can I make my ice cubes look real?
I can model ice cubes as slightly misshapen transparent cubes with the refractive index of water, but they don't look convincing. They look like lumps of glass rather than ice.
Looking at real ice cubes I can intuitively describe some differences…
trichoplax is on Codidact now
- 6,222
- 2
- 22
- 67
8
votes
3 answers
Does premultiplied alpha give order independent transparency?
I've heard that pre-multiplied alpha gives you order independent transparency but when I sit down and do the math, it doesn't seem to be working.
Is that untrue, or am I doing something incorrectly?
The formula I'm using is:
$out_{rgba} = in_{rgba}…
Alan Wolfe
- 7,711
- 3
- 29
- 72
7
votes
2 answers
Additive blending with weighted-blended order independent transparency
I am trying to retrofit weighted blended OIT to my rendering pipeline and while it works well, producing convincing results, for normal alpha blending (based on the OVER) operator, I am struggling to make it support additive blending (for example…
Kostas Anagnostou
- 201
- 1
- 10
7
votes
1 answer
Please help me understand what happens as an image is faded to black in order to time-step particle fading
I have a game that has simple particles (basically dots) moving around the screen leaving a trail.
My ultimate goal is to be able to change the opacity of the solid black fading texture each drawing call in a way so that I can keep the length of a…
J.Doe
- 1,445
- 11
- 22
6
votes
2 answers
Are there tricks for getting proper sort ordering on particle systems?
If you have a bunch of particles to render, using different shaders and/or render states, that have some level of transparency, the naive solution of sorting all particles by depth can be extremely inefficient since it is likely to turn a few large…
Alan Wolfe
- 7,711
- 3
- 29
- 72
5
votes
1 answer
Blur with alpha transparency
I'm writing a simple box blur for a graphics library.
The formula makes the average of a range of pixels by adding the ARGB amounts and then dividing by the blur range
For example, with a blur range of 3;
pixel1 FF FF 00 00 +
pixel2 FF 00 FF 00…
ca1e
- 51
- 2
5
votes
1 answer
Benefits of Clustered Shading vs Tiled Shading?
The Unity Engine manual page Best Practice: Setting up the Lighting Pipeline has a section "Render pipelines" with an illustration of Tile Rendering and Cluster Rendering:
The section then mentions:
Opaque objects will most likely be shaded…
wip
- 1,809
- 1
- 12
- 26
5
votes
1 answer
Equivalent of Fresnel law for determining transmitted/diffuse split
I understand that Fresnel tells us what percentage of light reflects vs refracts, but what law tells me the percentage of refracted light that is transmitted versus the percentage of refracted light that is scattered back out as diffuse?
user3412
4
votes
1 answer
using default depth buffer in off-screen framebuffer
I'm trying to implement Weighted, Blended Order-Independent Transparency
There are three passes:
3D opaque surfaces to a primary framebuffer
3D transparency accumulation to an off-screen framebuffer
2D compositing transparency over the primary…
recp
- 185
- 9
4
votes
1 answer
Avoid having an opaque and transparent variant of each pixel shader
Transparency can be achieved (or actually approximated) by using alpha-to-coverage (in case of MSAA) or basic alpha/transparency blending using the following approach:
Bind a rasterizer state with a Less-Equal comparison function.
Bind no blend…
Matthias
- 1,044
- 9
- 25
4
votes
1 answer
Alpha blending between two overlapping semi-transparent shapes
I am working on a 2D lighting system for my game. My approach has been to:
Create a transparency quad representing 'darkness'.
Create a stencil shader for light sources to clip from the darkness quad.
Create a shader that blends alpha from 0 ->…
Alex
- 141
- 1
- 3
4
votes
1 answer
In what order to apply lighting and translucency?
I'm making a game that is supposed to like like a early 90s 3D game, so i'm rendering in software on an 8-bit indexed bitmap, using lookup tables for translucency and lighting.
Now I have to draw a translucent, lit sprite in front of an already-lit…
Wuerfel_21
- 43
- 2