Procedural Textures / Realtime Textured Sphere rendering

Procedural Textures / Realtime Textured Sphere rendering

Post by ian hawle » Sun, 30 Jul 2000 04:00:00



Hi There,

I am (also) looking for information on how to render as near as damn it
perfect spheres and texture map them.  I know it's a lot to ask, but I am
aiming high to try and achieve the best results:

I want to be able to texture map a sphere with a pattern, give it realistic
shading - close to phong would be nice! - so there is one or more specular
highlights and possibly environment map a reflection into/onto it.

And now here's the crunch.  I'd like to be able to render as many as 20
spheres realtime, very, very quickly, as quick as possible as there is some
other triangle based rendering to be performed at the same time.

If anyone has information on very very fast algo's to phong shade or
procedurally texture spheres, create highlights or quickly environment map a
sphere, I would be very grateful.

Thanks a bunch

Ian

p.s. any help on fast shadow algorithms would be appreciated too, see my
other post!
p.p.s remove nospam for direct replies.

 
 
 

Procedural Textures / Realtime Textured Sphere rendering

Post by Arclig » Sun, 30 Jul 2000 04:00:00


On Sat, 29 Jul 2000 11:15:17 +0100, "ian hawley"


>Hi There,

>I am (also) looking for information on how to render as near as damn it
>perfect spheres and texture map them.  I know it's a lot to ask, but I am
>aiming high to try and achieve the best results:

>I want to be able to texture map a sphere with a pattern, give it realistic
>shading - close to phong would be nice! - so there is one or more specular
>highlights and possibly environment map a reflection into/onto it.

>And now here's the crunch.  I'd like to be able to render as many as 20
>spheres realtime, very, very quickly, as quick as possible as there is some
>other triangle based rendering to be performed at the same time.

>If anyone has information on very very fast algo's to phong shade or
>procedurally texture spheres, create highlights or quickly environment map a
>sphere, I would be very grateful.

There is a fast sphere renderer on my website written in Q-Basic,
which might be of some help, it has a procedural texture, and phong
shading.

it's under raytracing on this page.
http://www.daniel-davies.pwp.blueyonder.co.uk/programming/basic/index...

TTFN
Arclight

Web Site:
http://www.daniel-davies.pwp.blueyonder.co.uk/

 
 
 

Procedural Textures / Realtime Textured Sphere rendering

Post by Ofer Huberma » Sun, 30 Jul 2000 04:00:00


Well, your first optimisation is very simple - render only one hemisphere.
You view only one hemisphere when looking at a sphere, the other one is
occluded.
Next, calculate the texture coordinates in-advance and store them somewhere,
the same for the coordinates of the vertices. There is an article on
texture-mapping a sphere over at Paul Bourke's (highly recommended)
homepage:

    http://www.swin.edu.au/astronomy/pbourke/texture/spheremap/

Current graphics-cards use Phong shading to calculate colour for each
vertex. However, most of them do not do it per-pixel but rather per-vertex.
When rendering a sphere this doesn't pose a serious problem, if your
geometric resolution is decent. A resolution of 36x36 seems good enough at
medium screen resolution and considering you only rendering half of the
sphere, that's about a 1000 polygons for each object. If the spheres only
occupy small part of the frame-buffer you can lower the resolution with
little or none visual quality loss. You can use connected geometric
primitives such as triangle-strips very easily here, this allows you to
lower the stress on the geometry-related part of the pipeline.
If you are really desperate and must optimize and your scene lights are
static, you can pre-calculate luminance/colour value for each vertex. This
gives you substantial speed increase as there are no lighting calculations
in real-time and you can program your own shaders.

Regarding environment maps, remember they are not supposed to be accurate
but look good. Just use the regular multi-texturing and alter the texture
matrix (I know it exists in OpenGL, don't know about other APIs).

There was a very recent OpenGL Challenge entry that displayed
procedurally-textured spheres very nicely, you might want to check it out
or/and contact its author. The OpenGL challenge can be found at:

    http://oglchallenge.dhs.org/vote.php4

Just my two cents,
    Ofer.


Quote:> Hi There,

> I am (also) looking for information on how to render as near as damn it
> perfect spheres and texture map them.  I know it's a lot to ask, but I am
> aiming high to try and achieve the best results:

> I want to be able to texture map a sphere with a pattern, give it
realistic
> shading - close to phong would be nice! - so there is one or more specular
> highlights and possibly environment map a reflection into/onto it.

> And now here's the crunch.  I'd like to be able to render as many as 20
> spheres realtime, very, very quickly, as quick as possible as there is
some
> other triangle based rendering to be performed at the same time.

> If anyone has information on very very fast algo's to phong shade or
> procedurally texture spheres, create highlights or quickly environment map
a
> sphere, I would be very grateful.

> Thanks a bunch

> Ian

> p.s. any help on fast shadow algorithms would be appreciated too, see my
> other post!
> p.p.s remove nospam for direct replies.

 
 
 

Procedural Textures / Realtime Textured Sphere rendering

Post by ian hawle » Mon, 31 Jul 2000 04:00:00


Hi There,

Thanks a lot for the info & links, i'll check them all out!

Ian