#Andromeda - Terrain/Landscape editor using Vulkan and Rust
1 messages Β· Page 4 of 1
liquidgas was its name
hmm maybe i should dig it out from some old backup cds π
it looked quite neat
would love some screenshots of what young deccer was up to :)
: )
But as long as im standing still its perfectly centered
i mean redude the amound of triangles
ah wait nvm I put something there lol
Oh yeah I can do dynamic lod based on the size of each patch on screen
you clicked
eventually
it runs fine for now but yeah ill definitely need lods
okay so the position is fine
then either my komput logic is wrong or computing the uv from the position is wrong
chunking will work wonderfully to reduce lag once you implement it
in this case probably a quadtree would work best
ill look into them for sure
With octree
They are op when you manage to fix seams which is super easy for 2d planes
ok there now it doesnt do that weird half circle thing anymore
i have a crate to comvert data octrees into meshes lol
sucks balls tho
but you could look into dual marching cubes
the results are pretty good
much better than marching cubes
yeah i have a lot of techniques to still look into
ahhhh
my uv calculation was indeed wrong
the mesh itself has as max uvs 0.98 ish or so because of a bug
but the uv calc from the pos assumed 1 was the max value
bug accumulation
for the longest time that just meant a tiny part of the heightmap was cut off so it was barely noticable 
@young oar i like your terrains more π

hihi
Heheheha
Tbf it doesn't have editing or anything cool like that
Just procedurally generated
next step for editing is holding the mouse down to brush instead of clicking once I guess
why did it happen? something something x/N vs x/(N-1)?
Exactly that
meheheh
It'll look a lot better once I regenerate normals

I dont think those normals are right
actually maybe it is and the brush just isnt smooth at all
ill have to experiment a bit with the weight function I guess
This is some interesting behaviour
I think I'll have to apply some sort of smoothing after each edit or something
UI looks rlly good tho
egui is nice
There we go
return 1; at the start of my weight function was not helping the smoothness
i found a really cool crate
#[enum_dispatch]
#[derive(Debug, Copy, Clone)]
pub enum Brush {
SmoothHeight,
}
#[enum_dispatch(Brush)]
trait ApplyBrush {
fn apply(&self, bus: &EventBus<DI>, position: Vec3, settings: &BrushSettings) -> Result<()>;
}
struct SmoothHeight {
// brush-specific settings
}
impl ApplyBrush for SmoothHeight {
// ...
}
fn use_brush(brush: Brush) {
// generated code automatically dispatches to the correct impl
brush.apply(...);
}
It should be something that is built in
but tbh i'd just use dyn
meh
i was like this before, trying to avoid dyn whenever possible
but like who cares the perf cost is minimal
and it is definitely cleaner
I mean I use it at times but I dont want to create a new boxed brush object on every stroke
why the hell you creatin a brush on every stroke
yes i know
but why don't you just store it
or actually you do store it, why do you need to create it on every stroke
I keep it around in the gui yeah
then?
idk I feel like with a trait object creating the gui for each type of brush is going to be annoying
bc either I add it to the ApplyBrush trait which is not great
But with this I can just create a new trait, enum_derive it and keep it entire inside the gui crate
what is gonna be annoying with enum dispatch tho is that every time you want to create, rename, etc a brush, you also need to change Brush
the decal seems a bit big compared to the actual size of the brush 
Maybe my distribution falls off too quickly
can't you also display the distribution on the decal?
i thought it wasn't a decal but just a vertex shader whose input was the mouse uv pos
I was thinking of just using a hardcoded texture but that'd be cool
tbh that might work even better
what im doing rn is kind of a hack in the terrain fragment shader
I just check the distance to the mouse 
ye, also supports all kinds of brushes even ones that might be temporally dependant or change with parameters, just need a shader for each
Yeah
ye so do that but in the vertex shader and have the distribution fn in there
yeah
yeah
right, the problem with a wider distribution is that you get ugly seams
I can just shrink the decal a bit I suppose
or add the blur pass again
hi
I am quite intrigued by the terrain generation you have going on there

