Difference between revisions of "Povray"

From Ghoulwiki
Jump to: navigation, search
 
(36 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
=== see also ===
  
=== explosion generator ===
+
* http://ghoulsblade.schattenkind.net/files/pov/
* todo...
+
* http://www.ogre3d.org/tikiwiki/POVRay+Skyboxes
 +
* http://www.ogre3d.org/tikiwiki/POVRay+Explosions
 +
* spacescape skybox maker : http://www.ogre3d.org/forums/viewtopic.php?f=11&t=56125#p380926
  
 
=== skybox ===  
 
=== skybox ===  
* todo...
+
* http://ghoulsblade.schattenkind.net/files/pov/skybox1.pov
* renderskybox.php <pre>
+
* http://ghoulsblade.schattenkind.net/files/pov/renderskybox.php.txt  (optional, execute using php to generate all six faces with one command)
#!/usr/bin/php
+
(this is hereby released under public domain)
<?php
 
/*
 
This script renders 6 sides of a skybox with povray.
 
Written in PHP, to execute "apt-get install php4-cli"
 
*/
 
// resolution in pixels, height=weight=size
 
$size = 256; // 32^x ??
 
// $size = 128;
 
// $size = 256;
 
$infile = "skybox1.pov";
 
$outfile_prefix = "ghoulskybox1";
 
$outfile_postfix = ".png";
 
  
$frame_name = array();  // ogre skybox naming sheme
+
placing a camera inside an explosion and maybe cutting out the interior gives nice skyboxes for spacegames (like http://sfz.schattenkind.net), see info below on how to generate such explosions/plasma effects
$frame_name[0] = "_fr"; // front
 
$frame_name[1] = "_rt"; // right
 
$frame_name[2] = "_bk"; // back
 
$frame_name[3] = "_lf"; // left
 
$frame_name[4] = "_up"; // up
 
$frame_name[5] = "_dn"; // down
 
  
 +
i suggest rendering stars onto the skybox ingame using dots or tiny billboards, this way they will look  sharp even if the skybox is not ultra-highres.
  
for ($i=0;$i<6;++$i) {
+
==== space, bright red ====
echo "rendering frame ".($i+1)."/6:\n";
+
<gallery>
$outfile = $outfile_prefix . $frame_name[$i] . $outfile_postfix;
+
Image:Ghoulskybox1_bk.jpg
shell_exec("povray  -I$infile -H$size -W$size +FN16 -D -O$outfile -K$i");
+
Image:Ghoulskybox1_dn.jpg
//shell_exec("povray  -I$infile -H$size -W$size +FT -D -O$outfile -K$i");
+
Image:Ghoulskybox1_fr.jpg
//shell_exec("convert $outfile ".str_replace(".tga",".jpg",$outfile));
+
Image:Ghoulskybox1_lf.jpg
}
+
Image:Ghoulskybox1_up.jpg
echo "done.\n";
+
Image:Ghoulskybox1_rt.jpg
 +
</gallery>
 +
(these rendered images are hereby released under public domain)
  
/*
+
see also http://sfz.schattenkind.net/wiki/index.php/Screenshots  for more screenshots of those skyboxes in action
ogre sample space skybox named "Examples/SpaceSkyBox"
 
is stored in ogrenew/Samples/Media/materials/scripts/Example.material
 
and looks like this :
 
material Examples/SpaceSkyBox
 
{
 
technique
 
{
 
pass
 
{
 
lighting off
 
depth_write off
 
 
texture_unit
 
{
 
cubic_texture stevecube.jpg separateUV
 
tex_address_mode clamp
 
}
 
}
 
}
 
}
 
the stevecube.jpg adresses 6 images, which are zipped in ogrenew/Samples/Media/packs/skybox.zip
 
stevecube_UP.jpg
 
stevecube_FR.jpg
 
stevecube_DN.jpg
 
stevecube_BK.jpg
 
stevecube_LF.jpg
 
stevecube_RT.jpg
 
 
the povray camera for the skybox should be something like this
 
camera {
 
  location <0,0,0>
 
  angle 90
 
  right <1,0,0> up <0,1,0>
 
  // turn the cam based on the current frame=clock : [0-5]
 
  #switch (clock)
 
#range (0,3)
 
  // first 4 frames : turn from left to right
 
  rotate (90*clock)*y
 
#break
 
#case (4)
 
  // look at the sky
 
  rotate 90*x
 
#break
 
#case (5)
 
  // look at the ground
 
  rotate -90*x
 
#break
 
  #end // End of conditional part
 
}
 
*/
 
?>
 
</pre>
 
  
skybox1.pov
+
==== space, dark green ====
<pre>
+
<gallery>
// Persistence of Vision Raytracer Version 3.5 Scene Description File
+
Image:Ghoulskybox2_bk.jpg
//*******************************************
+
Image:Ghoulskybox2_dn.jpg
 +
Image:Ghoulskybox2_fr.jpg
 +
Image:Ghoulskybox2_lf.jpg
 +
Image:Ghoulskybox2_rt.jpg
 +
Image:Ghoulskybox2_up.jpg
 +
Image:Povray_skybox_in_sfz.jpg|here's how it looks in action with stars rendered onto it at runtime
 +
</gallery>
 +
(these rendered images are hereby released under public domain)
  
global_settings {
+
==== clouds ====
  //max_trace_level 5
 
}
 
  
#include "colors.inc"
+
3 cloudy skyboxes
 +
* http://ghoulsblade.schattenkind.net/files/pov/povskyclouds.zip  (.pov files and rendered images)
 +
a few samples :
 +
<gallery>
 +
Image:Cloudskybox_bk.jpg
 +
Image:Cloudskybox2_dn.jpg
 +
Image:Cloudskybox3_up.jpg
 +
</gallery>
 +
(these rendered images and the .pov files are hereby released under public domain)
  
camera {
+
=== texture generation ===
  location <0,0,0>
+
* todo : search .pov files for this
  angle 90
+
* todo : camouflage texture...
  right <1,0,0> up <0,1,0>
+
* also interesting : kwerkzeug (google)
  // turn the cam based on the current frame=clock : [0-5]
+
<gallery>
  #switch (clock)
+
Image:Infrared.jpg
    #range (0,3)
+
Image:Camouflage.png
      // first 4 frames : turn from left to right
+
</gallery>
      rotate (90*clock)*y
 
    #break
 
    #case (4)
 
      // look at the sky
 
      rotate -90*x
 
    #break
 
    #case (5)
 
      // look at the ground
 
      rotate 90*x
 
    #break
 
  #end // End of conditional part
 
}
 
  
background { color rgb <0,0,0> }
+
=== explosion ===
 +
<gallery>
 +
Image:Pov_exp1.png
 +
</gallery>
 +
http://ghoulsblade.schattenkind.net/files/pov/explosion01.pov
  
// light_source { <100, 100, -200> color White }
+
=== random explosion generation ===
  
 +
i made a php script that would generated random colormaps and some random turbulence parameters
 +
and let it render all night long, producing one explosion image after another, and keeping the sources for later high-detail rendering of the good ones.
  
sphere { < 0, 0, 0>, 2
+
this is kind of bruteforcing artwork with enough processor power =)
pigment { rgbt 1 } // surface of sphere is transparent
 
interior {
 
media {
 
emission 0.02
 
intervals 1
 
samples 25
 
method 3
 
density {
 
spherical
 
ramp_wave
 
        translate 1.0*y  // replace 1.0 = t  by time for animation
 
        warp { turbulence 1.5 }
 
        translate -1.0*y // replace -1.0 = -t  by time for animation
 
color_map {
 
[0.0 color rgb <0, 0, 0>]
 
[0.1 color rgb <1, 0, 0>]
 
[0.5 color rgb <1, 1, 0>]
 
[1.0 color rgb <1, 1, 0>]
 
}
 
}
 
}
 
}
 
scale 25
 
hollow
 
}
 
</pre>
 
  
=== explosion ===
+
also there are a few php scripts in there for comfortable viewing and marking the good ones,
[[Image:Pov_exp1.png]]<br>
+
but you'll have to adjust them a bit.
<pre>
+
 
// Persistence of Vision Raytracer Version 3.5 Scene Description File
+
here are a few samples :
//*******************************************
+
 
 +
<gallery>
 +
Image:Explode2.jpg
 +
Image:Plasma.jpg
 +
Image:Exp_001770_000.jpg
 +
Image:Exp_002112_000.jpg
 +
Image:Macroparticle_sfz.jpg|macro particles
 +
</gallery>
 +
i generated a few thousand of those, you can find them and their sourcefiles (in breed) here :
 +
http://ghoulsblade.schattenkind.net/files/pov/povray_exploder/<br>
 +
(these are hereby released under public domain)<br>
 +
(the best ones are in exploder_nice.zip, ca 20mb, sourcefiles (.pov) included)<br>
 +
 
 +
possible uses :
 +
* macro particles for explosions (see sample above)
 +
* billboard-textures for energy/plasma weapon-projectiles
 +
* basis for skyboxes for nebulae-like scenes in spacegames (see above)
 +
* basis for explosion animations (animate __TURBSTART__, see http://www.ogre3d.org/tikiwiki/POVRay+Explosions)
 +
* as background billboard for halo/hilighting effects
 +
* "shield hit" effects
 +
* wormholes/teleporter effects
 +
* cloud/nebulae particles (make color uniform)
 +
* some might look rather nice when used as spheremap or something like that in reflection effects
 +
* [http://de.wikipedia.org/wiki/Rorschach-Test Rorschach test]  ;)
 +
* ...
 +
 
 +
 
 +
and here's the code :
 +
 
 +
http://ghoulsblade.schattenkind.net/files/pov/exploder.zip
 +
 
 +
warning ! requires quite a bit of harddisk space if you keep it running for a long time....
  
global_settings {
+
i give no warranty that your computer will not explode during the process ;)
  max_trace_level 5
 
}
 
  
#include "colors.inc"
+
you can also create nice skyboxes from these, see above
  
camera {
+
=== random planet texture generation ===
location <-1.5, 30, -150>
 
look_at <0, 25, 35>
 
angle 35
 
}
 
  
background { color rgb 0 }
+
idea (not tried yet) : random materials on the inside of a sphere with a spherical cam in the middle will produce a texture which can directly used with polar coordinates as texcoords.
  
// light_source { <100, 100, -200> color White }
+
seperate textures can be used for ground and (possibly multiple) cloud layers to animate.
  
 +
== projects using some of these ==
 +
i actually stumbled upon a project using some of my skyboxes =D enjoy
  
sphere { < 0, 0, 0>, 2
+
* http://sourceforge.net/projects/opengate/
pigment { rgbt 1 } // surface of sphere is transparent
 
interior {
 
media {
 
emission 0.02
 
intervals 1
 
samples 25
 
method 3
 
density {
 
spherical
 
ramp_wave
 
        translate 1.0*// replace 1.0 = t  by time for animation
 
        warp { turbulence 1.5 }
 
        translate -1.0*y // replace -1.0 = -t  by time for animation
 
color_map {
 
[0.0 color rgb <0, 0, 0>]
 
[0.1 color rgb <1, 0, 0>]
 
[0.5 color rgb <1, 1, 0>]
 
[1.0 color rgb <1, 1, 0>]
 
}
 
}
 
}
 
}
 
scale 25
 
translate 25*y
 
hollow
 
}
 
</pre>
 

Latest revision as of 12:49, 2 January 2011

see also

skybox

(this is hereby released under public domain)

placing a camera inside an explosion and maybe cutting out the interior gives nice skyboxes for spacegames (like http://sfz.schattenkind.net), see info below on how to generate such explosions/plasma effects

i suggest rendering stars onto the skybox ingame using dots or tiny billboards, this way they will look sharp even if the skybox is not ultra-highres.

space, bright red

(these rendered images are hereby released under public domain)

see also http://sfz.schattenkind.net/wiki/index.php/Screenshots for more screenshots of those skyboxes in action

space, dark green

(these rendered images are hereby released under public domain)

clouds

3 cloudy skyboxes

a few samples :

(these rendered images and the .pov files are hereby released under public domain)

texture generation

  • todo : search .pov files for this
  • todo : camouflage texture...
  • also interesting : kwerkzeug (google)

explosion

http://ghoulsblade.schattenkind.net/files/pov/explosion01.pov

random explosion generation

i made a php script that would generated random colormaps and some random turbulence parameters and let it render all night long, producing one explosion image after another, and keeping the sources for later high-detail rendering of the good ones.

this is kind of bruteforcing artwork with enough processor power =)

also there are a few php scripts in there for comfortable viewing and marking the good ones, but you'll have to adjust them a bit.

here are a few samples :

i generated a few thousand of those, you can find them and their sourcefiles (in breed) here : http://ghoulsblade.schattenkind.net/files/pov/povray_exploder/
(these are hereby released under public domain)
(the best ones are in exploder_nice.zip, ca 20mb, sourcefiles (.pov) included)

possible uses :

  • macro particles for explosions (see sample above)
  • billboard-textures for energy/plasma weapon-projectiles
  • basis for skyboxes for nebulae-like scenes in spacegames (see above)
  • basis for explosion animations (animate __TURBSTART__, see http://www.ogre3d.org/tikiwiki/POVRay+Explosions)
  • as background billboard for halo/hilighting effects
  • "shield hit" effects
  • wormholes/teleporter effects
  • cloud/nebulae particles (make color uniform)
  • some might look rather nice when used as spheremap or something like that in reflection effects
  • Rorschach test  ;)
  • ...


and here's the code :

http://ghoulsblade.schattenkind.net/files/pov/exploder.zip

warning ! requires quite a bit of harddisk space if you keep it running for a long time....

i give no warranty that your computer will not explode during the process ;)

you can also create nice skyboxes from these, see above

random planet texture generation

idea (not tried yet) : random materials on the inside of a sphere with a spherical cam in the middle will produce a texture which can directly used with polar coordinates as texcoords.

seperate textures can be used for ground and (possibly multiple) cloud layers to animate.

projects using some of these

i actually stumbled upon a project using some of my skyboxes =D enjoy