Jump to content
  • Advertisement
Sign in to follow this  
Exomondo

Size for texture mapping

This topic is 4254 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

My goal here is to use vector images as texture maps, the way i figured i would go about it is to determine the size of the texture mapped area in fragments, then render the vector image to a raster texture of that size in order to maintain a 1:1 texel:pixel mapping and then map that to the surface. Im not quite sure how to go about determining the size though, does anyone have any ideas?

Share this post


Link to post
Share on other sites
Advertisement
A few more details might be useful - I'm not entirely sure what you're describing [smile]

Using existing GPU's its quite difficult to get good topological information - D3D10's Geometry Shader would be good at it though.

Given that mip-mapping scales the texture LOD based on it's contribution to the image you can possibly use that to get some sort of guesstimate of how large the rasterized area is, but I doubt you'd get a pixel-precise measure.

hth
Jack

Share this post


Link to post
Share on other sites
I'd use the projection matrix to calculate the likely screen size - project the points into screenspace. Maybe use a simplified estimate of the projection if you want to do it fairly often. Many LOD algorithms use simplified estimates of the projection to calculate screen space error, so one of them may give you ideas. It should be fairly simple to approximate the maximum on-screen dimensions for a given distance, for example. Would that be accurate enough?

How often would the vector images change?

Jack's suggestions could be better if you need it to work on any surface or want to update it often.

EDIT: you could also project the surface's bounding volume instead of the actual geometry. Again, it depends on how close an approximation you're after.

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
A few more details might be useful - I'm not entirely sure what you're describing [smile]


Well essentially i am trying to work out the best way to determine the size of the area to be mapped and i guess you could do it relative to camera position in order to get a idea of the size the texture would need to be.
The idea is to be able to render a raster texture from a vector image (using OpenVG framework) but try to maintain that 1:1 ratio so that zooming in on it doesnt result in pixelation that would occur with normal raster textures.

Quote:

Using existing GPU's its quite difficult to get good topological information - D3D10's Geometry Shader would be good at it though.


I thought of that, might have to grab a G80 to work with.

Quote:

Given that mip-mapping scales the texture LOD based on it's contribution to the image you can possibly use that to get some sort of guesstimate of how large the rasterized area is, but I doubt you'd get a pixel-precise measure.


Thats another thing i had thought of, never really looked too deeply into it but perhaps its worth it.

Quote:
Original post by mrbastard
I'd use the projection matrix to calculate the likely screen size - project the points into screenspace. Maybe use a simplified estimate of the projection if you want to do it fairly often. Many LOD algorithms use simplified estimates of the projection to calculate screen space error, so one of them may give you ideas. It should be fairly simple to approximate the maximum on-screen dimensions for a given distance, for example. Would that be accurate enough?


Thats actually quite a good idea, ill look into that too ;)

Thanks very much, if you happen to think of anything else im still all ears ;P

thx again,
-J

Share this post


Link to post
Share on other sites
Ok i have an idea that i really havent thought through but i wanted to jot it down here anyway:

Say i were to render a 512x512 texture map onto a surface, then using a fragment shader with a texture lookup i could find out how many fragments reference a particular point on that texture?

Say if 4 fragments referenced the same point on the texture then to have a 1:1 mapping the texture would have to be 2048x2048.

I havent thought about the mechanics really and i know it wont be perfectly accurate, and will probably be too computationally expensive to actually use as it would need multiple passes but can anyone envision this actually working or have i missed something?

Cheers!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!