Source Filmmaker

Source Filmmaker

iwsfg 2015 年 4 月 13 日 上午 6:56
White background affects visibility of semitransparent materials in front of it
Hello.

I have a problem here. If I place white unlit material on background, it somehow affects rendering of the semi-transparent pixels in front of it. What looks like blending mode for these textures in front is being set to screen, but it's not.

Here's an example:
http://i.imgur.com/xpybWUY.png / http://i.imgur.com/J1kVUQH.png

What I have here is a simple scene with only background, particle with semi-transparent part and overlay material that covers right part of the screen with 20% transparent blue color. You can clearly see it on grey background, but over white nor tail of the heart, nor overlay is visible.

And if you slap the same overlay over white color in your favourite photo editor you will get this http://i.imgur.com/d1SQaG7.png (it's clearly visible)

It's probably has something to do with how engine is handling white textures. I'm not great with all the nuances it has, but it smells like there's one. Another thing I thought of is some kind of a color depth, engine uses when blending pixels together, but that sounds too weird to be true.

I tried to tune various materials options, but nothing has changed. I need some assistance.
Thank you in advance
< >
目前顯示第 1-6 則留言,共 6
Pte Jack 2015 年 4 月 13 日 上午 8:13 
When it comes to material masks and transparent materials, SFM seems to work kind of backwards from what you expect from a layered TF2 type material (as you can see with the community based items that are supposedly paintable but stay black, painted or not). If you add a white layer mask to your item in say GIMP or photoshop, the white mask acts as the paintable surface. If you add a black mask, then the colours under the the black don't change. This is probably what your problem is, your white is acting as a paint mask.

Options (and I don't know if this will even work, I haven't tried), try adding the transparency to the main layer using a transparency on your brush and don't use a layer mask . Try using an $alphatest command in your vmt to search for the alpha in the material (Maybe, don't know??? I've been struggling with this sort of thing since SFM was released with all the black paintable community items released. Each material needs its own tweak to make it transparent or paintable.)
episoder 2015 年 4 月 13 日 上午 8:53 
simple logic. what happens if you replace the material setup of the tail with that of the heart? cause that seems to be working. alpha test tho. i see that. ;)

so... just... the default trick for hdr. lower the tonemap scale. you get/need a lil more of a grey tone (lol - not really) then white. that lower hdr color makes that work that the pink can still overblend the actually full white tone. best tip i can give you.

also make sure the particle is not just an additive material. that fails that blending equation too.
最後修改者:episoder; 2015 年 4 月 13 日 上午 8:56
R234 2015 年 4 月 13 日 上午 9:18 
The circling heart's trail (material: tf\materials\effects\sc_softglow.vmt) is additive. That's why it won't show up on a white background. You can't "add" to a colour past pure white after all.
iwsfg 2015 年 4 月 13 日 上午 9:55 
First of all, thanks for the replies.

Well, I added an overlay material in order to make sure and demonstrate that it's not particle-specific, as I assumed originally [but I guess I was wrong here]. And it's also easier to test on overlay material, rather than edit particle every time.

I spent some time reading developer.valvesoftware.com about shader properties and while $translucent/$alphatest was looking like something suspicious, even though description of it misleadingly tells about colliding surfaces. Without fully understanding the way it works I tried to play with these params on background and/or overlay materials, but unfortunally it gave no result. I think I'm missing some general concept here

引用自 episoder
so... just... the default trick for hdr. lower the tonemap scale. you get/need a lil more of a grey tone (lol - not really) then white. that lower hdr color makes that work that the pink can still overblend the actually full white tone. best tip i can give you.

I don't think I fully understood your advise. The background is UnlitGeneric white material. Lowering tonemap will only get the entire scene darker overall and I don't understand how it's going to help me or where else I can get from there.

引用自 R234
The circling heart's trail (material: tf\materials\effects\sc_softglow.vmt) is additive. That's why it won't show up on a white background. You can't "add" to a colour past pure white after all.

Hm.... So it is/same_as translucent once again.

There's other particle named particle_nemesis_blue_burst that also disappears over a white background faster than it should (in fact that's where I picked up blue color and its opacity value for the overlay) and its material isn't an $addictive. It's just translucent and there's also "$no_fullbright" 1 specified.

I tried to replace heart's tail material to sc_softglow_translucent and got unexpected result. It become visible, but only on that part of the screen, where "invisible" overlay is not fully transparent. That got me even more confused. http://i.imgur.com/DipTZn2.png

And... so if I understood correctly, I can't just edit that white background material and make it act same way as black, nor disable the HDR that might have something to do with it (I tried to change luminance values of VTF as well and try switching from unlit to selfillum) and if I want to get particles displayed over bright/white background I have to edit every single one of those that I'm going to use. And I still do not understand what happened on the last screenshot.

At least I figured out the reasons of the original issue. Thank you all~ :pinkheart:
最後修改者:iwsfg; 2015 年 4 月 13 日 上午 9:55
R234 2015 年 4 月 13 日 上午 10:30 
Just comment out the $additive 1 line in the VMT. It should appear just fine over a white background then. Won't look the same anymore, but it'll work.
episoder 2015 年 4 月 13 日 上午 11:46 
xtreme gamma reducing. there's your particle. much overbright[i.imgur.com]. *shrugs* ;)
< >
目前顯示第 1-6 則留言,共 6
每頁顯示: 1530 50

張貼日期: 2015 年 4 月 13 日 上午 6:56
回覆: 6