Announcement

Collapse
No announcement yet.

Absolute World Position doesnt take geometry into account in SM3

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Absolute World Position doesnt take geometry into account in SM3

    Hi,
    I am having a problem with rendering a fog effect for mobile.
    I was trying to use a combination of Absolute World Position and Camera Position in a Post Process Material to render the distance and to tint the result based on that distance.
    Below you see a test setting for this.
    Click image for larger version

Name:	PPMat.jpg
Views:	2
Size:	107.6 KB
ID:	1584490

    This works like a charm in Shader Model 5:
    Click image for larger version

Name:	SM5.jpg
Views:	1
Size:	36.7 KB
ID:	1584489

    Unfortunately when rendered in Android GLES3.1 preview (my project shall run on Android devices), the geometry is showing no effect.
    Click image for larger version

Name:	SM3.jpg
Views:	1
Size:	45.7 KB
ID:	1584488

    Right now I am using Exponential Height Fog to render the fog in my map, but I am afraid that it is too expensive for many devices.
    So I would love to find a solution for this problem.
    I have already played with a fog effect via the materials based on the distance. But with that, I have to change each material in a map, which is annoying.

    Is anyone having an idea, how I could achieve a cheap fog effect in SM3?

    Regards
    Christian
    Attached Files

    #2
    You're "afraid" or did you actually verify that exponential height fog is too expensive? Because AFAIK it's calculated per vertex in mobile, which should be a lot cheaper than any post process.

    If you want even cheaper fog, roll your own vertex fog using vertex interpolators and add it to all your materials.

    Comment

    Working...
    X