<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.povray.org/content?action=history&amp;feed=atom&amp;title=Reference%3ADensity_File_Pattern</id>
	<title>Reference:Density File Pattern - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.povray.org/content?action=history&amp;feed=atom&amp;title=Reference%3ADensity_File_Pattern"/>
	<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=Reference:Density_File_Pattern&amp;action=history"/>
	<updated>2026-04-06T18:24:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.povray.org/content?title=Reference:Density_File_Pattern&amp;diff=6830&amp;oldid=prev</id>
		<title>Jholsenback: 1 revision: Reference Migration Initial Load</title>
		<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=Reference:Density_File_Pattern&amp;diff=6830&amp;oldid=prev"/>
		<updated>2012-03-15T19:06:04Z</updated>

		<summary type="html">&lt;p&gt;1 revision: Reference Migration Initial Load&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:06, 15 March 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Jholsenback</name></author>
	</entry>
	<entry>
		<id>https://wiki.povray.org/content?title=Reference:Density_File_Pattern&amp;diff=6829&amp;oldid=prev</id>
		<title>Jholsenback: 1 revision: Initial Load (TF)</title>
		<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=Reference:Density_File_Pattern&amp;diff=6829&amp;oldid=prev"/>
		<updated>2012-03-11T22:28:00Z</updated>

		<summary type="html">&lt;p&gt;1 revision: Initial Load (TF)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Patterns]]&lt;br /&gt;
{{#indexentry:density_file, keyword}}&lt;br /&gt;
{{#indexentry:density_file, pattern}}&lt;br /&gt;
{{#indexentry:keyword, density_file}}&lt;br /&gt;
{{#indexentry:pattern, density_file}} &lt;br /&gt;
{{#indexentry:df3, density_file}}&lt;br /&gt;
{{#indexentry:keyword, df3}} &lt;br /&gt;
{{#indexentry:interpolate, density_file}}&lt;br /&gt;
{{#indexentry:keyword, interpolate}} &lt;br /&gt;
{{#indexentry:df3}}&lt;br /&gt;
&amp;lt;p&amp;gt;The &amp;lt;code&amp;gt;density_file&amp;lt;/code&amp;gt; pattern is a 3-D bitmap pattern that&lt;br /&gt;
occupies a unit cube from location &amp;amp;lt;0,0,0&amp;amp;gt; to &amp;amp;lt;1,1,1&amp;amp;gt;. The data&lt;br /&gt;
file is a raw binary file format created for POV-Ray called &amp;lt;code&amp;gt;df3&amp;lt;/code&amp;gt;&lt;br /&gt;
format. The syntax provides for the possibility of implementing other formats&lt;br /&gt;
in the future. This pattern was originally created for use with &amp;lt;code&amp;gt;&lt;br /&gt;
halo&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;media&amp;lt;/code&amp;gt; but it may be used anywhere any pattern may&lt;br /&gt;
be used. The syntax is:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pigment {&lt;br /&gt;
  density_file df3 &amp;amp;quot;filename.df3&amp;amp;quot;&lt;br /&gt;
  [interpolate Type] [PIGMENT_MODIFIERS...]&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;where &amp;lt;em&amp;gt;&amp;lt;code&amp;gt;&amp;amp;quot;filename.df3&amp;amp;quot;&amp;lt;/code&amp;gt;&amp;lt;/em&amp;gt; is a file name of the&lt;br /&gt;
data file.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
As a normal pattern, the syntax is&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
normal {&lt;br /&gt;
  density_file df3 &amp;amp;quot;filename.df3&amp;amp;quot; [, Bump_Size]&lt;br /&gt;
  [interpolate Type]&lt;br /&gt;
  [NORMAL_MODIFIERS...]&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The optional float &amp;lt;em&amp;gt;&amp;lt;code&amp;gt;Bump_Size&amp;lt;/code&amp;gt;&amp;lt;/em&amp;gt; should follow the file&lt;br /&gt;
name and any other modifiers follow that.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;The density pattern occupies the unit cube regardless of the dimensions in voxels.&lt;br /&gt;
It remains at 0.0 for all areas beyond the unit cube. The data in the range of 0 to 255,&lt;br /&gt;
in case of 8 bit resolution, are scaled into a float value in the range 0.0 to 1.0.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; The &amp;lt;code&amp;gt;interpolate&amp;lt;/code&amp;gt; keyword may be specified to add interpolation&lt;br /&gt;
of the data. The default value of zero specifies no interpolation. A value of&lt;br /&gt;
one specifies tri-linear interpolation, a value of two specifies tri-cubic&lt;br /&gt;
interpolation&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt; See the sample scenes for data file &amp;lt;code&amp;gt;include\spiral.df3&amp;lt;/code&amp;gt;,and&lt;br /&gt;
the scenes which use it: &amp;lt;code&amp;gt;~scenes\textures\patterns\densfile.pov&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;~scenes\interior\media\galaxy.pov&amp;lt;/code&amp;gt; for examples.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==df3 file format==&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt;Header:&amp;lt;!--&amp;lt;/dt&amp;gt;---&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt; The &amp;lt;code&amp;gt;df3&amp;lt;/code&amp;gt; format consists of a 6 byte header of three&lt;br /&gt;
16-bit integers with high order byte first. These three values give the&lt;br /&gt;
x,y,z size of the data in pixels (or more appropriately called &amp;lt;em&amp;gt;voxels&lt;br /&gt;
&amp;lt;/em&amp;gt;).&amp;lt;!--&amp;lt;/dd&amp;gt;---&amp;gt;&lt;br /&gt;
&amp;lt;dt&amp;gt;Data:&amp;lt;!--&amp;lt;/dt&amp;gt;---&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt; The header is followed by x*y*z unsigned integer bytes of data with a&lt;br /&gt;
resolution of 8, 16 or 32 bit. The data are written with high order byte&lt;br /&gt;
first (big-endian). The resolution of the data is determined by the size&lt;br /&gt;
of the df3-file. That is, if the file is twice (minus header, of course)&lt;br /&gt;
as long as an 8 bit file then it is assumed to contain 16 bit ints and&lt;br /&gt;
if it is four times as long 32 bit ints.&amp;lt;!--&amp;lt;/dd&amp;gt;---&amp;gt;&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jholsenback</name></author>
	</entry>
</feed>