Map textures for custom levels
As the title says, how would one generate map textures for a custom level, in the style of base game's textures? (see screenshot) In addition, how would one use said textures without having to reimplement map fog?
Material_UI_MapFog
has non-parameter references to the four sliced map textures, but we do not have the actual implementation of the material in the starter project.285 Replies
That texture I think is shot from the editor through a very long and painful process, and then post processed in Photoshop by hand
Hmmmmm, fair enough. I've been trying to figure out how to give a map texture some sense of depth; I can get a heightmap, but I don't know how to use it to achieve what I'd like (lower parts are darker, thin lines to show the height gradient, thick lines to show abrupt height changes)
I might need to adjust the settings of these and reconnect the base colour, but this is starting to get somewhere. Yes, there's some pixel artifacts, but I don't want to make the resolution too high yet
harsh-harlequinā¢2mo ago
this was one of my plans once i'm done with my actual map framework
i have some ideas about how to generate the same kind of pictures directly in the editor
at least i exactly know how i would do it on Unity, i'll just need to see if i can process the idea with Unreal
it definitely wasn't made with an image editor soft, it surely used the world heightmap
tho i think i could make a C# tool to generate it from an heightmap now i think about
I asked Pontus how we made this, but okay
harsh-harlequinā¢2mo ago
ah ?
my bad then ^^
It uses height map image as a base, with photoshop post processing
harsh-harlequinā¢2mo ago
what kind of post pro was done on PS ?
no idea, have not asked the specifics. I could poke him I guess if the intention is to try to get a similar looking map
harsh-harlequinā¢2mo ago
an interesting info we could need was the color palette used for it
the image is compressed so trying to find with a color picker it may result a small lack of fidelity
or is that really a palette ?
I think it's using a few base colours with shades on top
harsh-harlequinā¢2mo ago
a gradient ?
base color, top color
More like land colour, water colour, edge detection on heightmap for thick lines, something about remainder of heightmap for the height gradient (contour lines), AO or height data to darken lower areas
harsh-harlequinā¢2mo ago
for the edge detections i though something like
if a neighbor pixel don't have the same height, so consider it's an edge
and color it depending of the height difference
There's algorithms for this, e.g. Sobel
harsh-harlequinā¢2mo ago
sobel is to detect edges, but i never worked with it, does it consider the height difference ?
and will show darker an edge if the height difference is bigger ?
Since I'm doing this at runtime, I used some "Height to Normal" MF and used the Z component of the normalised normal to darken the colours
You detect edges on the heightmap š
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
i already get an interesting gradient
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
hey, look at that :P
*forgot how to do normalization with numbers :grumpy: *
i learned that at college years ago, crap xD
I normalise a vector
harsh-harlequinā¢2mo ago
just found
number/stepsize*stepsize
magic
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
ops, notmalized at wrong place
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
better :D
That's quantization
harsh-harlequinā¢2mo ago
names are boring xD
i'd call everything a normalization
Which is outright confusing
I'd suggest looking at a big ramp in the map to see if it's quantised or if it is handled differently
harsh-harlequinā¢2mo ago
not sure to understand what you mean
if they used the heightmap of the world's terrain it should be quantized to make the steps more easily
It's not quantized
harsh-harlequinā¢2mo ago
there gradient inside of the steps ?
I can't tell
I know there's contour lines, that's something like
heigh % 100
where 100 is the height between contour linesharsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
it's really hard to see
but i think, despite of the compression
there no gradiant in the steps
if you see the middle step, it's same color west to east
Do you find any steps anywhere?
Also for analysis you should grab the textures from the game files, don't base yourself on the screenshots I send for quick reference
harsh-harlequinā¢2mo ago
by stem i mean the space between the lines
i have them don't worry, they are also compressed
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
compressed as hell
Are those 4x4 blocks of pixels?
harsh-harlequinā¢2mo ago
jpeg artefacts yes
If you got the textures as jpeg you're doing something wrong (e.g. not telling FModel to use PNG)
IMHO that's probably DXT1 compression artifacts (DXT1 works on 4x4 blocks of pixels)
harsh-harlequinā¢2mo ago
it's a PNG, i get a .PNG file
Then it's not jpeg artifacts
harsh-harlequinā¢2mo ago
but it may have saved as jpeg someday
let me double check on Fmodel
By whom?
harsh-harlequinā¢2mo ago
devs i guess
but fmodel maybe messed up
I highly doubt the devs would've used .jpg as interchange format
Also this
harsh-harlequinā¢2mo ago
Thats's FModel's export format
harsh-harlequinā¢2mo ago
ye
not wrong tbh x)
fresh from Fmodel
i still see artefacts
i'll remove it soon, it's an asset, not supposed to send it like that
I've implemented a DXT1 / DXT5 decompressor, the scars won't go away anytime soon
harsh-harlequinā¢2mo ago
nice
that's even possible tho ?
?
harsh-harlequinā¢2mo ago
once it's compressed, how can you reverse it ?
It's actually easier to decompress the data, but it's not relevant atm
Looks like there's quantisation: areas between contour lines seem to have just one colour
But it's a lot more subtle than this
Would be good to know the height difference between contour lines
harsh-harlequinā¢2mo ago
ye, the best idea i had to do it is to use the speedomeeter and try to get at the lines in game directly
with a quick hook you can increase the max zoom of the map, that may help if you want to do it
but otherwise i'll do it anyway when done with the code on my side
i just understand now why the postpro was for
at least in my process method, i need post pro to draw the edges
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
well, i got an interesting result xD but not the one i wanted
How did you make this?
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
messing up
for each pixel i compare it's height with the 4 neighbors pixels
if there a height diff i draw a dark pixel
This is what I do right now,
CaptureData
has scene colours in RGB and height in Aharsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
i'm getting close to it
Yeah, though the contour lines aren't as dark
harsh-harlequinā¢2mo ago
yep
hmmm
the lines color are not only based on the height diff
but also on the background color
It's likely an overlay
harsh-harlequinā¢2mo ago
yes
but i can't add layers like that with C#
Notice my "Multiply" node in this thing
harsh-harlequinā¢2mo ago
I challenge you to use Unreal materials for this :wonke:
harsh-harlequinā¢2mo ago
š
I like the material editor, you get pretty much instant feedback
harsh-harlequinā¢2mo ago
it's also an easy way to use GPU to compute things
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
found
this is supposed to be a sudden big plane reaching the sky
and, the line is dark
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
vanilla map ā
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
generated ā
I wonder if there's some sort of smoothing going on
But colour wise it looks good
harsh-harlequinā¢2mo ago
i'd need a better heightmap to see the result
because the heightmap i have is too smooth
i need a heightmap with plates and clifs
Er, I said it wrong
I wonder if there's smoothing in the vanilla heightmap, since the contour lines on yours are more "stressed out"
Or maybe it's just the algo, https://en.wikipedia.org/wiki/Sobel_operator exists
harsh-harlequinā¢2mo ago
in both cases i'll have to implement it in C++ inside of unreal :c
Why so? This is a material
I actually use that material in-game: https://discord.com/channels/555424930502541343/623891487683510323/1301172872760262759
harsh-harlequinā¢2mo ago
you sure i could do everything with a mat ?
I mean... https://discord.com/channels/555424930502541343/623891487683510323/1217952280888873041
You can use HLSL if you want to, but you could also use a bunch of nodes
harsh-harlequinā¢2mo ago
i never learned shaders
HLSL will kill me
xD
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
also added the water edge
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
but compression doesn't help to get the color
anyway, i will go to sleep soon
i drop what i done if ever that help someone
https://github.com/HolographicWings/Satisfactory-Simple-Heightmap2Worldmap
it's as much optimized as my brain, don't blame me
hmmm
wait a second
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
they didn't used only the heightmap
also for water, which can be on clifs and plates, i mean they didn't used a static water level
surely some raycasts
Heightmap without collision with water volumes?
harsh-harlequinā¢2mo ago
there some rocky arcs, which are meshes, not from the terrain
Yeah, most of the cliff faces are meshes too
harsh-harlequinā¢2mo ago
and water are also not a part of the terrain, as they have different heights it's not a "waterlevel" as i did on my tool
so i think it's a raycast, the watervolumes maybe have a specific tag
if the raycast hit water, it draw the pixel as blue
It's probably an orthographic scene capture
harsh-harlequinā¢2mo ago
you think ?
You can get a height out of it
I get a height out of it
harsh-harlequinā¢2mo ago
hmm, maybe indeed
This is based on runtime height data
harsh-harlequinā¢2mo ago
damn, i did everything for nothing xD
Why?
Getting runtime height data is expensive as it requires the level to be loaded
I tried loading the entirety of the level once, it didn't end well (not enough RAM)
harsh-harlequinā¢2mo ago
because i didn't though about meshes and elevated water
What kind of input files are you working with?
harsh-harlequinā¢2mo ago
only heightmap
and waterlevel
Okay, then just capture a heightmap of the level when you're done making it nice
harsh-harlequinā¢2mo ago
for me heightmap is only for terrains, doesn't considering meshes exists
it's possible to capture an heightmap the entire level (even meshes) ?
Yes, I just said it's possible
I do it at runtime using a scene capture component 2D, but it's expensive (so I can't just capture every tick). But it's fine to do in the editor and save the results to a texture
harsh-harlequinā¢2mo ago
the idea would be to take it once anyway
can be done in editor ?
or only runtime ?
Yes, if you have the meshes you use
harsh-harlequinā¢2mo ago
ah you said yes for editor just above
sorry i'm getting tired x)
Go to sleep then š
harsh-harlequinā¢2mo ago
a friend want to show me a game and kidnapped me ;-;
Can't you use the world partition editor that ue5 has to export one?
Not that I remember how you do it, but I remember seeing about it not that long ago
I don't have the persistent level, though š What I do at runtime is for another mod (OrthoMap)
I would still like to know how to make map textures for custom levels, e.g. ExampleLevel
ExampleLevel does not use World Partition, and World Partition does not work out of the box
Ah well then I think you'd want to for example place a single capture per chunk that only cares about persistent meshes and captures a simple depth texture, and then add in the contours at fixed frequencies with biasing so that areas with a high steepness don't get completely useless.
So basically say that for example you make sure there's at least say 15 pixels between every contour line, and you can for example smoothly interpolate the contour line transparency based on the steepness, such that for example if each contour represents a 5 meter elevation, you'd want it to be such that whatever the distance covered by 15 pixels over that height variation was met. You could even pass that function through a square root so it starts making the contour transparent much later, or with a power so it starts rapidly.
And then for the gradient texture you'd probably want to use color lerp-ing between a slightly dark brown color at the lowest elevation to an almost completely desaturated white at the highest elevation, and then you basically make it so that the color is also constant inside a single contour, I.e. quantized, however I think you'd also want to use the same biasing as with the contour to also start interpolating to a linear gradient again when the steepness is very high.
And then the thickness of the contour should be based on the steepness being practically 1, I.e. the height difference is basically an instant jump in elevation.
Second to last for the bathymetry it seems they almost skip contours entirely, they kinda look like they start out with a quantized color lerp between a bright blue at the shallowest depth to a teal color at a specific depth, and then it seems there's a sharpness filter which might be biased by steepness? Might be very wrong there tho. Anyways and then it seems there's an additional repeating noise pattern over the bathymetry.
And for the well void it seems they just outline the edges where a valid height meets a well infinity I suppose with a pure white line of roughly the same thickness as the thickest contour line (Probably done with outlining based on alpha transparency, since the white outline is outside the thick contour lines), and then at the end there's just a distance field with a roughly estimated distance of 88.13 meters, so probably 90 meters, lerp-ing from a gray color to black.
What a wall of text amirit :lmao:
Hmmm, I sort of follow
harsh-harlequinā¢2mo ago
@Rex
harsh-harlequinā¢2mo ago
got the palette on material
and i read there an integrated feature for outlines
i will give up with material
i just hate that
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
what the hell is that ? XD
An if statement
Or in the case of shaders is just a conditional selection
You can't really have branches in shaders, as both paths need to be evaluated anyway. Roughly speaking, GPUs are SIMD (Single Instruction, Multiple Data): they apply the same operation to a lot of different values at the same time.
What would you like to do here? I'm curious
Did you know there are cpus that do single instruction multiple instructions?
As in it encodes multiple actual instructions in a single instruction.
Oh and there are also cpus that do multiple instructions simultaneously (without multiple cores or pipelining).
harsh-harlequinā¢2mo ago
Display a surface in blue if there a transparent surface over it
In short
Apply a second color palette
if there a transparent surface over itWhat is that transparent surface?
harsh-harlequinā¢2mo ago
water, but in short anything that use a transluscent shader
i noticed they are not shown by the post processing material when i get the SceneDepth
Maybe try and get a heightmap of only the water stuff, and then if the water height is above the terrain height it's under water so you choose the water palette?
harsh-harlequinā¢2mo ago
problem is the water isn't recognized in the SceneDepth
it only see opaque things
maybe i could mess up with the pencil settings, but i don't understand them
Perhaps see if there's a way to disable the transparency on the water material?
harsh-harlequinā¢2mo ago
i don't understand
the point is to draw the second palette on the water surfaces, if they are not longer water, i'd don't need to draw them in blue
that would mean the make them opaque for the screenshot, THEN make them transluscent again before to pack the mod
Other than that, you might be able to export the direct heightmap of the water/lake objects, depending on what plugin/system is used I guess
harsh-harlequinā¢2mo ago
i could merge two images yes
but how can i get the deepness of the water ?
waterHeight - terrainHeight
š
harsh-harlequinā¢2mo ago
the blue palette depends of the deepness of the water, so it must hit both, the water and the bottom
If they both start at the same Z value that is
harsh-harlequinā¢2mo ago
i seen the pencil config may be the only way to hit the water
and it will apply for the whole shader
so i can't hit both opaque and transparent, into two distinct results, inside of the same shader
at least i don't see how
You can do a prepass first to get the water height into a texture, and then attach that to the second pass where you go over the terrain height
harsh-harlequinā¢2mo ago
hmm
i vaguely see
when merging two maps, i could get the difference between them
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
me when watching a pixel shader guide
i still don't understand how work an if statement in a shader
i wasn't aware that was even possible to have one xD
is that the multiverse ?
are we in the matrix ?
is that how hell looks ?
am i dead ?
shit, i didn't emptied my history
Say you have the following, what it does is first computes
temp1 = texCoord - 0.5;
then computes temp2 = texCoord + 0.5;
, and finally it does a selection based on the conditions texCoord < 0.5
and texCoord > 0.5
(in this case only one).
In code it would be similar to:
Or with componentwise code:
TLDR: The gpu will execute all paths
harsh-harlequinā¢2mo ago
that only exist in pixel shaders ? or conditions are similar in compute shaders ?
someone adviced me to learn compute shaders instead, i was like "never! prefer to die xD"
is there even a difference between pixel and compute shaders ?
Which technically from nvidia guidelines to do with multi pathed shaders, where both paths are inherently separated, you should disable the cuda cores that don't do work towards the final image. I.e. do an actual "branch"... Reason being if you're gonna waste performance, you might as well save on power consumption
We call this form a conditional move or cmov on x86
Basically it only does an instruction level "branch"
So yes it exists in compute shaders too
And vertex shaders, and geometry shaders and pretty much every other shader
harsh-harlequinā¢2mo ago
oh, i see it clearer, thanks you
i miss my C# ;-;
To a degree yes.
They all work the same, I.e. have the same general set of instructions.
However fragment/pixel shaders are executed for every fragment produced by the rasterizer stage (And yes fragment is the correct term here, because a pixel refers to the output image, fragment refers to a theoretical point within a pixel defined entirely by the rasterizer, reason being MSAA or Multi Sampled Anti Aliasing would run the fragment shader n times within the same pixel and then average the color to produce the final color for the pixel, giving you an anti aliased image, some implementations end up creating an image that's larger rendering to that first and then doing a resolve to downscale which is kinda stupid imo, but hey that's now just super sampled anti aliasing or some shit)
Anyways, the fragment/pixel shaders are given data outputted from the vertex shader, and then they explicitly write to a specific pixel in multiple attachments, I.e. you don't control the write locations, in a compute shader you can have that control entirely.
Might be a little complex but shaders are kinda like that xD
harsh-harlequinā¢2mo ago
aaaaaaaa
are you playing "trying to confuse holo even more" ? xD
:lmao:
Perhaps :>
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
i guess i can use this to draw outlines then ?
if any neighbor pixels aren't in the same color, so i consider is a outline ?
Naah, but regardless, gpus use SIMD processors which means each actual core will run the same instruction on a lot of data at the same time, so because of that there's no way to branch different executions on a single core to different parts of the code, therefor you either overwork the gpu with just bogus data and select the correct data or you disable the executions you don't need and reenable them once you need them again. NVidia refers to this as SIMT (Single Instruction Multiple Threads).
Oh there's actually a handy little instruction on gpus called ddx and ddy, they give you the change in values across multiple executions, generally with a neighboring pixel. So you might be able to use that somehow.
And also they're only available in fragment/pixel shaders
For obvious reasons xD
harsh-harlequinā¢2mo ago
rex mentioned Sobel but i have no idea if this algo can return the height difference between two neighbor pixels
A sobel filter will work and that's essentially what the ddx and ddy functions do.
But also not, because they don't use a sobel filter internally
Notice how it becomes gray here
Mind you the ddx function doesn't know how texcoord actually changes before hand
And here notice how ddy is black whilst ddx is gray. That is because texcoord.x only changes along the x axis, so the rate of change along the y axis is 0
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
i'll never be able to make complex shaders xD
Ok you see this,
fmod(texCoord.x * 16, 1)
When the camera is not directly lined up you get this with ddx of that
So basically ddx and ddy depend on whether the pixels you care about are going through the same execution so that it works, otherwise it wont work...
The sobel filter will work, as you just sample the previous and next pixels and then find the average rate of change across the center pixel with that
harsh-harlequinā¢2mo ago
another problem i get
translucent material still don't show
even with custom stencil or custom height
What did you make them with?
Not the materials, but the objects themselves
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
applied this to two things
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
this dark cube and one cell of the terrain
terrain is opaque, cube is translucent
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
this is the settings of the post pro shader
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
and when i do the render, only the cell shows
Ah so custom objects, ok lemme think a little bit
harsh-harlequinā¢2mo ago
ok just finally found
So it's also invisible in the scene depth visualization?
harsh-harlequinā¢2mo ago
Allow Custom Depth Writes
needs to be on the water
not the post pro
but that's a problem
i doubt the water materials of the vanilla waters uses it
The water shader ue5 has is at least visible in the scene depth
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
so i can isolate the water
neat
You can also enable "output depth and velocity", but spatio-temporal post processing will break xD
But nobody really likes TAA so xD
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
i think i can apply a second rule then
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
give a blue palette
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
get a brown square
harsh-harlequinā¢2mo ago
Lerp
You can use a lerp node to mix 2 things based on a 0 to 1 value
harsh-harlequinā¢2mo ago
that's interesting :O i did it manually
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
but there a lot
LinearInterpolate is the basic one
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
that's magic xD thanks
Technically, that's just math
harsh-harlequinā¢2mo ago
ah uh
Just remember that linearly interpolating colors can give very umm strange results if the colors are very different
harsh-harlequinā¢2mo ago
no, i still get brown
yes, that's the case
i still get brown
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
doign this
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
and get this
You can preview each of the nodes individually
am I smelling subtractive color mixing :>
harsh-harlequinā¢2mo ago
yes, something is < 0 i think also
but the alpha is the height, so between 0 and 1
oh
the first divide i did was too low
i must constently get the scenecapture height
oof
i progressed a lot
bruh and just when i tried to screenshot, UE frozen
The duality of ue xD
:borked:
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
imagine this is water
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
it shows
Water/water, would water again :>
harsh-harlequinā¢2mo ago
oh, broke the palette
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
better
dark water
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
and if i lift it
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
light water
(tho that should be the reverse but that's it)
And if you have it stretch the entire terrain?
Hmmm
harsh-harlequinā¢2mo ago
Looks very shallow...
harsh-harlequinā¢2mo ago
scales need to be enhanced
it's based on 250m
0-1 is 0-250m
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
tho the scaling isn't that bad
You might want to up the amount of color bands, and also go to a much darker blue for very deep, but not really all that deep...
How do you calculate the depth bands?
I would assume a rescale and a floor
harsh-harlequinā¢2mo ago
rn i just try to replace the last color by black
but i get an error
harsh-harlequinā¢2mo ago
I'd like to see the nodes you're using to understand what you're doing
harsh-harlequinā¢2mo ago
it's a mess xD i'd need to clean it before to show it
remember my blueprints
you really want to see it ? xD
Yes, I'm not worried
I've seen very bad blueprints, so nothing gonna scare me at least :>
harsh-harlequinā¢2mo ago
That's not too bad honestly
harsh-harlequinā¢2mo ago
the not used if is supposed to replace the last level of blue by black
BTW, this is equivalent to "Saturate"
harsh-harlequinā¢2mo ago
but it gives an error
Ah so round, same same but different then xD
harsh-harlequinā¢2mo ago
this node isn't even needed, i removed it
I would actually just multiply the "Alpha" going into the lerp with the surface colour to darken it
"Saturate is free on modern graphics hardware" (IIRC that's what the node comment says)
harsh-harlequinā¢2mo ago
i don't get the reason of an error
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
this statement takes this as A :
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
A > B takes the blue palette
a < B takes 0
and it gives error when put into the emissive
but both the blue palette and 0, works when plugged to the emissive
well
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
did this and it fixed
harsh-harlequinā¢2mo ago
You probably have multiple channels from the scene textures
harsh-harlequinā¢2mo ago
so with a scalar i can change the intensity of the deepness
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
well, so, burned my brain enough
so it's pizza time now
also thanks @Marca for explained the weird "if" thingy
Another way to do this without using an if node
harsh-harlequinā¢2mo ago
i'll let optimization for the end
i still need to make the outlines š
pizza gone
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
doing this
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
give me this
it's the good direction but, i tried a lot of things to fix the broken lineouts
As I noted here, ddx and ddy are rather simple functions, so they don't have info on all neighbors.
You can obviously compute the gradient yourself with a sobol filter.
Alternatively you might want to use the full height value to make the contours
harsh-harlequinā¢2mo ago
it's what i use yes
but the lines are too small
they are cutted everywhere
i treid to make them more bold
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
this is the result of mult on the left
also, don't look at the mult 0.1 here, i removed it
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
exemple, the square here is a cube
if i move it slighty, the other edges shows, but that's random
like if the edges was too slim
ah..
i read too fast
i missed the "don't" sorry
so ! i need to finish that mat :x
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
that's horrible xD
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
i can get the heigh difference as outline intensity, but the outline is blurry because of the multisampling i did to fix the slim outline
i'm now sure that vanilla maps didn't used derivatives, the outline is sharp, not antiliased, but also always one pixel
about sobol i still not found how to use it, i even managed to crash UE by using it ._.
Assertion failed: Index >= 0 && Index < CurrentScopeChunks->Num() [File:C:\ar\w\UnrealEngine\UnrealEngine\Engine\Source\Runtime\Engine\Private\Materials\HLSLMaterialTranslator.cpp] [Line: 2995] Index -1/10, Platform=49
when trying to plug a Sobel node in the shader graph š„²
texture sample with default values ā sobel ā emissive color shader's pin
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago
omg i did it !
harsh-harlequinā¢2mo ago
harsh-harlequinā¢2mo ago