#Thread
1 messages · Page 1 of 1 (latest)
I don't think you're going to get correct results by using the tangent space normal map before converting to tangent space
oh, woops. missed that
Using a normal map as the lerp T doesn't really make much sense to me anyway
the texture sampler there isn't really supposed to be a normal map
it's supposed to define the amount of the effect
my goal is that black parts use the default normal and white parts use a normal that always faces the view
presumably with some interpolation in between if necessary
on closer inspection my approach indeed doesn't work quite right
my thinking in changing the tangent normal and not the object normal is that i still want to support a regular normal map on top of my effect
I have no idea how a physically accurate retroreflective material would be presented, or if that's even possible with the non-photonic lighting calculations we have
I was cooking up an example of how I'm doing it but everything crashed so give me a moment
i''ve done this once before with a different approach where the shader targeted a specific vector to be the light's 'direction' and it calculated it's own emission based on that
that would only support one light source at a time though
i wanted to try a more versatile approach this time
Well, you can use a custom function to grab nearby light sources, which is what a lot of toon shaders use for example
Probably even possible to use multi-pass shading to overlay retrorefective shading and the usual lit shading, though that's tricky
yeah, it sounds tricky
I don't know if that'd be the "correct" way to do retroreflectivity either
In reality the eyes and cameras we see them with are still quite different from game camera rendering and exposure
As well as how photons behave
yeah
well i've gone back to the simple approach for now, which affects the whole object
it looks pretty good on this cube, which reflects brightly from the correct angle
these cat eyes also appear to be doing what i told them to do but just aren't very bright regardless 🤔
do you know how i might make them brighter?
perhaps i could boost their total color by some amount
You can, if you use a HDR color with a high intensity or multiply the color above 1 by other means
But that's hacky and can result in very unpredictable brightnesses so I don't recommend that before you get the material looking generally right first
Remember that metallic and smoothness values are important too
oh i think i'm just stupid?
okay yeah i painted them black by mistake LOL
they look much better white.
Blending with a normal map is as simple as this
when you lerp between two normal vectors, what happens? does the result rotate, or does it like go 'across the middle' as it were?
pretend this unit circle is a unit sphere
I'm not sure!
Maybe the result should be normalized to be correct
Doesn't look any different
what does Triplanar node do?
Projects a texture in world/object space
I use it for testing because it works even on meshes with no UV maps
Normal map is of type default instead of normal
ah, i see
i wonder what that actually changes.
i always assumed the value from the texture could go straight in without adjustment
Normal map textures use a different color space and have their color channels swapped about afaik so it's important for how they're sampled
wish i could make the cone of response narrower
This is what smoothness would do
And metallic too, to an extent
Smoother material makes direct reflections more intense, but more focused
is there a way to specify the default color of the sampler when there's no texture asset ?
Yes, if you have a property you can specify a default
This is important for normal maps
mhm
thanks :)
thank you for all your lovely help
if i want to blend the affect in a texture i'd need to essentially...
lerp between the blended normal and the default normal i think
You can't really "blend" normal vectors as such
ah, so it'd be kinda all or nothing?
The average of two vectors will be pointing between the two directions
that doesn't sound good
the effect i want to see seems more like lerping between two possible output colors
It won't look right, but it's an useful effect
I needed retroreflective clothing so I made a hacky solution that lerps between the usual normals and retroreflection by view angle
The effect "bends" rather than blends, but it looks reasonably okay, especially when smoothness is also lerped by angle
i see
In the Lit shader we don't have access to output color really, as the lighting is calculated on just one normal
yeah, i guess it's not really a pixel shader
or a raster shader or however you would call it
i have another question
My understanding is that calculating lighting more than once requires multiple passes, which is what the complex lit shader does with its clearcoat
oh, i see
But that's unfamiliar area to me
this cat eye is painted red but is being totally drowned out by the white of the bright lamp
i've turned off bloom here
the diffuse color is red
Metallic value?
0
a 1 doesn't reflect very easily
irl i'd expect a red thing to only reflect red light and absorb other light
im not sure how to have that happen in pbr, i'm surprised it isn't just like that already tbh
increasing the metallic value seems to only have the effect of reducing the impact of the bright light in a total way
which makes it more red up close but impacts distant reflection negatively
That's the difference between metallic and nonmetallic materials
This of course reduces the total reflected light because they rarely "convert" light energy into their own wavelength
hmm
that isn't going to work here because these aren't true retro reflectors
so they need as much help as they can get
For me it works decently well
here's a comparison of metal 0 vs metal .95
Try these and see if they work
Here's my metallic road paint retroreflectors vs nonmetallic
Is your project on URP?
Ah, I see
If you add a target for HDRP here it might work just like that
Though the scene's post processing or cameras probably would not
In this image there are short red paint strips and long
The short ones cheat with a boosted HDR base color, but the long ones do not
I think both work decently
i tried by using the specular color workflow instead of metallic
it goes to white, curiously
Specular workflow determines specular color from specular color, rather than from metallicness + albedo
that's right
but i set my specular color to be red, and yet it goes to white in the distance skjhbs
oh i fixed the distant but it still doesn't have the effect i was hoping for
What seemed to cause the distance color problem?
i changed 'energy conserving specular' setting
can i make the total color HDR? how would i do that?
i want to cheat the same way yours are
That would work with Boost values above 1
it doesn't appear to 😅
Unless HDRP clamps it somehow
Energy conservation is what we would specifically not want in this situation
If you want a pure red, green or blue glow the color would need to be a pure shade of those colors
Increasing intensity in HDR color space will boost cyan, magenta and yellow tones more, ultimately towards white
Tonemapping often will further dull monochromatic RGB brightness
i think im stuck, then
it'll go into HDR ranges either from the boost or from a high power reflection but in both cases will trend to white ;-;
I'm not familiar enough with HDRP to give more precise advice
i appreciate the help though!
You're a lot closer to the goal than originally though ^^
yeah :)
i got a nice effect at distance
i just wish i could get the total color after all of this, and multiply that
Looks really good already!
:)
im not sure if want i want to do next is supported.
cos all this stuff is like, affecting the normal and the albedo and stuff.
but next i want to get like the final result of the render and multiply that.
like that isn't a property of the pbr material but like, a raster technique
pbr expects me to use emissive color to do this sort of thing but that's not really what i want
if part of the surface got put in shadow it should stay black
It may be possible but definitely not supported, especially with how HDRP does things
If you can find a way to multiply the base color unclamped, that would be well enough as it'd boost reflections which is the important thing here
the issue i'm observing with boost is that it looks like HDRP is definitely clamping the base and i don't know how to get it to stop
and this means that after it's multiplied, exactly 1 unit of the sum total comes from the bright reflection and the all other 9999 units are the ambient color
this is kind of annoying tbh
tbh i don't really understand "HDR" color in contrast with non-hdr color and i've kind of never understood it
i don't get the difference, i don't really know why people make it out like there's a difference
to me it just seems that a color is hdr if you decide not to arbitrarily clamp your maximum value to 1, and that's it.
what i want to do is perfectly possible in mathematics and computer graphics but someone at unity arbitrarily decided that this node should clamp and now i'm stuck
Basically so
Colors usually are 0 to 1 in each channel, as most programs, standards and formats support just that
HDR color is that multiplied by intensity float
Nothing fancier
I assume it was clamped because HDRP aims for graphical realism and physical accuracy above all else, and albedo values above 1 break that physical accuracy
they do, yes
in theory if i do this i can make the cat eye reflect more light than actually entered it
but for my purposes, this is exactly what i want, and im tbh pretty annoyed that i'm not allowed to do it
It is frustrating!
But it's a bit of a theme
Like 90% of all rules we work with in these programs are arbitrary, often intended to help someone at the unintended effect of making something else harder
There's some hope that upcoming block shaders will give us control over individual parts of the existing Lit shaders
@mint owl Do you happen to know if there's a way to use "above 1" Base Color in HDRP, or some other way to boost reflected light above its normal intensity in the Lit shader, since it seems to be clamped to 1 for physical accuracy
(or if that variable could be unclamped in the future)
A workaround that comes to my mind could be to render the material twice, using a custom pass or the like, another time with an identical shader that's additively transparent
But that seems like a very roundabout way
my ultimate goal is to make these more visible at a distance and / or more intense in their albedo color
No way to have the base color > 1, like you've said, it's clamped.
I think that the only way to do retro-reflection is to use a custom lighting, which HDRP doesn't support :/
Thanks 
Retroreflection works fine on its own, but being able to boost it is useful extra
"Ugly" solution : re-render the objects with transparent shader, read from the color buffer and output the same value multiplied by constant