Do you plan to extend this generation to infinity and beyond?
That's definitely on the list yeah
im not doing any generation rn
Just editing a heightmap
Good, I could use your stuff as a reference for my Snowβ’οΈ thingy
whats that
It's basically Steep except it's mine.
its just loaded in from a heightmap asset i found
ah, the mesh
its a highly subdivided plane, the vertical deform happens on the fly when rendering
using tessellation to generate the subdivided mesh
I see, do you plan to use Mesh Shaders instead of Tess?
They're just a compute shader on steroids 
Right now this already performs very well, 2ms total frametime with no LODing
A compute shader that can write to gl_Positiongl_MeshPrimitivesNV
im definitely not bound by vertex throughput at least
Yeah I don't really care about performance, I just like using the new stuff
totally fair lol
wow my rendering code is a dumpsterfire
i have to clean that up some day
time to take a massive detour to implement decal rendering
at least itll be reusable for other things later
This whole terrain brush adventure is definitely a good subject for a second blog post
Relatable as hell, I started cleaning my code lately
Now I have an ubershader
not sure if that counts as a win or not 
I mean atleast I only have a single backend for almost everything except depthwrite
But yeah the tradeoff is messy code on That file
thats good at least yeah
finally you see it XD
Where's your project post btw
My follow list isn't big enough
im generally happy with my codebase, just not the rendering backend 
im just talking out of my ass

I wish I can but that would just mean advertising a game
Rendering backends tend to be messy, and I've seen some horrors
So ur fine haha
Custom Source engine not unlike bms, respawn
im sure people are interested
I am
I need to understand how other engines work to make my game
Atmospheric Scattering? I don't have the motivation for that π¦
but it looks great
decals β’οΈ 
terrain editing and everything related yes
it would be cool if you added erosion
thats absolutely planned
Video from Eurographics 2019 research/technical paper "Procedural Tectonic Planets"
Authors:
Yann Cortial (1), Adrien Peytavie (1), Eric Galin (1) and Eric GuΓ©rin (1)
(1) UniversitΓ© de Lyon, LIRIS, CNRS, UMR5205, France
Abstract :
We present a procedural method for authoring synthetic tectonic planets. Instead of relying on computationally ...
Afaik from a very quick read
it looks like they're creating a bunch of points on a sphere and then using a bunch of math equations to describe what happens to them when they overlap with each other
Right
Oh here's the paper: https://hal.archives-ouvertes.fr/hal-02136820/file/2019-Procedural-Tectonic-Planets.pdf if you're interested

nice xray
Yep
hmm that barrier looks okay to me
why is it not happy
SYNC-HAZARD-WRITE-AFTER-READ(ERROR / SPEC): msgNum: 929810911 - Validation Error: [ SYNC-HAZARD-WRITE-AFTER-READ ] Object 0: handle = 0x17e0579e890, type = VK_OBJECT_TYPE_QUEUE; | MessageID = 0x376bc9df | vkQueueSubmit2: Hazard WRITE_AFTER_READ for entry 0, VkCommandBuffer 0x17e2f09a050[], Recorded access info (recorded_usage: SYNC_IMAGE_LAYOUT_TRANSITION, command: vkCmdPipelineBarrier2, seq_no: 3, reset_no: 1). Access info (prior_usage: SYNC_COMPUTE_SHADER_SHADER_SAMPLED_READ, read_barriers: VkPipelineStageFlags2KHR(0), queue: VkQueue 0x17e0579e890[], submit: 476, batch: 0, batch_tag: 9416, command: vkCmdDispatch, seq_no: 14, command_buffer: VkCommandBuffer 0x17e29576430[], reset_no: 1).
Objects: 1
[0] 0x17e0579e890, type: 4, name: NUL
ahhhh
I see
the initial start of frame barrier doesnt take the fragment stage too
another day, another bugfix in the rendergraph I guess
ffs not this again
no syncval output 
only happens when I get too close to the decal
time for a driver update
though i see nothing about an issue like this in the update notes
Proper brush decal 
neato
i like this visualisation
how did you do that
the DAG crate I use to back my rendergraph can output dot files
@livid geode I added the weight shader to the decal as you suggested
float4 main(PS_INPUT input, float4 frag_pos : SV_Position) : SV_TARGET {
float2 uv = decal_uv(frag_pos);
float2 centered_uv = uv * 2.0 - 1.0;
// Discard everything outside the brush area
float distance = length(centered_uv);
if (distance >= 1.0) {
return float4(0.0, 0.0, 0.0, 0.0);
}
// We will use our weight function to color the decal
float weight = weight_function(distance);
return float4(1.0, 0.0, 0.0, 1.0) * weight;
}
very shrimple to extend if needed
yoooooooo
i thought that by decal you meant texture
doesn't decal mean that?
like projected texture
Yeah generally
But here the texture is just implicitly defined in the shader logic
I can add a texture too
wait what is this applying to?
this returns a color from black to red right
where are you doing the shading and whatnot
i have an include at the top that does all the decal logic
you get the uv with float2 uv = decal_uv(frag_pos);
Then you define what the decal looks like in function of that
Could be a texture, or in this case a circle shape that fades with the brush weight function
looking forward to the "erode" brush
I think that would probably be a button/tool, since idk if it makes sense to erode parts of the terrain instead of the whole thing
looks smoof when you watch it in fullscreen
fair
but perhaps you want to draw river beds somehow
Maybe you first outline the general shape and then apply postprocessing on it when you release the brush? not sure
possible yeah
so this is not being applied directly to the terrain mesh?
it's something you project on top?
wdym the heightmap
hehe export displacement maps for 4 verticle quads
The terrain mesh is a flat plane
(after tessellation, yeah)
The brush just prepends commands to the frame's rendering commands to write to the heightmap in a compute shader
i'm talking about the red dot you put on top bruv
ahh
that wasnt really obvious π
yeah i project it onto the terrain
so its a high resolution quad you project on top?
its a cube
its a what

