Sampling Geometry for Textures - Printable Version +- Xonotic Forums (https://forums.xonotic.org) +-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10) +--- Forum: Xonotic - Development (https://forums.xonotic.org/forumdisplay.php?fid=12) +--- Thread: Sampling Geometry for Textures (/showthread.php?tid=1431) |
Sampling Geometry for Textures - master[mind] - 01-04-2011 This is a crazy...good idea that popped into my head, give a quick listen. Struggling with that relief map shader code made me want to find a better method of rendering the 3dish look. First off: Jaykay, if it's truly clipping the heightmap(looks like it is ) then what if we jitter in values slightly larger than 1, thus exceeding the bounds of the texture. Anyways, the idea: Take our wonderful texture, and offscreen, map it to geometry based on the height/normal map. Keep that offscreen in the GPU memory. When an object needs that texture, grab all the light sources, and shine them on the offscreen texture. Then apply gloss/cubemaps to the offscreen texture. Using the position of the texture in the image being rendered on screen, find the point that intersects based on camera angle and that position. Use it as the texture. It should require far less passes then relief mapping, and without realtime lighting would allow someone unable to use relief mapping to have a 3d effect with little performance hit(in theory). I'll try to get some example images when I get home. The time saver is the reuse factor. Without having to account for lighting(and the big lighting hit is the relief map and not the geometry) the same exact offscreen item could be used for every instance of that texture in the scene. Granted, applying cubemapping requires a little extra GPU time, but the performance hit vs using relief mapping should be rather nice. RE: Sampling Geometry for Textures - unfa - 07-05-2011 +1 |