Ideas - crazy ideas to improve render in blitz

Started by Santiago, April 14, 2020, 13:53:28

Previous topic - Next topic

Santiago

Hello, I was thinking of some ideas to optimize the games.

Optimize-mesh-function ()

generate a function, which generates LODs of entities that we originally loaded as high detail and high poly.

3dsmax has very simple functions to optimize mesh. some simply join vertices that are close together, another would be to generate a textured plane. but the idea would be to avoid that the developer has to model LOD's of each object of the game.

:-X ¿What do you think of this idea?

-----------------------------------------------------------------------------------------

3 RENDER (Distance / resolution)

Use 3 camera renders per frame, where each range is assigned a distance and a render resolution.

1. The close render uses a render of 100% of the original resolution of the game.
camerarange (0.100)

2. The render of the medium uses half the resolution of the game, camerarange (100,1000)

3. the far render uses .25 times the original resolution.

Of course it would be necessary to dump these 3 textures (vram) on 3 planes? to be able to capture them and see them as if it were a normal render?
I see that modern engines do this kind of effect. and they also do a Render-scale, which is very effective.

:-X Do you see it achievable? or technically possible in blitz ?.




degac

Hi,

I don't use Blitz3d from ages, but I think you can 'store' 3 different entity - based on LOD - and 'show' the one you want based on the distance from the Camera().
This is sure not automatically managed by the 3d-engine built in Blitz3d, but at code level it should feasible.

Costs:
- need to calculate (maybe not constantly...) the distance of each object - or use 'fast and less accurate function
- Vram cost? It's nowadays a real problem?
- overall speed compared to GPU power?
If there's a problem, there's at least one solution.
www.blitzmax.org

Matty

Maybe rather than distance, the area occupied in screen pixels approx.  So...if the object occupies only afew pixels high, why use the most detailed model?

degac

Quote from: Matty on April 14, 2020, 14:45:59
Maybe rather than distance, the area occupied in screen pixels approx.  So...if the object occupies only afew pixels high, why use the most detailed model?
But this means you need to render once, than calculate the area (ReadPixel) and then clear screen, and re-render using the 'right' model.
It's quite time consuming.
If there's a problem, there's at least one solution.
www.blitzmax.org

Matty

#4
Not at all.  Cameraproject the top and bottom vertex on the model and get the screen coordinates and check the abs distance(height).  No render needed at all. Just a quick calculation.

Or even better tformpoint the bounding box, camera project these positions into screen space and check the area width and height of screen bounding box.