Hi,
first off, thanks for your replies.
I’m using Linear Color Space and a R32G32B32A32_SFLOAT render texture. When I wrote this, I quickly clicked through all available color formats, but colorwise they look all the same (no HDR color applied). Also it doesn’t make any difference for the background transparency issue, if HDR is turned on for the render texture camera. Here are the complete settings for the texture:
I’m not sure about all settings, but as I mentioned, no matter what I select or which boxes I tick, it doesn’t make any difference for the issue I described.
As c0d3_m0nk3y pointed out, it’s not a general problem with transparency, as the particle effects shown have transparency applied. It’s the background for the render texture that is no longer is transparent, as soon as I turn on HDR for the responsible camera.
I made the solid color of the camera green (alpha 0) and increased the particles size to better visualize the effect. I use a solid black color with alpha 0 otherwise. I don’t have an HDR monitor.
To clarify what I want to achieve: I want a character to be rendered by a dedicated camera to a render texture, so I can add it as a Raw Image component into Unity UI. The character should have it’s equipped weapon in his/her hand. These weapons can have different particle effects, depending on the type of damage and/or status effects they can apply. The pictures shown are from a magic staff that deals magic damage, so there should be some sparkly particles flying around. For a poisonous weapon there should be some green stuff floating from the weapon etc. You get the picture.
The screenshots were taken with a particle effect out of this FX package and utilises a custom shader for the particles, which came with the package. This shader uses a HDR color, and that’s how I stumbled upon this problem. I guess I’ll have to dig into that shader and see what I can come up with.
Nevertheless, I encountered the problem (I think) that bgolus describes. When adding a standard particle effect the particles are only drawn when they’re on top of an opaque surface in the render texture. I took the PoisonGas from the Unity Particle Pack. It uses the Particles/Standard Unlit shader.
From left to right: Scene View / Render Texture as shown in the Inspector / Raw Image in Unity UI / Material with Unity Standard Shader (Rendering Mode Transparent) applied to a plane in 3D world
When I switch the particle shader to Mobile/Particles/Alpha Blended it shows as I would’ve it expected to (like the original render texture in the inspector view), so this might be suitable workaround, but I haven’t checked it out in detail.
Please note that this is a different but somehow related problem, to the one I described in my previous post. But both of them need fixing. If I understood bgolus correctly, I can solve this one here by editing the shader and manually set the alpha blend mode to the correct value. I will try this eventually.