work-around for slow PT reflection calculation

Started by Dune, March 23, 2021, 12:41:48 PM

Previous topic - Next topic

Dune

That is what would be my salvation. I am trying to do an overcast scene, with a finely displaced, slightly reflective ground, which in SR I would do by unchecking RT in the reflective shader. Only RT in the puddles, by decreasing the mask, very simple... and fast. But in PT, rendering comes to a virtual standstill over the displaced reflections on ground, whilst they needn't be very accurate and really reflective at all.
So, until I have a super computer, I have to either use no reflections, or use SR.
There's probably no way to overcome this, is there?

WAS

Wow, what a nice scene too.

Yeah reflections are a killer. Even without them and low lighting it can slow down on the ground cause of shadow bounce.

Kadri

Looks good.

Ulco just curious if there would be any difference in rendering speed if you would export the ground as a heightmap and use that or export the ground as an obj file. Depends probably on the displacement, complexity of your ground.

WAS

That's actually a good idea. And you may be able to get by with low MPD and just subdivision it smooth.

Dune

Why would that be any different? You'd still have all the tiny reflections/shadows/displacements that need calculating from that heightmap. Or do you mean a topdown texture map rendered and projected onto an obj or heightmap? The workflow eludes me.
The ground is pretty flat overall, but has tiny displacements... and in the pit I need to make lateral (vdisp) 'outcrops' where shovels have cut the peat. They can't be baked into a heightmap anyway.
I was thinking of using the distort by normal feature to fracture a color, and have a bluish fractal with maximum slope projected on the dark ground, perhaps multiplied by a distance shader, so 'reflective' mud will be lighter towards horizon. Some pinpoints of light perhaps one reflective masked by diluted tiny fake stone, again multiplied by distance, but inversed for only reflective lights at front. Something like that, but I need to try still.
I was hoping it could be built into TG by Matt; a 'reflective' shader that does not calculate real reflections, but merely acts as a non-RT reflective shader in SR. Matt? ;D

WAS

Well heightmaps are far more simplified then a PF with low min scales usually unless you are using ridiculously high resolution. Same for objects and subdivision.

WAS

#6
Also this is where a specular-only shader would, quite literally, shine. You could easily mock the dark color, even add some blue for environmental lighting if it was clear skies, and have speedy specular highlights. Heck could mix specular with high roughness spread and super low  intensity with blue colour for environmental light. Still faster than then a reflective shader probably. 

Back in the day ray traces reflections took ages and looked like garbage mostly (think that one deep sea movie The Sphere) so faking it was often better.  In Jurassic Park for the T. rex debut, it was low lighting so easy to simply darken textures where wet, and use specular only. Boom. Wet dino. And still to this day looks fantastic.

René

I have tried reflection maping with a spherical render of the environment as texture; of course that's not accurate but it can work well in some cases. it would be nice if this were implemented in Terragen.

Dune

Thanks for the input guys. Mapping a spherical render is something I've heard/read about earlier, but takes an extra render first. I prefer one go, but it's worth investigating. It needn't be very high-res for just mud, I think.

I still don't get the heightfield thing. A heightfield is nothing more than a mapped displacement , IMO. If I need the tiny displacements, the map needs to be accurate and the displacements will still be minute and slow to compute. No difference. Or I misunderstand you completely, as I never work with heightfields.
It's the front area (first 10m) that gives the most slowness. Rest is covered anyway.

Dune

I have probably answered my own question. If you use the default shader and no fresnel reflectivity, but just metallic and some bluish color (or maybe a color map), rough ground PT renders very much faster than with real reflections, and gives pretty decent results with some fiddling.
The top one slowed down, so I stopped it after 15mins or so, bottom half would have taken much longer than that I gathered.

Kadri

#10
Looks usable Ulco.

I was curious and did a test with an exported landscape.
The OBJ file was 600 mb. It depends on your settings you know.
I tried to optimise and get rid of duplicate parts etc. but it took too long so i just threw the object as it is into the scene.

Normal Terragen scene without any object: 27 minutes
Scene with the ground obj file :  2 minutes and 32 seconds

The look is different and depends on the object, how you export etc. probably.
Interestingly the obj version looks like it does have more detail.
But other then that the render time difference is huge.

My Terragen version is old without pathtracer so i don't know how that would end speed wise.

Dune

Interesting. So you export terrain as obj, import as obj and apply the same textures as you would otherwise onto the obj? I have to go now, but will think of this method more. Thanks a lot, Kadri!

Kadri

Quote from: Dune on March 24, 2021, 06:10:36 AM... So you export terrain as obj, import as obj and apply the same textures as you would otherwise onto the obj?...

Exactly. I use that same way in my animation that is rendering right now.
The main reason was render time but i hadn't tested it with reflection.

Dune

Does that mean that the tiny displacements you are seeing in your example is actually only bump, or is that real tiny geometry? If it's bump, I might as well project all my shaders onto an obj sheet, as the ground is pretty much flat, apart from the rectangular pit. I'll try that. It's a huge difference in render time indeed, and I gather from your information the long rendertime is from micropoly rendering versus the shorter time for obj 'bump' rendering. Very interesting.