Theory on the Further Developement of Game Textures - Vectors
42 replies, posted
Hello Facepunch!
I've been thinking recently, all of the textures put out in many games for material use (model skins, wall and floor textures, ect) are all rasterized images told to wrap around a polygon or surface.
Now, I certainly don't know the complete mechanics behind raster and vector graphics, but doesn't raster images take up more space because of the filling of every pixel of the texture compared to the mathematical formula of a vector image?
Couldn't you also increase the quality of the said texture when viewed closer by adding more vectored images appear in the proper locations the closer you get to the texture itself?
Wouldn't imitating damage and deterioration of the texture be better than just another texture (ie: bullet shots appearing on walls in HL2) overlapping it?
Maybe I'm wrong, but I think that vectored textures are the next big leap in graphical textures. They are less memory hogging, can be edited on the fly seamlessly, and can dramatically decrease the space required to store these textures on a hard drive.
Just a thought really. Any thoughts or comments?
Thanks!
Also, I didn't know what section to put this in, but it seemed more appropriate for programming. Sorry to the mods if its not in the right place!
Possibly, but current graphics libraries don't allow vector textures.
You'd have to either rasterize it before binding it for drawing, or you'd have to write a fragment shader that accepts a limited vector format (don't expect to do full SVG in a fragment shader) that does the calculations per-pixel every frame. Rendering SVG isn't really the quickest thing in the world, either. You'd probably take a pretty big framerate hit if you rendered them every frame, so it should probably only be used where it's really necessary, such as UI elements, where it can be scaled to the desired resolution, rasterized, and cached.
[QUOTE=ROBO_DONUT;16354803]Possibly, but current graphics libraries don't allow vector textures.
You'd have to either rasterize it before binding it for drawing, or you'd have to write a fragment shader that accepts a limited vector format (don't expect to do full SVG in a fragment shader) to does the calculations per-pixel every frame. Rendering SVG isn't really the quickest thing in the world, either. You'd probably take a pretty big framerate hit, so it should probably only be used where it's really necessary, such as UI elements, where it can be scaled to the desired resolution, rasterized, and cached.[/QUOTE]
This.
Vectors are a resource hog. They use a lot more cpu cycles than rasterized graphics.
Don't want to hijack the thread, but I've had a similar idea, although on the model end of this.
Currently, circular objects are limited, especially at small sizes. They're blocky and doesn't really look that great. Hell, I believe some wires in HL2 are triangular, but just appear circular.
Anyways, what's keeping us from making something with an engine that says "ok, this object is perfectly circular" and have it render a circle/sphere, instead of the relatively low-poly circular objects we have now?
[QUOTE=biodude94566;16354914]Hell, I believe some wires in HL2 are triangular, but just appear circular.[/QUOTE]
They're actually flat. They just turn so that they always face the player.
[QUOTE=biodude94566;16354914]Anyways, what's keeping us from making something with an engine that says "ok, this object is perfectly circular" and have it render a circle/sphere, instead of the relatively low-poly circular objects we have now?[/QUOTE]
Geometry and limited processing power.
What's a vector texture anyway? I can't find any information about it.:psyduck:
[QUOTE=Siduron;16355217]What's a vector texture anyway? I can't find any information about it.:psyduck:[/QUOTE]
[url]http://en.wikipedia.org/wiki/Vector_graphics[/url]
[QUOTE=ROBO_DONUT;16354803]Possibly, but current graphics libraries don't allow vector textures.
You'd have to either rasterize it before binding it for drawing, or you'd have to write a fragment shader that accepts a limited vector format (don't expect to do full SVG in a fragment shader) that does the calculations per-pixel every frame. Rendering SVG isn't really the quickest thing in the world, either. You'd probably take a pretty big framerate hit if you rendered them every frame, so it should probably only be used where it's really necessary, such as UI elements, where it can be scaled to the desired resolution, rasterized, and cached.[/QUOTE]
Actually, you're right. It'd probably be more CPU intensive mapping all of the points of the vector's consisted on the texture than just worrying about one 'static' image.
That makes sense... what about rasterizing the vectors into an image as they change? I know there would be some lag between cycles, but that would allow the most edibility on the fly would it not?
[QUOTE=ROBO_DONUT;16355290][url]http://en.wikipedia.org/wiki/Vector_graphics[/url][/QUOTE]
I feel dumb for not finding that link. But thanks!
Vector graphics will be history all over again, in 10 years we'll all say "Lol, crysis has ugly graphics".
I can definately see a future in this as well.
[QUOTE=biodude94566;16354914]Don't want to hijack the thread, but I've had a similar idea, although on the model end of this.
Currently, circular objects are limited, especially at small sizes. They're blocky and doesn't really look that great. Hell, I believe some wires in HL2 are triangular, but just appear circular.
Anyways, what's keeping us from making something with an engine that says "ok, this object is perfectly circular" and have it render a circle/sphere, instead of the relatively low-poly circular objects we have now?[/QUOTE]
Perfect circles are actually impossible in practise.
[editline]09:44PM[/editline]
Even in real life.
[QUOTE=biodude94566;16354914]Anyways, what's keeping us from making something with an engine that says "ok, this object is perfectly circular" and have it render a circle/sphere, instead of the relatively low-poly circular objects we have now?[/QUOTE]
The bouncy ball in Garry's Mod does this but it's really just a flat sprite that faces the player.
[QUOTE=Vampired;16358489]The bouncy ball in Garry's Mod does this but it's really just a flat sprite that faces the player.[/QUOTE]
That's also the method used with the trees in Oblivion I'm pretty sure.
Well, I kinda like the idea of vector textures. You are right, it would take up more processor effort and less space (meaning less cache misses! Super fast!!), but if you write a fragment shader, it should be straightforward and all done on the GPU, which already has the stuff to rasterize vector graphics. Hell, that's what it's been doing all along! I mean, texture rasterization is already essentially a vector image based on texture data, it just does linear or cubic interpolation between texture samples.
I think this is an idea worth exploring. You could express a texture any way you want and load it as part of the fragment shader as long as you express it as a function of the form
[code]
{r, g, b, a} Vector_Texture(float x, float y);
[/code]
and wasn't inductive or anything like that.
Oh, and nos217, I believe you CAN make 3d spheres in games as exact as it is possible to show at an arbitrary resolution. Who says you need to make spheres out of polygons? You could just as well use a fragment shader to fill in the area of a billboarded square. (The vertex shader just sees a square where the sphere will appear.) Based upon the barycentric coordinates of the current fragment you are rendering, and the relative orientation of the sphere, you can determine the normal at that point, sample the texture at the right point, and even determine and specify the correct depth value at that point and it will all come together to construct a maximally accurate sphere into your frame. It is called "using your pixel shader effectively"
[QUOTE=Cathbadh;16358695]Well, I kinda like the idea of vector textures. You are right, it would take up more processor effort and less space (meaning less cache misses! Super fast!!), but if you write a fragment shader, it should be straightforward and all done on the GPU, which already has the stuff to rasterize vector graphics. Hell, that's what it's been doing all along! I mean, texture rasterization is already essentially a vector image based on texture data, it just does linear or cubic interpolation between texture samples.
I think this is an idea worth exploring. You could express a texture any way you want and load it as part of the fragment shader as long as you express it as a function of the form
[code]
{r, g, b, a} Vector_Texture(float x, float y);
[/code]
and wasn't inductive or anything like that.
Oh, and nos217, I believe you CAN make 3d spheres in games as exact as it is possible to show at an arbitrary resolution. Who says you need to make spheres out of polygons? You could just as well use a fragment shader to fill in the area of a billboarded square. (The vertex shader just sees a square where the sphere will appear.) Based upon the barycentric coordinates of the current fragment you are rendering, and the relative orientation of the sphere, you can determine the normal at that point, sample the texture at the right point, and even determine and specify the correct depth value at that point and it will all come together to construct a maximally accurate sphere into your frame. It is called "using your pixel shader effectively"[/QUOTE]
Ahhh, wouldn't the implementation of CUDA in new NVIDIA GPU's help the CPU load of the vector objects?
I can see this being added more upon by big companies in the future. It could basically eliminate the high need for diskspace for textures.
Oh, but one other thing, could bump mapping still be used, as well as other texture related after effects?
[QUOTE=MCPeePants;16358592]That's also the method used with the trees in Oblivion I'm pretty sure.[/QUOTE]
Yeah if you set the details to low. And that's just a sprite, nothing to do with vector graphics.
[QUOTE=Sporbie;16358864]Yeah if you set the details to low. And that's just a sprite, nothing to do with vector graphics.[/QUOTE]
Yeah, that's what I thought. It was a pretty good effect though, especially with so many trees seen.
The leaves looked good too
[QUOTE=MCPeePants;16358839]Ahhh, wouldn't the implementation of CUDA in new NVIDIA GPU's help the CPU load of the vector objects?
I can see this being added more upon by big companies in the future. It could basically eliminate the high need for diskspace for textures.
Oh, but one other thing, could bump mapping still be used, as well as other texture related after effects?[/QUOTE]
Who says you need to use CUDA? It should be perfectly easy to do it just by compiling a fragment (pixel) shader
[QUOTE=Cathbadh;16358982]Who says you need to use CUDA? It should be perfectly easy to do it just by compiling a fragment (pixel) shader[/QUOTE]
So it's realistically possible? Like without too much pressure on the CPU?
[QUOTE=MCPeePants;16359009]So it's realistically possible? Like without too much pressure on the CPU?[/QUOTE]
As long as you can compile a shader function that is declared similarly to the one I gave, then yes! It can be sampled exactly the same way that a texture sampler would.
[QUOTE=Cathbadh;16359091]As long as you can compile a shader function that is declared similarly to the one I gave, then yes! It can be sampled exactly the same way that a texture sampler would.[/QUOTE]
So why hasn't any big company looked into this?
I could see the only thing that could make it unwanted would be CPU usage, but if that's out of the way, there's no downsides to it is there?
[QUOTE=MCPeePants;16359162]there's no downsides to it is there?[/QUOTE]
Time and effort.
[QUOTE=ROBO_DONUT;16359308]Time and effort.[/QUOTE]
Of course, lol.
I meant as far as side effects when the final product is worked out and done.
[QUOTE=MCPeePants;16359162]So why hasn't any big company looked into this?
I could see the only thing that could make it unwanted would be CPU usage, but if that's out of the way, there's no downsides to it is there?[/QUOTE]
Well, it is still more computationally expensive than sampling a texture, and I'm not entirely sure that this is an effective way to draw vector textures. It only works if you can define a bounded function for the color at a point. Work great for fractals and stuff.
Didn't Crysis do this for rendering the sky? The stars and stuff isn't a texture.
[QUOTE=Cathbadh;16359349]Well, it is still more computationally expensive than sampling a texture, and I'm not entirely sure that this is an effective way to draw vector textures. It only works if you can define a bounded function for the color at a point. Work great for fractals and stuff.
Didn't Crysis do this for rendering the sky? The stars and stuff isn't a texture.[/QUOTE]
So wrapping vector textures onto a model or more complicated objects would be a whole different ball game right? lol
[QUOTE=MCPeePants;16359438]So wrapping vector textures onto a model or more complicated objects would be a whole different ball game right? lol[/QUOTE]
If you define the function I declared, you can use it interchangeably with normal textures.
Well, one huge downside is you never see photo realistic vector images that aren't huge. I think it would work well for a certain art style like cel-shaded, or one like okami. But you probably won't get anything that looks MORE realistic than regular textures since that can be just a high res picture of the actual object.
[QUOTE=Cathbadh;16359557]If you define the function I declared, you can use it interchangeably with normal textures.[/QUOTE]
I'll definitely have to wise up in this area. I think this would be a great (albeit large) project to work on. Thanks for all of your help!
[editline]07:30PM[/editline]
[QUOTE=jivemasta;16359996]Well, one huge downside is you never see photo realistic vector images that aren't huge. I think it would work well for a certain art style like cel-shaded, or one like okami. But you probably won't get anything that looks MORE realistic than regular textures since that can be just a high res picture of the actual object.[/QUOTE]
But the adding of more vectored details the closer you get could emphasize realism. Creating the high res picture is basically the thing here.
You could have more textures from the minimal size the vectors consist of (memory wise).
[QUOTE=Siduron;16355749].... in 10 years we'll all say "Lol, crysis has ugly graphics".[/QUOTE]
While I see the point you're making, I can't necessarily agree. GPU's can get faster, but as far as the graphics themselves, once it reaches past the [url=http://en.wikipedia.org/wiki/Uncanny_valley]uncanny valley[/url], there's nowhere else for it to go. (Except to increase immersion through VR technology and such.)
[QUOTE=jivemasta;16359996]Well, one huge downside is you never see photo realistic vector images that aren't huge. I think it would work well for a certain art style like cel-shaded, or one like okami. But you probably won't get anything that looks MORE realistic than regular textures since that can be just a high res picture of the actual object.[/QUOTE]
You could use them as overlays.
Something like a traffic sign could be a yellow and black vector overlay/mask for a metal base texture.
The base texture provides the photorealistic detail, and the vector gives you nice crisp edges.
Sorry, you need to Log In to post a reply to this thread.