https://mtnphil.wordpress.com/2014/05/24/decals-deferred-rendering/ this explains it better than i can
its pretty short
(the relevant part at least)
im not doing deferred rendering but for this I dont need a full g buffer, just depth info
that is pretty cool, thanks

Sole reason I don't want to is because it makes materials a bit of a pain to write
I want ssr 
deferred was cool 15 years ago
Is it not anymore??
i have no idea what any of these mean π
Still doesn't allow you to do SSR tho right?
with forward+ you split your screen into tiles and determine what lights affect what tiles in a culling pass
I always thought only deferred allow you to do screen space stuff like that
(That are based on metallic/smoothness values)
you still have some sort of mini gbuffer with forward, dont you?
depth prepass is not uncommon ye
are these ways to handle lighting? because if so i dont understand how nanite fits in that category
nanite is entirely different
that may not have been very accurate of me
that was not very cash money of you
I added a reverse mode to decrease height
Oh dang really
I though the normal map was higher res
But eh at least you have a normal map
having icons in my source is so cursed
Spent all day on this :P
its 10pm here now
im now fiddling with egui to make a good looking toolbar
let πΏ = ctx.sfx.play("vine_boom.ogg")

does that look centered
it does right
nvm thats not centered at all
maybe i should just use SelectableLabel but meh
egui is such a joy to use and look at compared to imgui
That's true
It's easy enough to style though
And way easier to navigate/customize imo
Yeah definitely
Creating custom widgets is super simple
idk if I have to look at imgui source code to see how a widget is implemented and how I can adapt it I can dig through a 3000 line cpp file
with egui its not too hard to figure out
I havent fiddled with that too much tbh
i recently fell in love with saleae's logic software
and frankly it doesn't look too off from egui
doesn't look too hard to replicate
Is it made using egui or
nah its electron
ah
Ive seen some really cool things in the egui server from people with amazing customization
or on the showcase thread on the repo
yeah
ill definitely do some work to make this not look like default egui eventually
that looks really nice
i wish it was easier to setup animations within egui
Is it not?
The custom toggle widget demo has a little animation thingy
But i havent tried much
// Let's ask for a simple animation from egui.
// egui keeps track of changes in the boolean associated with the id and
// returns an animated value in the 0-1 range for how much "on" we are.
let how_on = ui.ctx().animate_bool(response.id, *on);
i dont think so
oh it does have animation utils? huh
Yeah, maybe not a lot but simple ones I think so
At least you dont need to keep track of the animation progress yourself
ye, that's p cool
writing a new post about the brush implementation
lets fucking goooooooooooooooooooooo
can you try this heightmap?
sure
found that while looking for some siht
its pretty cool
takes ages to load though
I adjusted the scale a bit
I can play a bit more with the settings hang on
i did some brushing too
weee
here have some mountains
hehe i expected a little bigger mountain"ridges" somehow
I might need more patches
comparfed to the rest of the terrain but it looks neat
if elevation was boosted a little it would probably make a super cool map for some canyon racer thingy
its pretty easy to scale elevation
but this was what it looked like on default settings
this might be reasonable
yeah
the shading still looks quite bad imo
it feels like something is missing or cutting out inforation
the heightmap looks continuous
no spikes
i might be losing too much precision converting to fp16
but in the last pic you can see some artifacts unless im just blind and moiree is fucking with my eyes π
though according to renderdoc its just 8 bit anyway so maybe not
yeh then theh question is
why is the height data loaded as SRGB π
oh you mean for albedo
no
idk why renderdoc loads it like that actually
i load as 16-bit uint grayscale i think
its possible that the png has colorprofile information
then convert to f16 and normalize
16 bit yeh
fn from_dynamic_image(img: DynamicImage) -> ImageBuffer<Self::Pixel> {
let img = img.into_luma16();
let raw = img.into_raw();
let as_fp = raw
.into_par_iter()
.map(|px| f16::from_f32(px as f32))
.collect::<Vec<_>>();
ImageBuffer::from_raw(as_fp)
}
hm I cant imagine that im losing precision if I go u16 -> f32 -> f16 tbh
so just use f32?
pub type HeightmapFormat = Grayscale<f32>; I should only need to swap this out if I wrote this properly :)
and remove the map i guess after iter
thats implemented in the Grayscale<T> impl for TextureFormat
yeah perhaps i found the deccer_heightmap which breaks your terrain engine XD

