Simple sphere

Get technical support about the C++ source code and about Lua scripts for maps, entities, GUIs, the console, materials, etc. Also covered are the Cafu libraries and APIs, as well as compiling, linking, and the build system.
Post Reply
afgho
Posts:14
Joined:2012-06-12, 13:08
Simple sphere

Post by afgho » 2012-06-19, 20:20

Hello,

i implemented a sky shader in Cafu however it need to be applied onto a sphere, i tried to make one using CaWe sphere brush but got the error "Stopped by leak", tried bezier patch and it work but the sky look bad (due to the shape), i thought i could use a model but it seem a bit overkill... is there something i could use to build it from scratch using the engine methods? looked at the documentation but a bit overwhelmed by it atm

Also, when i tested the shader with a bezier patch i could not delete the skybox due to the leak error, even if the world was inside the sphere, is there any way to get rid of the skybox and replace it by something else?
HWGuy
Posts:95
Joined:2011-05-31, 07:37

Re: Simple sphere

Post by HWGuy » 2012-06-19, 20:27

Most games don't use a sphere or dome for the skybox, instead it's a box that has a spherical projection on it. You can speed up the shader by having a vector map instead of texture data and have an almost purely shader sky.
Some games use a dome mesh tied to player position, not many.
afgho
Posts:14
Joined:2012-06-12, 13:08

Re: Simple sphere

Post by afgho » 2012-06-20, 00:50

I might just modify the shader then, seem not too complex to do.

The shader is based on this paper which assume a sky dome:
http://http.developer.nvidia.com/GPUGem ... ter16.html

EDIT: Err, actually harder than i thought. :roll:
User avatar
Carsten
Site Admin
Posts:2170
Joined:2004-08-19, 13:46
Location:Germany
Contact:

Re: Simple sphere

Post by Carsten » 2012-06-20, 23:11

Well, the nice feature about cube-mapping is that we can have sky surfaces in a map everywhere, without being required to put huge cubes around the map or the player; it's all in the shaders, no actual geometry involved.

I've only glanced at the paper, but I wonder if something like that cannot be implemented in the pixel shader, combining the idea of cube mapping with the algorithm described there, getting rid of the spherical geometry... (and don't be surprised if many of the items presented in the GPU Gems only work in very specific settings... only very few of them are actually useful in general cases).
Best regards,
Carsten
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests