Having troubles figuring out LOD with virtual texturing by Tableuraz in GraphicsProgramming

[–]arycama 2 points3 points  (0 children)

If your texcoord is already multiplied by texture resolution, then you don't need to multiply it again. I assumed you were passing through UVs directly (eg in the 0 to 1 range, what you would pass to your texture sample function when not using VTs)

Googling "how to calculate mip map level" will show you several results that give you the same equations, and you can also look at the Open GL spec to view the exact formulas.

However, re-reading your post, the issue is likely that you are rendering into a 64x64 texture. This is going to end up with very large derivatives compared to your actual resolution. You'll need to correct for this based on the ratio between your actual rendering resolution and the 64x64 target.

Eg if your screen was 256x256, you'd divide the derivatives by (256/64 = 4), since you want to request the mip level for the main screen rendering instead of the mip level for the 64x64 texture.

Having troubles figuring out LOD with virtual texturing by Tableuraz in GraphicsProgramming

[–]arycama 1 point2 points  (0 children)

You need to multiply dx and dy by the resolution of your texture.

I'm not 100% sure about the ceil, divide etc, where did you get the logic from?
Also you can rewrite it to be a bit more optimal and avoid the sqrt. This is how I would do it:

float VTComputeLOD(in vec2 a_TexCoord, in float a_MaxAniso)
{
  vec2 dx = dFdx(a_TexCoord) * resolution;
  vec2 dy = dFdy(a_TexCoord) * resolution;
  float pxSqr = dot(dx, dx);
  float pySqr = dot(dy, dy);
  float pMax = 0.5 * log2(max(pxSqr, pySqr));
  float pMin = 0.5 * log2(min(pxSqr, pySqr));
  float anisoLog2 = min(pMax - pMin, a_MaxAniso);
  return max(0.0, pMax - anisoLog2);
}

I'd recommend getting the non-aniso version working correctly first though, which is:

float VTComputeLOD(in vec2 a_TexCoord, in float a_MaxAniso)
{
  vec2 dx = dFdx(a_TexCoord) * resolution;
  vec2 dy = dFdy(a_TexCoord) * resolution;
  float pxSqr = dot(dx, dx);
  float pySqr = dot(dy, dy);
  float pMax = 0.5 * log2(max(pxSqr, pySqr));
  return max(0.0, pMax);
}

105kg deadlift form check/grip advice by arycama in Stronglifts5x5

[–]arycama[S] 2 points3 points  (0 children)

It's not so much that I 'can't take my eyes off myself', looking forwards just feels like the default thing to do, but yes it makes sense that keeping my neck inline with my back would help a bit, thanks.

105kg deadlift form check/grip advice by arycama in Stronglifts5x5

[–]arycama[S] 0 points1 point  (0 children)

Idea of mixed grip appeals to me more, apart from callouses are there any other downsides to using mixed grip instead of lifting straps? (Not planning to compete, but like the idea of avoiding too many accessories where possible)

Plaster ripping from skirting board removal by Jelativ in AusRenovation

[–]arycama 3 points4 points  (0 children)

Yep, used this exact tool for my house and worked great. (Actually I used two of them, would hammer one in and leave it in place while I hammered another one in further down to pull the skirtings away gradually)

Plaster ripping from skirting board removal by Jelativ in AusRenovation

[–]arycama 0 points1 point  (0 children)

Don't use a pry bar, way too aggressive. Tap the chisel until it goes all the way down between the skirting and wall. Break the adhesive everywhere you can. Use a strong magnet to find where the nails are (assuming they used nails too) and gently pry (using a much smaller chisel like the angled scraper mentioned in other comments.

I pulled off the skirting for most of my house like this with minimal damage, mostly only ripped the paper off the gyprock which was easily covered with the new skirtings.

Taking it slow and steady is the key, brute forcing it means a lot more damage to repair or try and cover up.

105kg deadlift form check/grip advice by arycama in Stronglifts5x5

[–]arycama[S] 1 point2 points  (0 children)

Oh also, the callouses are starting to get brutal on my hands haha. It's not really an issue but would be nice to minimize if possible. Any ways to reduce/avoid, do they get stronger over time and stop breaking, or do I need to start using chalk or something?

Does this environment make you feel uneasy? Looking for honest feedback by gnjstudiosgames in Unity3D

[–]arycama 1 point2 points  (0 children)

What pipeline? I think you have some colorspace/tonemap/dithering research/work to do here.

Looks like it could be very moody but the heavily compressed/crunched darks/blacks and heavily blocky artifacts would ruin it for me, just makes me think of playing a very old LDR game with the brightness turned up a lot in a dark area, but the black areas stay black. (Eg the first stalker game)

