I believe you just multiply your normal map by the output of the TwoSidedSign and use that as your normals. That seemed to do the trick in my tests. It is only meant for use with the CustomLighting lighting model, though. The normal Phong lighting model does this automatically as far as I know.
I updated the page with an example image that should show up tomorrow.
Announcement
Collapse
No announcement yet.
List of material expressions
Collapse
X
-
Wyldhunt repliedI actually have a minor request too.
Originally posted by TwoSidedSignThe TwoSidedSign expression is useful for flipping the normal on backfaces of two sided custom lighting materials to match the functionality of Phong. +1 for frontfaces, -1 for backfaces of a twosided material.
Is it an automatic thing if I have this in line with my Normal? It autoflips if it's on the backside?
If there's some trick to how you need to set it up (beyond "Connect Normal map to TwoSidedSign. Connect TwoSidedSign to Normal material slot"), could you post an example?
Leave a comment:
-
ffejnosliw repliedShould be all fixed up now (though you won't see it until tomorrow). Those pesky links get me sometimes!
Leave a comment:
-
Star Weaver repliedIn the material compendium itself, there are few broken links like this:
The CustomTexture expression allows you to refer to a texture in the HLSL code inside a [[#Custom][Custom] expression....
Leave a comment:
-
ffejnosliw repliedOriginally posted by CoffeeGrunt View PostSorry to add to your workload, but could you look at the BlendByDepthBias page, and update it to add in DepthBiasAlpha?
BlendByDepthBias is apparently obsolete anyway, and the inputs for the two are different enough to ensure that the example can't be interchanged between the two...
Leave a comment:
-
CoffeeGrunt repliedSorry to add to your workload, but could you look at the BlendByDepthBias page, and update it to add in DepthBiasAlpha?
BlendByDepthBias is apparently obsolete anyway, and the inputs for the two are different enough to ensure that the example can't be interchanged between the two...
Leave a comment:
-
polerin repliedNo biggie. Lots and Lots and Lots to learn. And lots.
Thanks so much for the attention though
Leave a comment:
-
ffejnosliw repliedDuly noted. It will be added to my list, though I can't give any timetable on when I will be able to get to it. Thanks.
Leave a comment:
-
polerin repliedffejnosliw: If you **cough** happen to be looking for a doc to update, the "how to create a Material Effect" doc seems to be sorta sparse, and has dead links. Gave it a read through hoping to gain some insight into outline drawing, couldn't get much from it.
http://udn.epicgames.com/Three/PostP...Materials.html
Leave a comment:
-
ffejnosliw repliedI *think* foliage uses instancing. I will look around and see if I can find out for sure.
Edit: From what I can tell, foliage uses instancing but not InstancedStaticMeshComponents so my gut tells me this expression won't work with foliage. If you try it and have different results, please post back and let me know.
Leave a comment:
-
Xendance repliedOriginally posted by ffejnosliw View PostThe output value should be a whole number between 0 and RAND_MAX for the target platform as far as I can tell. To get a normalized [0,1] value, you would have to divide it by RAND_MAX (of course that value differs from implementation to implementation). Some testing should be able to come up with a good value to use based on your intended use case.
It is the same as a constant so you can multiply it with any other value or whatever.
Keep in mind, it only works when the material is applied to an InstancedStaticMesh or something using an InstancedStaticMeshComponent, such as ProcBuildings. It won't work just applied to a regular StaticMeshActor, InterpActor, etc.
Is terrain foliage counted as InstancedStaticMeshComponent?
Leave a comment:
-
ffejnosliw repliedThe output value should be a whole number between 0 and RAND_MAX for the target platform as far as I can tell. To get a normalized [0,1] value, you would have to divide it by RAND_MAX (of course that value differs from implementation to implementation). Some testing should be able to come up with a good value to use based on your intended use case.
It is the same as a constant so you can multiply it with any other value or whatever.
Keep in mind, it only works when the material is applied to an InstancedStaticMesh or something using an InstancedStaticMeshComponent, such as ProcBuildings. It won't work just applied to a regular StaticMeshActor, InterpActor, etc.
Leave a comment:
-
Xendance repliedOriginally posted by ffejnosliw View PostI just updated that document the other day. Let me know if you have any questions or if you notice anything missing.
One question though: Does the per instance random return a value in the 0-1 range or what? Also, does it act like a single channel of a texture sample, meaning that I can multiply it with textures and things like that?
Leave a comment:
-
ffejnosliw repliedI just updated that document the other day. Let me know if you have any questions or if you notice anything missing.
Leave a comment:
Leave a comment: