20

The form of the rendering equation that uses only the BRDF ($f$ in your example, often called $f_r$) and integrates over one hemisphere does not account for transmission. When adding in transmission, it's fairly common to add a second integral over the opposite hemisphere, using a different BTDF function (bidirectional transmission distribution function). ...


12

Your image definitely does not look correct, and it appears that you are not correctly computing the internal path of light rays as they travel through your mesh. From the looks of it, I would say that you are computing the distance between the point where the view ray first enters the cube and where it first hits the interior wall, and using that as your ...


10

A set of techniques to avoid explicit ordering go under the name of Order Independent Transparency (OIT for short). There are lots of OIT techniques. Historically one is Depth Peeling. In this approach you first render the front-most fragments/pixels, then you find the closest to the one found in the previous step and so forth, going on with as many "...


9

Premultiplied alpha itself does not give you order independent transparency, no. This page talks about how it can be used as part of an order independent transparency solution however: http://casual-effects.blogspot.com/2015/03/implemented-weighted-blended-order.html Other benefits of premultiplied alpha include: better mipmaps for textures that contain ...


7

Two suggestions: If your data is from an image you are displaying on a standard monitor, the chances are it is (or you are implicitly assuming that it's) in sRGB format. This means that the colour components are not linear. Ideally, you should first map into a linear colour space, do your filtering (e.g. blurring) operations, and then map back. *(If you ...


6

The basic equation for alpha blending is as follows: $$ c_\text{final} = c_\text{source} \cdot \alpha + c_\text{dest} \cdot (1 - \alpha) $$ Here, $c_\text{source}$ is the color of the thing being blended, $c_\text{dest}$ is the background onto which you're blending it, and $\alpha$ is between 0 and 1. In your case, $c_\text{source} = 0$ (black fading ...


6

One option is to use depth peeling. Essentially, one processes the scene a set number of times (say, n times) in order to determine the closest, second-closest, all the way to nth-closest fragments of the scene. This processing is done by first applying a regular depth test to the entire scene (which naturally returns the closest surface). One then uses ...


5

The common way to render transparent polygons in a rasterizer is by use of Alpha Blending, which basically combines the colour of the supposedly transparent pixel with the colour of the background at that pixel's position, this way rendering the pixel transparently onto what was already rendered before. This technique, however, requires your polygons (or at ...


5

PaulHK is right in what he said: you have to consider that there may be more than 2 transparent objects behind each other. Also, the idea of deferred shading is to render the geometry only once to be more efficient. If you render the geometries multiple times, you lose (part of) your efficiency. Moreover, the lighting is deferred, thus you'd need to do ...


5

From the proof of premultiplied alpha blending, there is an assumption that "the operator must respect the associative rule." So, it may lead to confusion of the order of process. Since this is not the commutative rule, blend(a,b) is not same as blend(b,a). Hence, blend(blend(a,b),c) returns same value of blend(a,blend(b,c)). but, blend(blend(a,b),c) does ...


4

Two big ones you're missing: Angle-dependent reflection. This is one possible cause of your "transparent in places and not in others" effect, and the most likely cause of the missing wetness. Ice cubes usually have air bubbles trapped inside. This shows up as a white volumetric haze denser in the center of the cube (for small bubbles) or distinct bubbles (...


4

I've found that bump mapping when calculating lighting and refraction rays can add a lot to the look of ice. It makes the ice look textured and imperfect, like a melting ice cube would look. I sort of wonder if maybe animating a bump map could help make it look wet, as water sheets / droplets ran down it's surface. The images below look pretty nice, but ...


4

Alan, Jim Blinn's compositing article also explains why premultiplied is the correct way to do any filtering of transparent images.


4

First option should be to make all particles able to go through the same pipeline. Perhaps with an uber shader. That way you can batch them all. Positive ieee floating point numbers can be sorted like unsigned integer. And there are O(n) algorithms to sort those for example radix sort.


3

Both Unity's "Deferred shading rendering path" and "Legacy Deferred Lighting Rendering Path" work only for opaque surfaces. They both rely on a very similar set of passes: Render the opaque objects' lighting parameters to a number of render targets. This is referred to as the "G-Buffer pass" or "base pass". Lighting is then computed in screen-space using ...


3

Is it possible to bind default framebuffer's depth buffer to another framebuffer? First, you "attach" images to framebuffers. You "bind" objects to the context; you "attach" objects to other objects. Second, no, you cannot attach images of the default framebuffer to anything. If not, how can I copy default depth to another depth buff, or what is best ...


3

You can use a threshold set through a constant buffer to clip pixels (ie an alpha test): float threshold; // in constant buffer float4 color = myTexture.Sample(...); if (color.a < threshold) discard; Set threshold to 1.0 to discard all transparent fragments; set it to 0.0 to discard nothing. There will be some minor inefficency in the latter case ...


3

According to Wikipedia, ice has a slightly lower IOR than non-frozen water, though I don't know how much that difference would affect the results. The "opaque"-looking parts of an ice cube are caused by clusters of microscopic bubbles formed during freezing. You might be able to model those using geometry, but given the scale and number I suspect that some ...


3

When blending multiple layers, physically the "right" thing to do is calculating lighting on each layer separately, then composite the lit layers together. This way, for instance, you can have a translucent sprite standing in a spotlight, in front of a dark background, and the sprite will be well-lit while the background visible through it stays dark. Or ...


3

The simplest solution is to do three passes: Render opaque meshes to a buffer (front-to-back, depth read/write on) Render translucent meshes to another buffer (front-to-back, depth read/write on) This makes sure that only the closest translucent mesh is rendered. Alpha blend translucent mesh on top of opaque buffer using opaque depth buffer. (depth read on) ...


2

Physically, the origin of diffuse light is subsurface scattering, which happens continuously as light travels through a material. So, the proportion of transmitted light depends on the thickness of the object. There's no precise equivalent to the Fresnel law, but maybe the closest thing is the Beer–Lambert law. It states that the transmitted light falls off ...


2

I have worked with this specific formula for the OVER operator but not with additive blending. I'll use the paper's nomenclature in the following discussion: $$ C_f = \frac{\sum_{i=1}^{n}C_i \cdot w(z_i, \alpha_i)}{\sum_{i=1}^{n}\alpha_i \cdot w(z_i, \alpha_i)}(1 - \prod_{i=1}^{n}(1 - \alpha_i)) + C_0\prod_{i=1}^{n}(1 - \alpha_i) $$ This is not explicitly ...


2

You seem to be using additive blending against its purpose. Additive blending is supposed to represent light from multiple sources being combined. It is not physically possible for one source of light to eclipse another. Furthermore, even if you hack an alpha of exactly 1 to mean "opaque", you will get a strange circumstance where an alpha of 0.99 is quite ...


1

The issue is that an extra depth pass won't cut it. You may need an arbitrary number of extra depth passes. Just imagine the volume between two sinusoidal surfaces, you would have infinitely many alternating z-intervals of volume/empty space as long as you're looking from a specific direction. Edit: Taking into consideration the updated formulation, here's ...


1

A fundamental assumption of deferred shading is that there will be only one surface, and therefore only one depth, at a given pixel. An effect that contradicts that assumption will require some sort of special handling in a deferred renderer. Translucency, because it allows to see through multiple layers, is such an effect and therefore will need its own ...


1

Sort the particles by Z each rendering cycle using an algorithm such as bubble sort which is good when element changes position in small steps. If the perspective does not change much the errors would be few enough over time to be unnoticable. The technique is easy to configure between quality and performance dependning on the target platform by adjusting ...


1

I used Stencil Buffer to fixing your problem , you need a way for checking overlapping two or more shapes Shader "Custom/SemiTransparent" { Properties { _Color("Color",Color) = (0,0,1,0.1) } SubShader { Tags {"Queue"="Transparent" "IgnoreProjector"="true" "RenderType"="Transparent"} ZWrite Off Blend SrcAlpha OneMinusSrcAlpha ...


1

This is called "deep shadow mapping" and deep compositing. Sadly invented long before you had this ideas yourself); Now you are talking about implementing this idea specifically on a given architecture (GPU). It's up to you to make it work for this given architecture, and if you have technical difficulties with that maybe you can ask a question on this ...


1

Disclaimer: I haven't actually tested this but it seems feasible. I agree with trichoplax that what you want could possibly be expressed more clearly but, assuming I've understood correctly, would the following do the job? First I assume you can supply the opaque and translucent geometry separately, and that the opaque is sent first. I'm also going to ...


1

A normal argb image has 8 bits per channel and therefor 32 bits per pixel, the size of an integer. That's why it's stored in an integer a lot of the times. Floats are also 32 bits. Something that you can do, is to have a separate image that has only 1 channel, for the transparency. If you make that a float type (or for 16 bit, another type that uses 16 ...


Only top voted, non community-wiki answers of a minimum length are eligible