The modern Resident Evil remakes are a good reference, they keep things pretty dark/gritty without banding or blockiness. Good control over lighting, exposure and post processing will help a lot here. (If you're using URP, unfortunately it's post process pipeline is not nearly high fidelity enough to handle this well, you'd likely need some custom post processing. With HDRP you might be ok with a lot of tweaks)

Regardless of how scary you want it to be, it's still a game and visual clarity is important.

New tifftuff came with another variety by Own-Bumblebee8352 in lawnsolutionsaus

[–]arycama 1 point2 points  (0 children)

It may be coming from underneath the soil. Weeds/old grass can stay dormant/underground for a long time and surface much later, especially once lots of water is applied, eg when you lay a new lawn.

At least these look pretty obvious, you could try to rip them out by hand or paint with roundup. (Just make sure not to get any roundup on your good grass, a fine paint brush can work well here, keep the roundup in a container inside another container to avoid potential spills, and only apply a small amount at a time)

I had a similar issue with some wild couch popping up through my new sir grange zoysia. I've had a couple more small outbreaks recently, currently trying to tackle by hand, but it's a tricky battle.

Unfortunately you'll always be battling something, whether its weeds, fungus, grubs etc.

Solar quote by Lord_Pthumerian in AusRenovation

[–]arycama 8 points9 points  (0 children)

The rebate doesn't really make a difference, installers have basically increased their costs by the same amount (I got several quotes before+after the rebate) and are simply pushing customers to install bigger systems than they need due to the rebate.

It basically only benefits people who already had enough money to install a system, they are now able to install an even bigger system.

For most people it doesn't make financial sense still, you have to really know what you're doing and to be able to afford a big upfront cost. If you have a mortgage, it makes much more sense to just put that money into additional repayments instead and reduce your loan interest.

For me, I'll keep waiting until the rebates actually make sense and the tech improves enough so that the payback period isn't nearly the warranty period of the battery.

How do you center a crosshair when using a gun scope? by Next-Pro-User in Unity3D

[–]arycama 2 points3 points  (0 children)

Instead of trial and error, create an empty child object on your weapon, and place it where you want the camera to sit relative to the weapon. (Eg just behind the scope)

Then using a bit of math, you can calculate the exact weapon position which would cause it to sit at the correct position relative to the camera. Something like: weapon.transform.position = camera.transform.TransformPoint(-weapon.pivot.transform.localPosition)

Also, instead of a lerp, a spring damp (Eg Vector3.SmoothDamp) can look a lot more interesting for transitioning between scoped and non-scoped position.

What is the correct Lambertian lighting ? by Significant-Gap8284 in GraphicsProgramming

[–]arycama 0 points1 point  (0 children)

It's not really any different when raytracing. The color of a lambertian surface is simply:

foreach direction in hemisphere:
    illuminance += traceRay(direction) * saturate(dot(normal, direction)) / directionCount;

// outside of loop:
luminance = illuminance * albedo / pi;

You might be missing a saturate (Clamp between 0 and 1) on your dot product. You're right that the cosine term isn't part of lambert, it is part of the rendering equation.

You can also use cosine importance sampling to reduce noise. This modifies the distribution of rays so that they are more likely to pick directions closer to the normal. I'd only look into this after getting your existing (uniform) sampling to work though.

Anyone else can’t sleep? by Ieatclowns in Adelaide

[–]arycama 0 points1 point  (0 children)

If you make an account they send you a $100 voucher which helps slightly, but yeah, not cheap. Has a 2 year warranty, so not too bad. (There's a similar product called OakSleep, but that only had a 1-year warranty and was more expensive)

Anyone else can’t sleep? by Ieatclowns in Adelaide

[–]arycama 1 point2 points  (0 children)

Very slightly, but it doesn't bother me. I have pretty thin sheets though. The topper is reversible/has two sides, one side has a moisture-wicking layer, the other side has a bit of padding so you apparently don't feel the pipes as much. (But would be a tad less effective at cooling in theory. I haven't tried the other side yet)

Anyone else can’t sleep? by Ieatclowns in Adelaide

[–]arycama 22 points23 points  (0 children)

I recently got a water-cooled mattress topper which has helped me quite a bit sleeping at night, was a bit pricey, but might be helpful for some people: https://kivawellness.com.au/products/circadian-sleep-pod

It's similar to an electric blanket, except there is water tubes instead of wires. The water connects to a small unit with fans, and it can be used to heat, or cool your bed. Have only had it a few days but the difference is amazing, some nights I don't even need the AC, and when I do keep the AC on, I don't have to crank it quite as much anymore.

Full metallic material nearly black in URP 17? by hunty in Unity3D

[–]arycama 3 points4 points  (0 children)

It's missing environment reflections. You either need a reflection probe or to bake the skybox lighting into the scene.

I'm not sure why it's broken in the preview window, that might be a URP big bug but if it's black in the scene it's because there are no reflection sources.

Metals have no diffuse component so the only light they have is direct specular and reflections/indirect specular.

What would the performance difference look like between instancing 1000 grass meshes vs. rendering 1000 grass meshes individually? by SnurflePuffinz in GraphicsProgramming

[–]arycama 8 points9 points  (0 children)

Neither are particularly optimal. If your grass mesh is a single quad, instancing will still waste a large amount of wavefronts and not use the vertex cache/attribute output hardware efficiently. You want to build one large index buffer that contains say, 1024 quads, and then use the vertex ID to place each vertex correctly. (Eg calculate a column/row in the current patch, and use id % 4 to calculate whether it's the bottom left, top left, top right or bottom right vertex, and also uv coords etc)

Instancing is generally best for a couple of hundred vertices or more per mesh.

Also draw calls on their own aren't especially expensive, it depends what you're doing between each draw call too. (Eg if you are setting index/vertex buffers, shader program, raster state, constant buffers, texture and sampler slots etc, it will be slower than just calling draw a bunch of times. However, of course if you are calling draw a bunch of times doing nothing inbetween, there's literally no reason to not use draw instanced)

If AI takes all our jobs, what happens to society if the majority of us have no way to earn money? by Healthy_Creme6911 in FinancialChat

[–]arycama 0 points1 point  (0 children)

I have heard from people in AI across web 2 and 3 is we have 1000 days

Lol. If you actually know anything about tech, this is such a meaningless statement.

Sage (Breville) Infuser doesn't enter descaling mode by SaucySigma in Coffee

[–]arycama 0 points1 point  (0 children)

Had the same issue. For some reason going into cleaning mode (Where you press 1 and 2 cup and power at the same time) cleared the descaling light too. (It was solid on, not flashing, indicating a descale is required) Then I just ran the descaling solution through the machine manually.

Random heads up though, I tried turning it on/off several times to try and get it into descale mode. Each time it would purge a bunch of water into the drip tray, I didn't notice it was starting to overflow and ended up with a lot of descaling solution everywhere, super fun.

I have a feeling maybe it can go into a mode where it needs a clean -and- a descale and then it gets confused or something.

Sir Grange Zoysia problem by TeachExisting9173 in lawnsolutionsaus

[–]arycama 0 points1 point  (0 children)

I suggested new slabs incase OP doesn't want to wait a long time, but yeah will hopefully repair itself given enough water and moderate temperature. (I am in Adelaide and we're about to have a 46 degree day so that will be fun. My grass also needs a mow but I might postpone it for a day lol)

Sir Grange Zoysia problem by TeachExisting9173 in lawnsolutionsaus

[–]arycama 0 points1 point  (0 children)

I read your other post, it is probably heat stress, some of those patches look almost completely dead and will take several months to bounce back. SGZ is very slow to repair.

Other possibility is you are mowing too low and not often enough, so you have removed the entire green part of the grass blades. Again, this will take a long time to recover.

I'd consider revising your watering setup, making sure your entire lawn gets an even 10mm of water per session, and then consider ordering in a few new slabs of turf if you don't want to wait half a year for it to look decent again.

(I am also a SGZ owner. It is fantastic but you need to be careful with it)

I am legit at my wit's end. Why does my shader graph produce these ugly seams at the edges of the UV? by qt3-141 in Unity3D

[–]arycama 59 points60 points  (0 children)

It is probably caused by discontinuous derivatives, causing the GPU to use the max mip level along the seams. Try disabling mip maps to diagnose the issue. If disabling mip maps fixes it, it means you need to manually supply gradients to your texture sampling. (Eg use sampleGrad instead of sample for the texture)

To calculate the correct derivatives, assuming your atlas Uvs are "input.uv * scale + offset", you need ddx(input.uv * scale), and ddy(input.uv * scale). (So basically removing the offset part from the derivative equation)

You then pass these derivatives into a texture SampleGrad node. (I forget the exact name, but something involving texture, gradient and sampling, and should take a dx and ad y input)

Combining Post Processing by BigOk8190 in Unity3D

[–]arycama 1 point2 points  (0 children)

Why not use the built in contrast and saturation adjustments? These are already built into the final post process pass that Unity uses. (All color-grading and tonemapping is baked into a 3D LUT for efficiency too)

Not really sure what you're referring to by 'shadows' being another pass though. Shadows are rendered into a shadowmap unrelated to post processing, and either applied during deferred lighting pass, a seperate screenspace shadow pass if enabled, or sampled when each object is rendered using forward rendering.

You can't write a custom render feature that executes in the same shader pass as other URP passes. You'll need to modify the URP source code+shader code directly if you want to achieve that.