// Normalizes height values in the height map to [-1, 1] based on the most extreme value
fn normalize_height(_width: u32, _height: u32, data: &mut [LumaPixel<f16>]) -> Result<()> {
trace!("Normalizing heightmap data");
// Find the largest absolute value in the dataset, and take the absolute value of it.
let extreme_val = data
.par_iter()
.max_by(|lhs, rhs| lhs.to_f32().abs().total_cmp(&rhs.to_f32().abs()))
.unwrap();
let extreme_val = f16::from_f32(extreme_val.to_f32().abs());
let extreme_val_inverse = f16::ONE / extreme_val;
// Now divide every height value by this extreme value
data.par_iter_mut().for_each(|value| {
**value *= extreme_val_inverse;
});
Ok(())
}
Maybe I shouldnt do this at all
ye i think everything should be raw
and then you compose it with all your other layers
rust bug π

The problem is I dont think the brush works very well with non-normalized heights
Also most f16 precision is in [0, 1]
i will investigate
precision errors when dividing most likely?
f16 has shit precision, perhaps you should do computation in f32 and then convert
why are the normals fugged tho
yeh maybe thats a good idea
idk
@wispy ore when you are online, give this heightmap a try too
i havent heard from him in a while
@hot yarrow your heightmap is serving a bigger purpose now
i have no idea where i got this from
https://www.notapenguin.blog/posts/terrain-brush/ the cool people who follow my fred have a chance to yell at me with feedback before i post it everywhere 
In most digital content creation software, brush-like tools are a core way to paint visuals. This week I decided to take a crack at implementing a first terrain brush in my terrain editor, andromeda. At first this seemed like a huge undertaking, so I made a list of individual tasks to complete.
thanks :)
2nd article incoming
hopefully not :)

let me tell you about genshin impact and honkai star rail
Hour 3 of valorant: maybe i don't need to understand ray tracing

i have so many sub crates by now 
this is fun to have
publish_error!(bus, "Error loading asset: {error}"); with a shrimple macro to use
Ooo you have hot reloading?? Awesome
(I am going to steal your code)
Yea I'm about to implement that for my terrain voxel shader
It'll make prototyping so much faster
Good thing is that it wouldn't be hard to implement it for render materials as well
Just rebuild le render pipeline and you're good
yep
Now the only thing I'm worried about is that File::open actually locks the file
Which would be not good since you wouldn't be able to write to it, unless you open it and close it multiple times (in code)
you only open it once you get a notification that it changed
theres a nice crate for that
yeah but wrapping around the os-specific apis is ehh
Can't you use something like fs::metadata? I thought that's what the crate you're talking about uses internally, just wraps around it
the crate im talking about sends you events when the file gets events
it has some async watcher thingy that you just await for events
i spin up a thread and let it live there forever
yeah its great
"Why is my blur shader not blurring"
my blur shader:
void main() {
...
output /= accum;
}
what kind of crack was I on
ok i get that its an "equalize" brush but maybe this is a little too flat
heh this could totally be some road up to a castle on the mountain
today is a weird day
hmm
what do next
i guess its time to fix the rendering
its a bit ugly right now
add texture layers
texturing definitely yeah
and some better shading
ill get the rendering code cleaned up a little first because its absolute hell right now
and better starter heightmaps : >
or perhaps connect to some {Arc}GIS/WGS84/HTM/googlemap/ism (like those addons for blender)
because the parser library took 3 min to build
i support textures but i dont have a good one for this mountain 
im planning to some time when i reintroduce support yeah
then it will take 2.59mins to build π

compile times are fine ish, its the linker thats dreadful

