I’m not sure if that’s the best way to do it. If you already have a clipping/culling algorithm for the upper and lower bound of the screen in your renderer, you can easily split the screen into as many sections as there are (virtual) cores available and adjust the clipping for each section accordingly, so that each renderer renders only the pixels in it’s own part of the screen. You can even time the execution of each part and adjust the sections on the fly according to the results.
Thread1|generate shadow map at frame 1|generate shadow map at frame 2----|generate shadow map at frame 3--|
Thread2|------------------------------|draw scene at frame 1*************|draw scene at frame 2***********|
Thread1|generate shadow map at frame 1|generate shadow map at frame 2----|generate shadow map at frame 3--|
Thread2|draw scene at frame 1*********|draw scene at frame 2*************|draw scene at frame 3***********|
If anyone is curious, this is what I do to render shadows…
render the world in the point of view of the light source
store the depth values of the render in a z-buffer in the shadow mapper
draw the world in the point of view of the camera
after that, i loop over all the rendered pixels and unproject them and then untransform them so that they are the original 3D coords
then i retransform them for the light source and I project it onto the light sources view.
I test the depth of the z-buffer depth and the one i just calculated and if the one i just calculated has a depth that is further from the light source than the z-buffer’s value, I say that that pixel is in shadow.
[quote]If anyone is curious, this is what I do to render shadows…
[/quote]
You have to have a shadow map before you can draw the scene. Also for the best performance, i think you need to have two sets of geometry for each object, so both threads can operate concurrently.
To be honest, and I’ve been thinking about this for a bit, I think removal of shadows is necessary. I don’t want to have to worry about speed while im writing content for this game and it’s not like the shadows were pretty either lol they were blocky and at far distances the precision was horrible so it was all shadow and overall it wasn’t anything professional. Also that poll got 8 votes for the removal of shadows and 4 votes to keep them so Im probably going to omit shadows.
I take it from the art that your inspiration was runescape. Honestly, it’s not far from great!
With a little more optimization and some better quality stuff, you could pull off a great game with a great tale!
Looking indepth through all the posts, I don’t think you are using the best methods to render things. Such as, rendering too many tiles at once, the way you actually draw the tile, and the amount of calls you make.
All in all, you are doing a good job. Just need more optimizations.
Haha yes, Runescape is a big inspiration, however I’m also heavily inspired by Oblivion, the fourth game in the Elder Scrolls series.
Also, yes the game can do with more optimization. I isolated and took apart the renderer the other day and I’m working on making it fast.
I relearned a lot of stuff that I didn’t know. It was bad habits from a youtuber with a huge tutorial series. They’re not bad, but the stuff he shows could be fixed.
I like morrowing for it’s adventure without holding your hand, oblivion for items and spells mechanics, and skyrim for the open world crafting (which could be revamped 5k%). In the far future I will be creating a massive online game which feats people being able to band together and work on stuff. (Think about Planet Calypso without real world money investments) Using resources from mines that take journies, forests that can be cut, and more. Build a place to train your strength and stuff. The whole purpose is to build up and band together, utilizing the areas resources and battling other people who try to cause trouble. Even better, it’s hardcore mode. Play carefully.
I am going to, after optimization on my skills with my current pokemon remake project, recreate the PS1 version of metal gear solid. I love these types of games - stealth, breach, and do a job.
My future is actually pretty busy.
creating a restaurant.
homeless farm (for homeless to eat and work in to do so).
make a not-faulty insurance company
build a private school that isn’t complete crap
On top of that