Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


multiple texture scenes & lightmapping question

This topic is 6031 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ok so i''m just messin with d3d, making a little 3d engine in my free time. i have lots of experience with software engines and writing them from scratch so most of this stuff in d3d is easy to understand. couple of questions though. obviously d3d and hardware loves to process a lot of verticies at once. how do you have a vertex buffer full of polys that can have lots of different textures? i don''t see how you switch textures to the one you need if you wanna make one render call (say for the current leaf i''m traversing in a tree) for many polys with different textures. in software it''s easy, group em all together in the buffer, set the texture and render the amount of polys with that texture, set the next texture, render the next batch. but from my understanding, calling d3d to render batches like that would be slow because of the multiple calls. especially if you have a very diversely textured scene. how to do it with a single call? also if i wanna have a lightmap based engine with precalced lightmaps loaded. what have any of you found to work best? is your world mostly quads? if i''m building a world based on triangles only, how to keep switching which lightmaps to use? btw, any good d3d information sites? i''ve gotten about all the info i can out of the help file. i need some real world application help.

Share this post

Link to post
Share on other sites
Thats one of the decisions you gotta make, man...either storming fast gameplay, or detailed textured scenes...

as far as I know, if you have vertices of the same type in one buffer, but some groups have different textures, then you have to make multiple calls to render the buffer with different textures. I take it you know you can specify the index at which to start rendering, and the anount to render; simply record this for each object or whatever, and switch textures in between rendering..

still loads of optimization on your part, though; like grouping vertex types together, and texture types together in one buffer, to save buffer switches, but the biggest optimization you can make is to use less (or smaller) textures.

I dont believe that the performance hit will be that great, but it depends on the speed of the rest of your code and how well built your engine is around the rendering function...
I dont know about vertex shaders, but no, I dont think you can do this in one call

Don;t know about the lightmaps, tho


Share this post

Link to post
Share on other sites
thanks for the response.

ya i know how to render certain groups of the vertex buffer and all that stuff that but i wasn''t sure if making seperate calls is what you had to do for different textures or if there was a method within d3d of doing it while only making a single call. glad i didn''t write too much of the partitioning/visibility code because i''d of had to rewrite it.

now about the lightmaps.. hmm.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!