as much as ppl shit on rust for its compiletimes ime its much faster than c++ compiletimes
obviously c# is a thousand times faster but that's not a fair comparison
most of the compiletime is moved to the linker, the issue is that since clang/gcc linkers are really slow (gcc specially) you get the impression that rust's compiletimes are really bad
but if you use mold as your linker it's pretty decent even with half a hundred deps
and considering those deps will only need to be compiled once per target config, once you do it once you're good to go for a long while
the real issue is target folder sizes...
ubo_struct!(
atmosphere,
ifc,
struct Atmosphere {
radii_mie_albedo_g: Vec4,
rayleigh: Vec4,
mie: Vec4,
ozone_sun: Vec4,
}
);
atmosphere.radii_mie_albedo_g = Vec4::new(
world.atmosphere.planet_radius,
world.atmosphere.atmosphere_radius,
world.atmosphere.mie_albedo,
world.atmosphere.mie_g,
);
cursed macro time
i honestly dont think i should keep this
but it saves a bunch of typing
#[macro_export]
macro_rules! ubo_struct {
($var:ident, $ifc:ident, struct $name:ident {$($fname:ident:$ftype:ty$(,)*),*}) => {
concat_idents::concat_idents!(buffer_name = $var, _, buffer {
#[repr(C)]
struct $name {
$($fname:$ftype,)*
}
let mut buffer_name = $ifc.allocate_scratch_ubo(std::mem::size_of::<$name>() as vk::DeviceSize)?;
let mut $var = buffer_name.mapped_slice::<$name>()?;
let mut $var = $var.get_mut(0).unwrap();
});
};
}
this is the macro in question
maybe its not so bad
yeah i am not seriously shitting on it, i have no say about anything rust related at all, beyond a hello world 5? years ago i have not touche... ah not true, i tried some winit+wgpu bs for like 10mins and gave up
not now

