Talk:Main Page

From Sunflow Wiki

Jump to: navigation, search

There are some changes coming to the next version of Sunflow that deal with the .sc format and command line flags. Rather than edit the already existing pages for these I thought I would jot down these issues so I don't forget them.

Contents


Wire Frame Shader

The wireframe shader is now one of the "texture" shaders. It can be linked up to an ambient occlusion shader, or diffuse shader, or any other. You can even plug one wireframe shader into another.

I've kept on extending the .sc file format as well since it avoids having to rewrite the exporters. Here's is what it looks like in the rhino scene for example:

Code:

texture { 
   name twire 
   type wireframe 
   line 0.5 0.5 0.5
}

texture { 
   name wire 
   type wireframe 
   fill link twire
   patches true 

shader { 
   name ao 
   type amb-occ
   bright link wire 
   dark 0 0 0 
   samples 4 
   dist 100
} 

override ao true

The first wireframe shader shows the tesselated edges, the next shows the patch edges, and the result of that is used at the "bright" color for the ambocc shader.


I've also made the command line a bit more flexible, so you can now say:

Code:

./sunflow ... -quick_patchwire -quick_ambocc 0 .... filename.sc

and have the patch wireframe automatically hookup to the ambient occlusion shader.

Command Line Changes

Removed: -nocaustics -h

Added: -view_gi -quick_patchwire

Subdivision Surfaces

Implements Catmull-Clark type subdivisions from raw mesh data. Currently there is a constant level via the number of iterations.

object {
       shader myshader
       type polygon-mesh
       name "mycube"
       subdivs 3           ## number of catmull-clark iterations
       smooth true       ## computes smooth normals automatically when true
       points 8
               -0.5 -0.5 0.5
               0.5 -0.5 0.5
               -0.5 0.5 0.5
               0.5 0.5 0.5
               -0.5 0.5 -0.5
               0.5 0.5 -0.5
               -0.5 -0.5 -0.5
               0.5 -0.5 -0.5
       nsides 6
               4
               4
               4
               4
               4
               4
       indices
               0 1 3 2
               2 3 5 4
               4 5 7 6
               6 7 1 0
               1 7 5 3
               6 0 2 4
}

Textures

texture {
   name warp_stained_tex
   type place2d
   repeat 3 2
   rotate 32
   shift 0 0
   repeatBorder false true
   input link stained_tex  ## this is the actual texture that will be warped
   outside 0.2 0.3 0.4 ## color used when not repeating (could be
  another texture!)
}