mlavik1 / UnityVolumeRendering

Volume rendering, implemented in Unity3D. Want to support the project? Donate a small sum to Save The Children(https://www.savethechildren.net/) or another charity, and send me a message, and I will be greatly motivated!
https://fosstodon.org/@unityvolrend
MIT License
458 stars 127 forks source link

Volume render object is too much transparent in hololens #255

Open CelaldoganGunes opened 5 months ago

CelaldoganGunes commented 5 months ago

image

How can we make volume rendered object more opaque ? We can't see details.

mlavik1 commented 3 months ago

Hi! I don't have a hololens device to test on, but here's my guess: The opacity should be adjustable by changing the alpha values of the transfer function. However, is the problem you're encountering that parts of the volume are not visible at all? (rather than being semi-transparent)? If so, I think maybe the issue is caused by depth not being written.

See this line in DirectVolumeRenderingShader.shader:

if (col.a > 0.15 && t < tDepth) {
    tDepth = t;
}

It might work if you change "0.15" to a smaller value, for example "0.01"

Maybe I should add an option for this, or investigate if there's a better way to do this.