is the macro necessary?
InFlightContext
no its not necessary, just saves typing out the same exact code to allocate the ubo
should be but a bit less easy to read imo
i was considering ```rs
ubo_struct!(
camera,
ifc,
struct Camera {
projection_view: Mat4 = state.projection_view,
position: Vec4 = state.cam_position,
}
);
but that might be a bit too obscure
Yea I also thought of doing a macro for UBOs and stuff like that
At the end I just sticked with defining structs cause macros scare me
(or at least making them scares me)
i think i could get the assign version to work
ill try and see if its not too cursed 
you know its not that bad
#[macro_export]
macro_rules! ubo_struct_assign {
(
$var:ident,
$ifc:ident,
struct $name:ident {
$(
$fname:ident:$ftype:ty = $finit:expr,
)*
}) => {
concat_idents::concat_idents!(buffer_name = $var, _, buffer {
#[repr(C)]
struct $name {
$($fname:$ftype,)*
}
let mut buffer_name = $ifc.allocate_scratch_ubo(std::mem::size_of::<$name>() as vk::DeviceSize)?;
let $var = buffer_name.mapped_slice::<$name>()?;
let mut $var = $var.get_mut(0).unwrap();
$(
$var.$fname = $finit;
)*
});
};
}
macros are kinda fun
that is also quite readable
not so much the macro itself, but its what its π
it expands the repeated pattern
uhh
in the pattern for the macro inputs you also have a $(X)*
Which is like a "match zero or more X" in a regex
Then in the expansion you can do a similar thing to say "for each of those matches, expand it to this"
Ahh I see
so in this case it just takes a list of name: Type = initializer and writes var.name = initializer;
So it's the epic thing that C macros don't have
Yeah
Recursive expansion
rust macros are super nice
π¦
Damn I thought it would much much bigger than this
it is quite shrimple
If that's what's all needed to have a fancy macro like that then sign me up lol

feel free to copy pasta
you do need to give rustfmt a little hand with it but other than that it works great
git submodule add ... some/path
git submodule init
fatal: No url found for submodule path 'fsr2-sys/src/vendor/fsr2' in .gitmodules
huh?
am i stupid
what
it did clone properly

it works if i use path/to/foo/ instead of the autocompleted .\path\to\foo
i hate git submodules
ok step 1 of fsr2-rust (generating cmake) is done 
next
being able to write rust for build scripts is such a nice feature
superior API
why 
why does it insist on putting the binaries in its own source dir
There's a crate for fsr2?
im making one
Ohh yea makes sense
There's none on crates.io
Or anywhere else really lol
Unfortunately there's nothing like that for wgpu
I'm definitely gonna need to swap to vulkan later down the line
big progress
now i have to make the actual bindings
im a bit confused how the shader stuff works
ill ask jaker later
i can imagine that FFX_EOF is used for "ok, completed, encountered end of file" while FFX_ERROR_EOF is for an unexpected end of file

library user jumpscare
imagine having users
so true
i have a virtual user in danny but hes procrastinating 
definitely
i'm learning lots by maintaining and updating rs-tiled
for now its mostly just maintenance and answering user questions
i dont have time to actually update the crate
i was planning to do some work this thursday
there are releases with features every now and then no?
yeah last one was not so long ago and had been planned for a long while
added vfs support
good stuff
these are some obscure surface formats lol
wtf i just noticed
the fsr2 error codes overflow

nice docs
fsr2-rs on github: An enumeration of surface dimensions.
truly
i have to use fsr2-sys as the crate name since someone reserved fsr2 only to abandon it
oh god no
wchar_t 
@livid geode is there a c_wchar type in rust
This library introduces two macros [wch] and [wchz] to create UTF-16 or UTF-32 wide strings at compiler time, like L string literals in C.
i found this
The standard used to require wchar_t to be large enough to represent any supported character code point. However, such requirement cannot be fulfilled on Windows, and thus it is considered as a defect and removed.

@livid geode rex as in graphite's rex?
didn't even know graphite had a project named rex
ah
rex is a to-be-renamed project of mine which i also posted here
was before your time here
what was it?
oh i rember that
yeah I saw that, then they put in a stupid message acknowledging it themselves...
yep 
i would be fine with it if it showed any sign of life or plans to continue but its been empty for 9 months so
im making decent progress on writing bindings i think
its not a whole lot to do manually
then again 
that should be all the basic functions
now to do the backend

what
im setting -DCMAKE_BUILD_TYPE=Release why is it not building release
ah
for multi-config (vs) you need to pass the config in cmake --build
ok debug vs release has been fixed
ill figure out how to fix the vk related linker errors tomorrow
good night frogs
thank god I spotted this
casting vkGetInstanceProcAddr to vkGetDeviceProcAddr will surely go well
it seems like fsr2 assumes i link to vk to call vkEnumerateDeviceExtensionProperties and other functions not related to the device
i guess ill modify it to pass in those function pointer s instead
kek
of course they use both vkGetPhysicalDeviceProperties and vkGetPhysicalDeviceProperties2
because consistency
not me writing a mini vk loader ish thing so i dont need to depend on ash for the fsr2 bindings
surely this will work
i despise people who build their examples by default in cmake

or dont even provide a flag to turn it off

at least it compiles
so uh, I can create the context fine with validation off 
set(SHITLIB_BUILD_TESTS false)
set(SHITLIB_RUN_TESTS false)
set(SHITLIB_TEST_TESTS false)
set(SHITLIB_BUILD_EXAMPLES false)
set(SHITLIB_USE_STDLIB true)
set(SHITLIB_USE_BOOST false)
set(SHITLIB_LIB_TYPE STATIC)```
ub 
idk if its ub or just validation being shit
it does throw some errors about features not being enabled so maybe ill fix those and see if i can remove the thread after that
apparently their shaders use int16 but its not documented that i have to enable that feature
oh yeah that fixed it lol
mfw validation would rather cause a stack overflow than tell me im missing a feature
currently stripping down the fsr2 library to its bare essentials to fit in the crates.io upload limit 
ok i had to completely delete dx12 support because they ship an 18mb binary with dxc
also, phobos is at >400 commits now 
πππ
in other news
fsr2 in phobos very soon
you better start learning 
i think i have the basic infrastructure done so I guess its time to start writing a sample
mostly to see if it works
kinda incredible that these bindings did not exist already
thank you for your work soldier π«‘
you should post it in the gamedev rust discord
sure, why not yeah
will do 
oh no 
some of the fields are getting swapped around
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct FfxResourceDescription {
pub ty: FfxResourceType,
pub surface_format: FfxSurfaceFormat,
pub width: u32,
pub height: u32,
pub depth: u32,
pub mip_count: u32,
pub flags: FfxResourceFlags,
}
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct FfxResource {
pub resource: *mut c_void,
pub name: [wchar_t; 64],
pub description: FfxResourceDescription,
pub state: FfxResourceState,
pub is_depth: bool,
pub descriptor_data: u64,
}
/// A structure describing a resource.
typedef struct FfxResourceDescription {
FfxResourceType type; ///< The type of the resource.
FfxSurfaceFormat format; ///< The surface format.
uint32_t width; ///< The width of the resource.
uint32_t height; ///< The height of the resource.
uint32_t depth; ///< The depth of the resource.
uint32_t mipCount; ///< Number of mips (or 0 for full mipchain).
FfxResourceFlags flags; ///< A set of <c><i>FfxResourceFlags</i></c> flags.
} FfxResourceDescription;
/// An outward facing structure containing a resource
typedef struct FfxResource {
void* resource; ///< pointer to the resource.
wchar_t name[64];
FfxResourceDescription description;
FfxResourceStates state;
bool isDepth;
uint64_t descriptorData;
} FfxResource;
compare time
that is very evil formating
i blame amd programmers
smh jaker not having his company in order
unbelievable π
Clearly Jaker is to blame for all AMD problems as he is the CEO, CTO, Chief Programmer, Chief Designer, Chief Marketing Manager, Chief Relationships Manager, and whatever other title there is
exactly
Project looking really good Penguin 
any future plans for water / grass rendering, or purely focusing on the terrain part for a while?
absolutely! pretty soon probably :)
perfectly upscaled black
zero artifacts
ok i think all i need to do to get it working now is jitter and motion vectors
test scene is ready
that looks antialiased to me :)
this is all in phobos yea

