More than 16 shaders?

Started by Harvey Birdman, September 21, 2007, 06:16:20 PM

Previous topic - Next topic

Harvey Birdman

So I was out mowing the lawn and I had an idea. My apologies if this has been suggested before.

So the 16 shader limit is a real bummer with fancy models, no? Wellll.... how about this. Combine images into larger images and adjust the texture coordinates appropriately. For instance, say you have two 512 by 512 images. Make one 512 by 1024 image. Reassign texture coordinates for meshes using the first texture so they run from a min of 0,0 to a max of .5, 1 instead of 1,1. Reassign the coordinates for meshes using the second texture so they run from .5, 0 to 1, 1. Get it? It would take a bit of work, and the more textures you're trying to eliminate the more of a pain it would be, but I bet it would work.

dhavalmistry

"His blood-terragen level is 99.99%...he is definitely drunk on Terragen!"

Harvey Birdman

Yeah, I'm not doing a good job of explaining it. I just spent 10~15 minutes trying to explain it to the wife and she didn't get it either. Sigh... Take my word for it. Anyone who has done some real modeling will understand, I think. I hope? Christ, I don't want to have to do up a whole tutorial with pictures and everything...

;)   :P   :D  :D

Will

I think I understand. If so it would seem your suggesting that you use one big image file and assing diffrent point on the image to get different textures from it?
The world is round... so you have to use spherical projection.

Harvey Birdman

Exactly! You could put say 4 textures into one image, one in each quadrant, then re-assign mesh coordinates to use just the relevant quadrant of the larger image. It'd be a pain to set up, but I bet it'd work.

dhavalmistry

are you suggesting UV mapping??.......
"His blood-terragen level is 99.99%...he is definitely drunk on Terragen!"

Harvey Birdman

Yes, you create one image which contains several of the original textures, then you adjust the UV maps to use just the relevant piece instead of the whole image.

dhavalmistry

I see.....and yes it could work...
"His blood-terragen level is 99.99%...he is definitely drunk on Terragen!"

Harvey Birdman

Yeah, it'd work for sure, but it could be a real pain re-assigning the texture coordinates. It would depend on the model.

dhavalmistry

oh trust me...I always avoid UV mapping.....I give it to my friends or ask my professor to do it for me  ;)
"His blood-terragen level is 99.99%...he is definitely drunk on Terragen!"

Harvey Birdman

It depends on the model. If the original coordinates were hand-assigned, this probably won't work. If the originals were created with a common algorithm and you can make a good guess or two it shouldn't be that hard.

Oshyan

Like the other technique of splitting up a model into several parts this is perfectly viable, but very laborious. We will be implementing better support for large amounts of textures on objects so rather than spend a lot of time working around the current limitation, you might just want to focus your efforts in other areas and wait until things are improved in TG2.

- Oshyan

Harvey Birdman

Yeah, it was just a thought. Thought I'd throw it out there anyway.

:)

cyphyr

Tree models exported from Vue have an rectangular shape and I've been wondering whether there was a solution to the 16 shader limit here. I don't really know how the models are formated since they are Vue's own internal format initially but its likely to be similar. I would have thought that an operation like this would be available in some of the model conversion utilities. Given a good enough reason I'm sure this is a very workable solution.
Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

Harvey Birdman

#14
I'm kind of toying with the idea of some little utility program that would allow combining some fixed number of textures in an obj into a predetermined configuration. Nothing fancy, but maybe something that would allow you to combine two images into either a horizontal or vertical tile set. Actually, that's all you'd need. Recursive application of something like that would provide a nice solution. It'd bypass re-projecting/reassigning the coordinates with a 3rd party app like PoseRay; you could just process the existing data in the obj.