News:

Want to praise Simutrans?
Your feedback is important for us ;D.

Hardware accelerated display, OpenGL back-end & Simutrans 3D

Started by eddielexx, January 02, 2010, 03:38:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ters


Markohs

Yes, and it's the right place, but I need to know wich type of image is to put it on the corresponding atlas so phases can be drawn in the minimum number of passes. Atm I wanted one for land tiles plus slopes and maybe a second for way objects. when register_image is called, that information is lost. Maybe a good idea that comes to my mind with your post is I should add a parameter to register_image with an optional texture atlas id.

register_image is called on each image of the game, I just need to know wich type of image is.

Ters

Thinking out loud: is it possible for an image to be both land tile and something else?

Dwachs

Parsley, sage, rosemary, and maggikraut.

prissi

Thus land tiles a a certain image range. However, soon the landscape code might change. Furthermore, would it no make much more sense for OpenGL to just provide the mesh points and texture(s) and leave the rendering to the hardware?

Markohs

yep, prissi, and that's what I already implemented. the problem comes from the situation uploading the textures each frame consumes too much CPU and PCI bandwidth, so I have to create a texture with all possible tiles and upload it first, and re-use it on all frames. To make this I added some code to calc_water_level anf just uploaded all those images.
This has already been implemented and it works perfect, boosting performance.
the problem is now i want to do the same with slopes and ways, and can't see a good place in code to locate wich are those images. about slopes i was thinking generating them from textures prograatically like climate tilles are now, and do the code for simutrans 2D too, auporting doble heigjt. but how to register just way images?
written from my phone, this post might have errors

Markohs

Quote from: Ters on December 06, 2012, 04:04:47 PM
Thinking out loud: is it possible for an image to be both land tile and something else?
land tiles are generaged, yes. but in.  the case one image is used in multiple objects, i'd just add copies to each atlas.