what do you mean I can use it below but not clone it and pass it along
ah i get it
meh
There we go
yeah true
but this is good to test if its not crashing completely 
and it seems to at least not be aliased
You seem to be having the same motion problem, hmm π€
i calculated motion vectors by doing the shrimplest thing i could find
FragMotion = PrevClipPos.xy / PrevClipPos.w - ClipPos.xy / ClipPos.w;
How do you do them
and then set motion vector scale to render w/h
I read frogmotion

The scale should be set to w / 2, h / 2
wtf
why does the readme say otherwise lmao
I have no idea
this mf really think we can see the difference from a gif
im so stupid i figured out why its stack overflowing
#[derive(Copy, Clone, Debug)]
#[repr(C)]
pub struct FfxFsr2Context {
pub data: [u32; FFX_FSR2_CONTEXT_SIZE],
}
i tried to keep this on the stack
i made it upscale with the Quality preset now and its definitely not perfect
maybe its better with infinite reverse depth as they said
wtf i forgot to enable depth write lmao
much better

FSR2 has been added
How does reverseZ make such a big difference wtf
Well a big part of that difference you see is because in the first screenshot I had depth writes off entirely 
what are you recording with
sharex can do 60fps mp4s :)
question i actually came here for, do you store a copy of the terrain on the CPU? (i'm guessing not since you'd have to manage, but i guess i'm curious if you've considered whether you'll need to)
other questions, if i understand correctly, you store a normal map of the terrain? why?
obviously normals can add detail, but it doesn't feel realistic to me for a terrain editor to actually utilize it unless you're just exporting hi-res from houdini, at which point it's a bit 
or maybe blending from brushes? but that too also feels messy
you also said you use deferred decal rendering to render the brush
why implement that over virtual texturing for the terrain? i.e. why not do it as a component of the terrain rendering, rather than in compositing? i would expect this to be a lot more powerful, given that with other stuff in the future, you can modify heights with it too
these may seem like suslik/nano/jasper/etc.. .. . . style questions where i'm challenging decisions, they are not, i am not knowledgable enough for these to not be curiosities
VTM would be a better fit for non-dynamic decals. Ofc. it'd make sense for static decals and textures.
Any decal that is movong just increases bandwidth used there proportional to decal count
Say you're doing stochastic texture mapping etc.
You need to redo everything for the area then reapply the decal at the new pos
so do you cache the sample in chunked textures with vtm then? i haven't implemented it
You cache it there yeah
gotcha, i understood vtm as just taking the expensive sample every time when rendering the terrain
Sounds interesting, I canβt say I know enough to answer all those questions properly but itβs definitely worth looking at
I was about to destory everything just to implement reverse Z 
The normals are mostly for adding detail while rendering, without it looks really quite flat which just is kinda ugly
Its pretty easy tho
I don't understand the math behind extracting planes from an infinite reverse projection π¦
I briefly thought about that for the mouse picking but figured itβs not worth the extra hassle just to eliminate the one frame delay
anyway, time to integrate fsr2 in andromeda now
LETS GOOO
Wouldnβt this made the crate size really big since youβre including all of FSR in it?
fsr2-sys (the bindings lib) is a separate crate
but i made a fork of FSR2 thats stripped down to just the source and stuff needed for the vk backend
Because yes initially it didnt fit 
now fsr2-sys is like 5 mb or so
OHHH
I also changed some stuff in the fork but its quite minimal
the biggest thing is I changed the vk backend api to take in function pointers stuff like vkEnumerateDeviceExtensionProperties
because it was calling those directly
Never understood function pointers but sounds good
basically what it means is the bindings dont depend on vulkan being linked at all so it can use any loader potentially
Ohhh so you can do stuff like test cases
possibly i suppose
but also i dont want to link vulkan directly 
that would break with using the dynamic loader in ash for example
even in c++ you can link statically or use volk
give the flying cameraman a break
πΈπ΄ π πΉπ²
wish i had time π im coping so hard for summer. only up to crates rn in the rust book

Give me incentive
What are you talking about
This is NIH land isn't it
naturally
I make my own bread
its like fwog but for vk
and in rust
it does a little more but thats the gist of it
i have this overview thingy of features
Looks cool, I'll use it as reference for my own thingy
Virtual resources are particularly attractive
admittedly it doesnt do any aliasing yet
but one day
some initial ideas are heavily inspired by vuk (martty's thing for c++)
but its nothing like current vuk
i am proud to present bad news
i got deferred from University of Toronto CS to their math department 
Sadge
maybe living in a cardboard box isn't that bad
i dont know what that means
the university thing
UoFT (university of toronto) is one of the most prestigous universities in Canada
if not the
but I got deferred from computer science (rejected) and instead got an offer to their maths
i take a minor in maths and its horrible

i mean
i quite like math but i didnt sign up for not getting my degree ever
π
The second option is a math offer from another uni
damn you really dont get to choose there
it's math but i pay 20K or math, but no one knows about my university
π
the other option is CS, but no one knows about this uni and half of my high school is going there π
yeah that sound even worse
(i do not want to see my high school grade again)
yeah but from what i heard no one there tries so its easy to get 4.0 gpas π
i dont understand what that means that nobody knows this uni?
it's known within my province well
actually country, but if i were to fly out, it wouldn't really be known but tbf
trying to get a job outside of my home country is 
is that a thing over there?
that you are only getting a job if you go to a place ppl know?
rather than what you can/have researched/have mastered in
thatβs not usually how we eu frogs do it
But you can also generally attend (almost) any uni you like so itβs not as important
huh
yeah co-op is usually the route most people go down
people can/do apply using degrees right out of grad
but co-op has become really big at least for se
as it's more or less how you connect to and from potential employers
Hmmm
never heard of that before
you either studied an interesting topic or not
and then people hire you according to what you can do/sold yourself best with
not which university you went to
Yeah
but that could be a cultural thing... ive seen that in south korea/india as well
us of freedom perhaps too to some degree
but anyway, im not judging, just wondering π
tbf i am being completely over dramatic. both unis are perfectly fine and in truth, i'm aiming way too high for my caliber trying to get co-op at the top unis
π
but i know for sure that co-op has been the primary route that my teachers at least
have been touting as the "this will land you a job"
however i am not being over dramatc in saying half of my grade is going there π I don't wana see them again
just make sure you learn/study/research on something interesting
and when you get the chance to travel/see the world no matter how short it is... 3 weeks, 6 months, 2 days... do it
exchange programs or whatever
I really wanna do an exchange program since I haven't travelled since I was a child
Wanna visit Europe one day fr
if you can other cultures too, not just the cheese eaters, wine drinkers and beer brewers π
lmaooooo ill try
im making some drastic changes to how in-frame resources are allocated and passed around
going to make it more streamlined with out of frame stuff
should also lead to major api simplifications
i was fully prepared for this to come crashing down burning but after fixing all the compiler errors it just works
epic
fences and scratch allocators are now globally pooled
as an added bonus you now no longer need to manually keep track of pipeline/descriptor caches or pass them to cmd buffers
frame.new_frame(..., || {
// global_pool is a ResourcePool, you only really have one across the entire program
let pool = LocalPool::new(global_pool)?;
pool.allocate_scratch_ubo(...) // memory for this frame only
});
The nice thing about this is that it doesnt matter if this is inside a frame or not
How do you delete it?
i was just figuring that out
Rather, do you keep track of the GPU using the resource or do you just kill it after some fixed time has passed?
im thinking the cleanest way is to make SubmitBatch::submit_for_present() take ownership of the local pool
kill it after the fence completes
well
release back to the pool



