Phong: specular problems with translucency

**Edit: Here’s an article that I found which explains the problem in detail: **HugeDomains.com](HugeDomains.com)

This proves that phong (or at least Blinn) material with translucency done successfully but unfortunately, he provided no projects/code for people to use. :frowning:

Hi, I’m trying to find a way to implement phong shading in a game I’m making to make it look more like pre-rendered CGI.

This is the look I’m going for.

http://www.joanpelegri.cat/wp-content/uploads/2017/11/docent-matematiques-1200x565.jpg

I found two custom phong shaders on this forum,and while they do look pretty decent (from what I’ve seen) I’ve run into the same problem with both of them. Whenever I set the blend mode of the phong material to translucent, the specular highlight also affected. This means that the more transparent material the material, the more transparent the specular highlight is.

Picture of the custom specular material:

https://forums.unrealengine.com/filedata/fetch?id=1134815


A picture of the problem:

https://forums.unrealengine.com/filedata/fetch?id=1134817

Here’s a video example of this:


I ran into the same problem with this custom phong material:

http://oi64.tinypic.com/rcq7hv.jpg

I’m so used to working in Maya, and in Maya you can change the opacity of a phong material without it affecting the opacity it’s specular highlight. You can also control the amount of reflectivity the phong material has.

So basically, I’m looking for
1.A way to keep the specular highlights in the phong relatively opaque no matter the opacity of the object
2.A way to use simple reflections with this phong material.

I have no knowledge of Linear Algebra! So I cannot possibly create my own shaders or modify other people’s myself, just so you know.
I only know C++ and Maya (The 3D Software).
Maybe there is ANOTHER way to make objects semi-transparent without using the translucency blend mode? Maybe a way of making Unreal’s default material more “phong-like”?

Thanks in advance.

A link to the code for the custom specular calulation:
https://forums.unrealengine.com/development-discussion/rendering/5897-custom-specular-calculation

A link to the Unreal project featured in theYoutube video that used a custom Phong and made use of BRDF:

I fixed the links to the webpages. They weren’t working before, but should be working now.

You need to use different blend mode. Use Alpha composite to have separate control over transmission and material transparency.

2 Likes

What are good tutorials/guides on this?

Just set the blend mode. Then multiply albedo with opacity. Done!

Thanks a lot!

Is there a way to add reflections to the phong material without adding any additional highlights from the light sources being reflected?(I know by default Unreal uses PBR)
Adding reflections to the phong material is the last thing I need for my project, and it would be perfect. :slight_smile:

Please let me know if you know a way.

Do you mean that you want only indirect specular and not direct specular?

Yes. Just reflections from the environment, but not light sources.

Try plugging 0 to the specular output pin. I don’t know if it’s a bug or intended, but in 4.20 it didn’t affect reflections, only specular.

Reflections are just indirect specular. If it’s really work like that then its bug.

Do you know another way?

Nope because that would be PBR violation.

Not sure if this works with your setup, but if you use Alpha Composite, I think you can still set the “Lighting Mode” for Translucency to be Surface TranslucencyVolume. That receives local Reflection Actors(and SSR if you enable it), but not direct specular from light sources.

Wow, thanks!