Announcement

Collapse
No announcement yet.

Will scenecolor be available again in post process materials ?

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

    Will scenecolor be available again in post process materials ?

    Hi,
    Upgrading from 4.8 to 4.10.1, I found out that I can't use the Scenetexture:scenecolor node anymore on my postprocess materials.
    I saw somewhere on the AnswerHub that it was not a bug but was by design, for engine optimizations.
    Reading this post: https://answers.unrealengine.com/que...rocessing.html
    I didn't understand if there's a workaround to make it work and if it would be available again in future releases of UE4.
    Does anyone know something about this?
    GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

    #2
    Just figured out how to do this after I saw this question, thanks for that. You can actually get SceneColor in post process, but you are going to need to modify the source code, but its not that hard to do, so here are the best instructions I can give.
    1. Download the source code from github using the zip. You can clone it with git, but I just prefer the zip, so the steps might be slightly different, but there are instructions on the github page.
    2. Once thats downloaded, run Setup.bat inside the folder with the code. If you're on OS X run Setup.command, and if you're on Linux run Setup.sh instead.
    3. After this has finished run GenerateProjectFiles with the correct extension for your OS like in step 2. After this, you should have a project for your OS's IDE, Visual Studio on Windows, Xcode on OS X.
    4. Open up the generated project, you should see something like this: Click image for larger version

Name:	Screen Shot 2016-01-03 at 3.17.33 PM.png
Views:	1
Size:	742.2 KB
ID:	1097914 Obviously this will be different if you're using another IDE.
    5. Open up the following file: /UE4/Source/Runtime/Engine/Private/Materials/HLSLMaterialTranslator.h
    6. Once thats open, do a search (control + F on Windows, cmd + F on OS X) and look for "SceneColor lookups are only available", there should be three matches.
    7. Two of the matches should be right next to each other, you should see some code that looks like this:
    Click image for larger version

Name:	Screen Shot 2016-01-03 at 3.20.16 PM.png
Views:	1
Size:	188.4 KB
ID:	1097915
    You need to add in some block comments so it won't give the error message. Block comments start with "/*" and end with "*/" without the quotes. Heres a picture of what the code should look like when you're done:Click image for larger version

Name:	Screen Shot 2016-01-03 at 3.20.27 PM.png
Views:	1
Size:	126.1 KB
ID:	1097916 Hopefully your IDE will make this a bit darker or greyed out to indicate its a comment. Next we need to change another bit of code that looks a bit like this: Click image for larger version

Name:	Screen Shot 2016-01-03 at 3.23.14 PM.png
Views:	1
Size:	93.8 KB
ID:	1097917 And add some comments to make it look like this: Click image for larger version

Name:	Screen Shot 2016-01-03 at 3.23.19 PM.png
Views:	1
Size:	91.0 KB
ID:	1097918

    8. You did it! We're done with code changes now, so now we compile the engine. The instructions for compiling the engine on different platforms are on the github, so I won't retype them. This could take a long time. I have a 4.0 GHz quad code i7 and it took almost an hour, that could be because it uses mono because I'm on a Mac, but be patient, leave it overnight if you have to.
    9. The last step is to launch the engine from the IDE, NOT THE ONE FROM THE EPIC LAUNCHER. This is very important because if you launch it from the Epic Launcher it will be the unmodified version. Once you load it up you're free to make a new project or copy of your old one and get right into it. Make sure that you set the material to before tone mapper, SceneColor seems to get some weird things done to it if its read after tone mapping.

    I think its worth noting that the code that was changed removed more limitations on where Scene Color can be used than just Post Process (I did this because I didn't want to have to compile it more than once, since it takes so long). As this is kinda tacky, it might not work in all cases and may cause crashes, so use it at you sparingly. You'll also have to do this for every release of the Unreal Engine, so just keep that in mind.

    Cheers.

    Comment


      #3
      As far as I know the main reason SceneColor is no longer available is that PostProcessInput0 is both higher quality and faster.

      Why would you still want to use SceneColor?

      Comment


        #4
        @Bluespud : thank you so much ! I compile ue4 from source with each release so i'm familiar with the steps you describe (and it takes about 120 minutes on my old pc!) . It should work fine.
        it might not work in all cases and may cause crashes
        Did it already happen to you?

        By the way: you don't seem to be afraid to dig into source code. So, another question, about scenecapture2D components: can you figure out how you could get something like a "HDR with postprocess" render?
        I mean: there's only 2 options for scenecapture 2D: HDR (with no postprocess effects applied) and LRD with postprocess. But LDR is much lower quality. Ideally, you would need something like HDR quality WITH post process effects.
        I alrealdy asked for a solution but without succes until now.

        @Arnage : yes, scenecolor is lower quality than postprocessinput but it takes place in some of the post process materials i'm working on (see link to my channel).
        Last edited by EdWasHere; 01-03-2016, 11:29 PM.
        GLASSES & WATER SHADERS & CUSTOM PLANAR REFLECTIONS on my Youtube Channel: https://www.youtube.com/channel/UCP2...26Y2bEV4kfl9kA

        Comment

        Working...
        X