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.
No description
285 Replies
Archengius
Archengiusā€¢2mo ago
That texture I think is shot from the editor through a very long and painful process, and then post processed in Photoshop by hand
Rex
RexOPā€¢2mo ago
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)
Rex
RexOPā€¢2mo ago
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
No description
harsh-harlequin
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
Archengius
Archengiusā€¢2mo ago
I asked Pontus how we made this, but okay
harsh-harlequin
harsh-harlequinā€¢2mo ago
ah ? my bad then ^^
Archengius
Archengiusā€¢2mo ago
It uses height map image as a base, with photoshop post processing
harsh-harlequin
harsh-harlequinā€¢2mo ago
what kind of post pro was done on PS ?
Archengius
Archengiusā€¢2mo ago
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
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 ?
Rex
RexOPā€¢2mo ago
I think it's using a few base colours with shades on top
harsh-harlequin
harsh-harlequinā€¢2mo ago
a gradient ? base color, top color
Rex
RexOPā€¢2mo ago
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
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
Rex
RexOPā€¢2mo ago
There's algorithms for this, e.g. Sobel
harsh-harlequin
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 ?
Rex
RexOPā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
No description
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
i already get an interesting gradient
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
No description
harsh-harlequin
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
Rex
RexOPā€¢2mo ago
I normalise a vector
harsh-harlequin
harsh-harlequinā€¢2mo ago
just found number/stepsize*stepsize magic
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
ops, notmalized at wrong place
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
better :D
Rex
RexOPā€¢2mo ago
That's quantization
harsh-harlequin
harsh-harlequinā€¢2mo ago
names are boring xD i'd call everything a normalization
Rex
RexOPā€¢2mo ago
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
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
Rex
RexOPā€¢2mo ago
No description
Rex
RexOPā€¢2mo ago
It's not quantized
harsh-harlequin
harsh-harlequinā€¢2mo ago
there gradient inside of the steps ?
Rex
RexOPā€¢2mo ago
I can't tell I know there's contour lines, that's something like heigh % 100 where 100 is the height between contour lines
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
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
Rex
RexOPā€¢2mo ago
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
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
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
compressed as hell
Rex
RexOPā€¢2mo ago
Are those 4x4 blocks of pixels?
harsh-harlequin
harsh-harlequinā€¢2mo ago
jpeg artefacts yes
Rex
RexOPā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
it's a PNG, i get a .PNG file
Rex
RexOPā€¢2mo ago
Then it's not jpeg artifacts
harsh-harlequin
harsh-harlequinā€¢2mo ago
but it may have saved as jpeg someday let me double check on Fmodel
Rex
RexOPā€¢2mo ago
By whom?
harsh-harlequin
harsh-harlequinā€¢2mo ago
devs i guess but fmodel maybe messed up
Rex
RexOPā€¢2mo ago
I highly doubt the devs would've used .jpg as interchange format Also this
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
Rex
RexOPā€¢2mo ago
Thats's FModel's export format
harsh-harlequin
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
Rex
RexOPā€¢2mo ago
I've implemented a DXT1 / DXT5 decompressor, the scars won't go away anytime soon
harsh-harlequin
harsh-harlequinā€¢2mo ago
nice that's even possible tho ?
Rex
RexOPā€¢2mo ago
?
harsh-harlequin
harsh-harlequinā€¢2mo ago
once it's compressed, how can you reverse it ?
Rex
RexOPā€¢2mo ago
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
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
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
well, i got an interesting result xD but not the one i wanted
Rex
RexOPā€¢2mo ago
How did you make this?
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
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
Rex
RexOPā€¢2mo ago
This is what I do right now, CaptureData has scene colours in RGB and height in A
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
i'm getting close to it
Rex
RexOPā€¢2mo ago
Yeah, though the contour lines aren't as dark
harsh-harlequin
harsh-harlequinā€¢2mo ago
yep hmmm the lines color are not only based on the height diff but also on the background color
Rex
RexOPā€¢2mo ago
It's likely an overlay
harsh-harlequin
harsh-harlequinā€¢2mo ago
yes but i can't add layers like that with C#
Rex
RexOPā€¢2mo ago
Notice my "Multiply" node in this thing
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
Rex
RexOPā€¢2mo ago
I challenge you to use Unreal materials for this :wonke:
harsh-harlequin
harsh-harlequinā€¢2mo ago
šŸ’€
Rex
RexOPā€¢2mo ago
I like the material editor, you get pretty much instant feedback
harsh-harlequin
harsh-harlequinā€¢2mo ago
it's also an easy way to use GPU to compute things
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
found this is supposed to be a sudden big plane reaching the sky and, the line is dark
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
vanilla map ā†‘
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
generated ā†‘
Rex
RexOPā€¢2mo ago
I wonder if there's some sort of smoothing going on But colour wise it looks good
harsh-harlequin
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
Rex
RexOPā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
in both cases i'll have to implement it in C++ inside of unreal :c
Rex
RexOPā€¢2mo ago
Why so? This is a material I actually use that material in-game: https://discord.com/channels/555424930502541343/623891487683510323/1301172872760262759
harsh-harlequin
harsh-harlequinā€¢2mo ago
you sure i could do everything with a mat ?
Rex
RexOPā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
i never learned shaders HLSL will kill me xD
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
also added the water edge
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
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
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
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
Rex
RexOPā€¢2mo ago
Heightmap without collision with water volumes?
harsh-harlequin
harsh-harlequinā€¢2mo ago
there some rocky arcs, which are meshes, not from the terrain
Rex
RexOPā€¢2mo ago
Yeah, most of the cliff faces are meshes too
harsh-harlequin
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
Rex
RexOPā€¢2mo ago
It's probably an orthographic scene capture
harsh-harlequin
harsh-harlequinā€¢2mo ago
you think ?
Rex
RexOPā€¢2mo ago
You can get a height out of it I get a height out of it
harsh-harlequin
harsh-harlequinā€¢2mo ago
hmm, maybe indeed
Rex
RexOPā€¢2mo ago
This is based on runtime height data
harsh-harlequin
harsh-harlequinā€¢2mo ago
damn, i did everything for nothing xD
Rex
RexOPā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
because i didn't though about meshes and elevated water
Rex
RexOPā€¢2mo ago
What kind of input files are you working with?
harsh-harlequin
harsh-harlequinā€¢2mo ago
only heightmap and waterlevel
Rex
RexOPā€¢2mo ago
Okay, then just capture a heightmap of the level when you're done making it nice
harsh-harlequin
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) ?
Rex
RexOPā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
the idea would be to take it once anyway can be done in editor ? or only runtime ?
Rex
RexOPā€¢2mo ago
Yes, if you have the meshes you use
harsh-harlequin
harsh-harlequinā€¢2mo ago
ah you said yes for editor just above sorry i'm getting tired x)
Rex
RexOPā€¢2mo ago
Go to sleep then šŸ™‚
harsh-harlequin
harsh-harlequinā€¢2mo ago
a friend want to show me a game and kidnapped me ;-;
Marca
Marcaā€¢2mo ago
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
Rex
RexOPā€¢2mo 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
Marca
Marcaā€¢2mo ago
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:
Rex
RexOPā€¢2mo ago
Hmmm, I sort of follow
harsh-harlequin
harsh-harlequinā€¢2mo ago
@Rex
No description
harsh-harlequin
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
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
what the hell is that ? XD
Marca
Marcaā€¢2mo ago
An if statement Or in the case of shaders is just a conditional selection
Rex
RexOPā€¢2mo ago
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
Marca
Marcaā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
Display a surface in blue if there a transparent surface over it In short Apply a second color palette
Rex
RexOPā€¢2mo ago
if there a transparent surface over it
What is that transparent surface?
harsh-harlequin
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
Marca
Marcaā€¢2mo ago
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
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
Marca
Marcaā€¢2mo ago
Perhaps see if there's a way to disable the transparency on the water material?
harsh-harlequin
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
Marca
Marcaā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
i could merge two images yes but how can i get the deepness of the water ?
Marca
Marcaā€¢2mo ago
waterHeight - terrainHeight šŸ˜‰
harsh-harlequin
harsh-harlequinā€¢2mo ago
the blue palette depends of the deepness of the water, so it must hit both, the water and the bottom
Marca
Marcaā€¢2mo ago
If they both start at the same Z value that is
harsh-harlequin
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
Marca
Marcaā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
hmm i vaguely see when merging two maps, i could get the difference between them
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
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
Marca
Marcaā€¢2mo ago
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:
vec2 temp1 = texCoord - 0.5;
vec2 temp2 = texCoord + 0.5;
bvec2 c1 = texCoord < 0.5;
vec2 value = c1 ? temp2 : temp1;
vec2 temp1 = texCoord - 0.5;
vec2 temp2 = texCoord + 0.5;
bvec2 c1 = texCoord < 0.5;
vec2 value = c1 ? temp2 : temp1;
Or with componentwise code:
float temp1x = texCoord.x - 0.5;
float temp1y = texCoord.y - 0.5;
float temp2x = texCoord.x + 0.5;
float temp2y = texCoord.y + 0.5;
bool c1x = texCoord.x < 0.5;
bool c1y = texCoord.y < 0.5;
float valuex = c1x ? temp2x : temp1x;
float valuey = c1y ? temp2y : temp1y;
float temp1x = texCoord.x - 0.5;
float temp1y = texCoord.y - 0.5;
float temp2x = texCoord.x + 0.5;
float temp2y = texCoord.y + 0.5;
bool c1x = texCoord.x < 0.5;
bool c1y = texCoord.y < 0.5;
float valuex = c1x ? temp2x : temp1x;
float valuey = c1y ? temp2y : temp1y;
No description
Marca
Marcaā€¢2mo ago
TLDR: The gpu will execute all paths
harsh-harlequin
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 ?
Marca
Marcaā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
oh, i see it clearer, thanks you i miss my C# ;-;
Marca
Marcaā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
aaaaaaaa are you playing "trying to confuse holo even more" ? xD
Marca
Marcaā€¢2mo ago
:lmao: Perhaps :>
harsh-harlequin
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 ?
Marca
Marcaā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
rex mentioned Sobel but i have no idea if this algo can return the height difference between two neighbor pixels
Marca
Marcaā€¢2mo ago
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
Marca
Marcaā€¢2mo ago
Notice how it becomes gray here
No description
No description
Marca
Marcaā€¢2mo ago
Mind you the ddx function doesn't know how texcoord actually changes before hand
Marca
Marcaā€¢2mo ago
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
No description
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
i'll never be able to make complex shaders xD
Marca
Marcaā€¢2mo ago
Ok you see this, fmod(texCoord.x * 16, 1)
No description
Marca
Marcaā€¢2mo ago
When the camera is not directly lined up you get this with ddx of that
No description
Marca
Marcaā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
another problem i get translucent material still don't show even with custom stencil or custom height
Marca
Marcaā€¢2mo ago
What did you make them with? Not the materials, but the objects themselves
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
applied this to two things
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
this dark cube and one cell of the terrain terrain is opaque, cube is translucent
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
this is the settings of the post pro shader
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
and when i do the render, only the cell shows
Marca
Marcaā€¢2mo ago
Ah so custom objects, ok lemme think a little bit
harsh-harlequin
harsh-harlequinā€¢2mo ago
ok just finally found
Marca
Marcaā€¢2mo ago
So it's also invisible in the scene depth visualization?
harsh-harlequin
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
Marca
Marcaā€¢2mo ago
The water shader ue5 has is at least visible in the scene depth
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
so i can isolate the water neat
Marca
Marcaā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
i think i can apply a second rule then
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
give a blue palette
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
get a brown square
Rex
RexOPā€¢2mo ago
Lerp You can use a lerp node to mix 2 things based on a 0 to 1 value
harsh-harlequin
harsh-harlequinā€¢2mo ago
that's interesting :O i did it manually
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
but there a lot
Rex
RexOPā€¢2mo ago
LinearInterpolate is the basic one
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
that's magic xD thanks
Rex
RexOPā€¢2mo ago
Technically, that's just math
harsh-harlequin
harsh-harlequinā€¢2mo ago
ah uh
Marca
Marcaā€¢2mo ago
Just remember that linearly interpolating colors can give very umm strange results if the colors are very different
harsh-harlequin
harsh-harlequinā€¢2mo ago
no, i still get brown yes, that's the case i still get brown
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
doign this
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
and get this
Rex
RexOPā€¢2mo ago
You can preview each of the nodes individually
Marca
Marcaā€¢2mo ago
am I smelling subtractive color mixing :>
harsh-harlequin
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
Marca
Marcaā€¢2mo ago
The duality of ue xD
Rex
RexOPā€¢2mo ago
:borked:
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
imagine this is water
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
it shows
Marca
Marcaā€¢2mo ago
Water/water, would water again :>
harsh-harlequin
harsh-harlequinā€¢2mo ago
oh, broke the palette
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
better dark water
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
and if i lift it
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
light water (tho that should be the reverse but that's it)
Marca
Marcaā€¢2mo ago
And if you have it stretch the entire terrain?
Rex
RexOPā€¢2mo ago
Hmmm
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
Marca
Marcaā€¢2mo ago
Looks very shallow...
harsh-harlequin
harsh-harlequinā€¢2mo ago
scales need to be enhanced it's based on 250m 0-1 is 0-250m
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
tho the scaling isn't that bad
Marca
Marcaā€¢2mo ago
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...
Rex
RexOPā€¢2mo ago
How do you calculate the depth bands?
Marca
Marcaā€¢2mo ago
I would assume a rescale and a floor
harsh-harlequin
harsh-harlequinā€¢2mo ago
rn i just try to replace the last color by black but i get an error
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
Rex
RexOPā€¢2mo ago
I'd like to see the nodes you're using to understand what you're doing
harsh-harlequin
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
Rex
RexOPā€¢2mo ago
Yes, I'm not worried
Marca
Marcaā€¢2mo ago
I've seen very bad blueprints, so nothing gonna scare me at least :>
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
Rex
RexOPā€¢2mo ago
That's not too bad honestly
harsh-harlequin
harsh-harlequinā€¢2mo ago
the not used if is supposed to replace the last level of blue by black
Rex
RexOPā€¢2mo ago
BTW, this is equivalent to "Saturate"
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
but it gives an error
Marca
Marcaā€¢2mo ago
Ah so round, same same but different then xD
harsh-harlequin
harsh-harlequinā€¢2mo ago
this node isn't even needed, i removed it
Rex
RexOPā€¢2mo ago
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
harsh-harlequinā€¢2mo ago
i don't get the reason of an error
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
this statement takes this as A :
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
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
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
did this and it fixed
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
Rex
RexOPā€¢2mo ago
You probably have multiple channels from the scene textures
harsh-harlequin
harsh-harlequinā€¢2mo ago
so with a scalar i can change the intensity of the deepness
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
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
Rex
RexOPā€¢2mo ago
Another way to do this without using an if node
No description
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
i'll let optimization for the end i still need to make the outlines šŸ’€ pizza gone
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
doing this
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
give me this it's the good direction but, i tried a lot of things to fix the broken lineouts
Marca
Marcaā€¢2mo ago
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
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
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
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
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
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
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
that's horrible xD
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
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
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
omg i did it !
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
harsh-harlequin
harsh-harlequinā€¢2mo ago
No description
Want results from more Discord servers?
Add your server