Announcement

Collapse
No announcement yet.

Blacklight and Retroreflective effects?

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

  • replied
    I know this is an old thread here, but just want to say retroreflective specular is totally possible (with C++). I did a very primitive version this weekend.
    Material on the left is Default Lit, on the right is Retro Reflective.



    I'll add more details to my writeup at some point.
    http://williamgs.com/blog/?p=1238
    Attached Files
    Last edited by william.sch; 05-13-2019, 04:38 AM.

    Leave a comment:


  • replied
    Originally posted by Aetherdyne View Post

    Oh, believe me, I know; I've been tinkering with game engines since Descent and Quake. I'm not looking for a 100% accurate solution, just something that behaves close enough.




    I'm not sure I follow you. Subsurface shading scatters light inside a material, with the effect being most obvious when the light originates from behind or somewhere off to the side of the object ... that's the opposite of a material that reflects light strongly directly back toward its source. Unless you mean to constantly move a light, such that it's kept on the far side of the object in order to use the subsurface scattering as a fake highlight. I'm not sure that'd be convincing, especially when the retroreflective material is only part of an object (like stripes on a safety vest or whatever)

    A gentleman by the name of Joel Graff seems to have managed to implement the effect in UDK. Unfortunately, the two videos he's posted (1 and 2) don't give any real details on how he did it, they just explain the effect in real-world terms, and show it off in game.

    I can get close already. If you load up the Math Hall level from the Content Examples, there are two Camera vector examples at the far end of the hall. The second is pretty similar, you just change the colors to black-white instead of red-green, and tweak the size of the effect.

    But the camera pointing at the material is only part of the effect. As mentioned above, the main problem I'm having is figuring out how to get the material to respond only when there's a light source roughly in-line with the camera and material.

    I found a Blender example, which hints at how it might function, but I'm still sorting out how to translate that to UE4 material nodes. Also, I think that the effect shown in that example is not accurate: first, the 45 degree angled sides shouldn't reflect that strongly even in the first example. second, as the light moves off to the side, given that the test object appears to be a convex cube (rather than a concave shape formed of three perpendicular planes, like the rear half of a cube) the effect should be following the light, not moving to the opposite side of the cube.

    It may not even be possible to react to a light source with a basic material in the same way UDK (or Blender) did. This thread from March (specifically Jordan Walker's post) suggests that postprocess materials might be necessary, given UE4's deferred lighting model. Later in the thread, there's some indication that passing vectors around with constantly updating blueprints might work, but that sounds like a performance hit for no good reason if the information can be achieved another way.

    Edit: Upon further research, it sounds like TextureDefinedSpecularShape is what I need to be looking at, at least for implementing it similar to the Blender material above, but I haven't tested this yet. There's a note that the implementation of that function is incomplete, however...

    EditEdit: Feh, it appears to be absent entirely. The first two functions listed on the above page exist, but this one has been replaced by MetallicShading. Maybe FuzzyShading will work instead...

    As far as blacklights go...



    (Edited this bit...) Using emissive and masks and such is exactly what I had in mind as far as the specific appearance, but you may be right that I was thinking a bit too real world for this one, since I had notions of subclassing the lights to make a UV source or somehow accessing the light vector similar to retroreflectivity. I don't actually need to do that, nor access the real lighting information at all. (Edit: Well, except for pesky shadowing...) Mostly, I think I just need distances to any actor that is standing in for a UV source, and possibly the angle if said source is directional (like a flashlight, so you can taper the effect at the edges of a spotlight-like conical region). This drives how much of the UV appearance to blend in, if any, with emissive determining how it looks under said light. Layered materials can do things like invisible ink or what-have-you.
    Did you ever figure this out?

    Leave a comment:


  • replied
    Originally posted by Daedalus51 View Post
    Hahaha...man I can totally feel you! However, you are tackeling this from a waaaay too technical perspective (or should I say a real life perspective^^)

    I have good news and bad news for you^^ First of all, game development is all about intelligent faking since computers can only render a certain amount of real worlds complexity. However, some things are still getting possible with new tech.
    Oh, believe me, I know; I've been tinkering with game engines since Descent and Quake. I'm not looking for a 100% accurate solution, just something that behaves close enough.


    So first of all, what you want with the retroreflection sounds very much like a standart sub surface material to me.
    I'm not sure I follow you. Subsurface shading scatters light inside a material, with the effect being most obvious when the light originates from behind or somewhere off to the side of the object ... that's the opposite of a material that reflects light strongly directly back toward its source. Unless you mean to constantly move a light, such that it's kept on the far side of the object in order to use the subsurface scattering as a fake highlight. I'm not sure that'd be convincing, especially when the retroreflective material is only part of an object (like stripes on a safety vest or whatever)

    A gentleman by the name of Joel Graff seems to have managed to implement the effect in UDK. Unfortunately, the two videos he's posted (1 and 2) don't give any real details on how he did it, they just explain the effect in real-world terms, and show it off in game.

    I can get close already. If you load up the Math Hall level from the Content Examples, there are two Camera vector examples at the far end of the hall. The second is pretty similar, you just change the colors to black-white instead of red-green, and tweak the size of the effect.

    But the camera pointing at the material is only part of the effect. As mentioned above, the main problem I'm having is figuring out how to get the material to respond only when there's a light source roughly in-line with the camera and material.

    I found a Blender example, which hints at how it might function, but I'm still sorting out how to translate that to UE4 material nodes. Also, I think that the effect shown in that example is not accurate: first, the 45 degree angled sides shouldn't reflect that strongly even in the first example. second, as the light moves off to the side, given that the test object appears to be a convex cube (rather than a concave shape formed of three perpendicular planes, like the rear half of a cube) the effect should be following the light, not moving to the opposite side of the cube.

    It may not even be possible to react to a light source with a basic material in the same way UDK (or Blender) did. This thread from March (specifically Jordan Walker's post) suggests that postprocess materials might be necessary, given UE4's deferred lighting model. Later in the thread, there's some indication that passing vectors around with constantly updating blueprints might work, but that sounds like a performance hit for no good reason if the information can be achieved another way.

    Edit: Upon further research, it sounds like TextureDefinedSpecularShape is what I need to be looking at, at least for implementing it similar to the Blender material above, but I haven't tested this yet. There's a note that the implementation of that function is incomplete, however...

    EditEdit: Feh, it appears to be absent entirely. The first two functions listed on the above page exist, but this one has been replaced by MetallicShading. Maybe FuzzyShading will work instead...

    As far as blacklights go...

    Lets say you have a player standing in a lit room. The player wears black cloth. Then you add a mask texture to the cloth with some stripe patterns and plug those into the emissive channel and tint them in some neon color of your choice. Then you need to make parameters for the emissive color and probably a switch to turn it completely off (I would also recommend to add the stripes pattern with some whitish color to the diffuse, so it looks like he has those white stripes on his cloth that actually react to black light in the dark). Now you need to put the parameters into your playerblueprint, and build a second room to where the player can go. The second room will be almost completely dark. At the door you will place a trigger that tells the player blueprint to start raising the emissive color on the stripes as soon as he enters the dark. You could place some assets in there as well that are already emissive to make it feel more natural.

    This is just a small example, but thats exactly how I would fake that^^
    (Edited this bit...) Using emissive and masks and such is exactly what I had in mind as far as the specific appearance, but you may be right that I was thinking a bit too real world for this one, since I had notions of subclassing the lights to make a UV source or somehow accessing the light vector similar to retroreflectivity. I don't actually need to do that, nor access the real lighting information at all. (Edit: Well, except for pesky shadowing...) Mostly, I think I just need distances to any actor that is standing in for a UV source, and possibly the angle if said source is directional (like a flashlight, so you can taper the effect at the edges of a spotlight-like conical region). This drives how much of the UV appearance to blend in, if any, with emissive determining how it looks under said light. Layered materials can do things like invisible ink or what-have-you.
    Last edited by Aetherdyne; 05-23-2014, 03:18 PM. Reason: Shadows, duh. Also comments on Blender example

    Leave a comment:


  • replied
    Hahaha...man I can totally feel you! However, you are tackeling this from a waaaay too technical perspective (or should I say a real life perspective^^)

    I have good news and bad news for you^^ First of all, game development is all about intelligent faking since computers can only render a certain amount of real worlds complexity. However, some things are still getting possible with new tech.

    So first of all, what you want with the retroreflection sounds very much like a standart sub surface material to me. UE4 supports them out of the box, so there should be no need to fake stuff.

    The blacklight thing however is not possible to represent physically accurate just yet. So what you could do for example is the following:

    Lets say you have a player standing in a lit room. The player wears black cloth. Then you add a mask texture to the cloth with some stripe patterns and plug those into the emissive channel and tint them in some neon color of your choice. Then you need to make parameters for the emissive color and probably a switch to turn it completely off (I would also recommend to add the stripes pattern with some whitish color to the diffuse, so it looks like he has those white stripes on his cloth that actually react to black light in the dark). Now you need to put the parameters into your playerblueprint, and build a second room to where the player can go. The second room will be almost completely dark. At the door you will place a trigger that tells the player blueprint to start raising the emissive color on the stripes as soon as he enters the dark. You could place some assets in there as well that are already emissive to make it feel more natural.

    This is just a small example, but thats exactly how I would fake that^^

    You can also add these effects to teeth of characters etc....so in the end you should be able to fake this very convincing

    Cheers!

    Leave a comment:


  • started a topic Blacklight and Retroreflective effects?

    Blacklight and Retroreflective effects?

    Hello folks,

    I've been trying for some time -- prior to UE4, even -- to sort out how to implement two effects (Ultraviolet reactive and Retroreflective materials) that I hope to use in one of my projects, but I'm having trouble with certain aspects of the problem. Finding solid information on how this has been achieved in other games would give me a better idea how to do it in UE4, but I haven't had a whole lot of luck with that to date. Due mostly to my own limitations with programming, I would greatly prefer to get this stuff working with Blueprint (i.e., without C++ or low-level shader code).

    Retroreflective effects seem the easiest. The definitive examples I can think of are from Left 4 Dead 2: the infected eyes and the uncommon common infected's (construction vest/CEDA hazmat suit stripes, etc) clothing. There aren't many details for that implementation online that I've found ... mostly just a presentation on how the retroreflective portions of the mesh's skin were encoded as textures, and a mention in the developer commentary that the effect was part of the shader with no real details. Neither is especially helpful for actually creating such an effect.

    I have found the Camera vector examples in the Content Examples Math Hall; the camera forward vector example seems like the best basis for the effect. Changing the Lerp node to go between black and white and lowering the exponent a bit gets pretty close to a basic retroreflective material. However this only gets partway there; the material behaves the same way regardless of whether the player is pointing a thousand lumen flashlight straight at the object or whether they are standing next to the material in a completely lightless room.

    That illustrates that for both effects, I'll probably need to figure out how to make it react to a particular type of dynamic light source: phosphorescent materials react to a UV source (blacklight), and retroreflective materials react only when there is a light source roughly in line with the viewer and the material (in front or behind the viewer). So that's part of the problem; I'm not yet sure if this is even possible in Blueprint, much less how to go about it.


    For blacklight effects, I can think of a few examples that give me some ideas. I seem to recall that Condemned had a small UV light you could carry around for evidence gathering purposes. I believe (from seeing videos) that Daylight implements a similar effect in UE4. Psychonauts had Black Velvetopia, which could be easily reproduced by basic emissive materials, except that this effect was constant (materials didn't change from "normal look" to "UV look").

    In the MMO City of Heroes, the Dark Astoria zone's nighttime lighting originally had some of the feel of a blacklight. (Actually, as one of my groups discovered, setting your costume's colors to light blue on dark purple made it look roughly UV reactive at night regardless of zone, but Dark Astoria seemed specially designed to look that way all over the zone.) One can kind of reproduce the look of the zone using textures with light-colored highlights and lighting the entire scene primarily in light blue, but of course that's only a partial effect mimicking the way that certain materials -- like the whitening dyes laundry detergents -- look. It offers no way to control how any given material responds (some white fabrics react while others do not. Small particles and threads on the skin are much more apparent under UV light since the skin itself does not react and is only dimly lit by the purple spill light. Teeth and nails react, while eye sclera do not. Thus, I suspect that this effect may wind up actually being a blend of several different ones, with some means of defining which one dominates.


    Anyway, if anyone has any insight, please feel free to share.
Working...
X