Search in

Sort by:

Everything C++ Programming

Current Space

Question Status:

All Questions With Answer With Accepted Answer

Quick results

Search help

Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both.
Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.

You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with
each other. Examples

Have in mind, that GetMaterialSubsurfaceData returns half4, not half3.
Additionally, have a look at
WRITES_CUSTOMDATA_TO_GBUFFER
In particular, its definition on line 23 of BasePassCommon
Under general conditions, custom data is skipped, unless shading model needs it.

Yep, I got that part. I actually just managed to solve it on my own, and since the information isn't -anywhere- on the internet I'm posting it here for the next guy.

In MaterialShared.h there's a part called "inline bool IsSubsurfaceShadingModel(EMaterialShadingModel ShadingModel)" and then it goes on to list various shading models. Apparently, unless you list the shading model there no matter what you do, even if you give it customdata access, it will -never- use subsurface.

The moment I fixed that, what I had with this: GBuffer.ShadingModelID = SHADINGMODELID_insertShaderModelHere; GBuffer.CustomData.rgb = GetMaterialSubsurfaceData(MaterialParameters); started working perfectly immediately.

Thanks for the tip though Deathrey. Are there any other things that may trip someone up when getting into all this? Information is practically barren when trying to find things out about this, it seems less than maybe 10 people have ever even tried making custom shaders for Unreal.