bump to version 0.6.0
parent
90f75a19cb
commit
5aac89e1ef
|
@ -3,264 +3,264 @@
|
||||||
<!-- Stylesheet to upgrade pre-0.3.0 scenes -->
|
<!-- Stylesheet to upgrade pre-0.3.0 scenes -->
|
||||||
|
|
||||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
|
||||||
<xsl:output method="xml" indent="yes" encoding="utf-8"/>
|
<xsl:output method="xml" indent="yes" encoding="utf-8"/>
|
||||||
<xsl:preserve-space elements="*"/>
|
<xsl:preserve-space elements="*"/>
|
||||||
|
|
||||||
<xsl:template match="scene">
|
<xsl:template match="scene">
|
||||||
<scene>
|
<scene>
|
||||||
<xsl:attribute name="version">0.3.0</xsl:attribute>
|
<xsl:attribute name="version">0.3.0</xsl:attribute>
|
||||||
<xsl:apply-templates select="node()"/>
|
<xsl:apply-templates select="node()"/>
|
||||||
</scene>
|
</scene>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Replace the old version of the lookAt tag -->
|
<!-- Replace the old version of the lookAt tag -->
|
||||||
<xsl:template match="lookAt[@ox]">
|
<xsl:template match="lookAt[@ox]">
|
||||||
<scale x="-1"/>
|
<scale x="-1"/>
|
||||||
<lookAt>
|
<lookAt>
|
||||||
<xsl:attribute name="origin">
|
<xsl:attribute name="origin">
|
||||||
<xsl:value-of select="@ox"/>
|
<xsl:value-of select="@ox"/>
|
||||||
<xsl:text>, </xsl:text>
|
<xsl:text>, </xsl:text>
|
||||||
<xsl:value-of select="@oy"/>
|
<xsl:value-of select="@oy"/>
|
||||||
<xsl:text>, </xsl:text>
|
<xsl:text>, </xsl:text>
|
||||||
<xsl:value-of select="@oz"/>
|
<xsl:value-of select="@oz"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
<xsl:attribute name="target">
|
<xsl:attribute name="target">
|
||||||
<xsl:value-of select="@tx"/>
|
<xsl:value-of select="@tx"/>
|
||||||
<xsl:text>, </xsl:text>
|
<xsl:text>, </xsl:text>
|
||||||
<xsl:value-of select="@ty"/>
|
<xsl:value-of select="@ty"/>
|
||||||
<xsl:text>, </xsl:text>
|
<xsl:text>, </xsl:text>
|
||||||
<xsl:value-of select="@tz"/>
|
<xsl:value-of select="@tz"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
<xsl:if test="@ux">
|
<xsl:if test="@ux">
|
||||||
<xsl:attribute name="up">
|
<xsl:attribute name="up">
|
||||||
<xsl:value-of select="@ux"/>
|
<xsl:value-of select="@ux"/>
|
||||||
<xsl:text>, </xsl:text>
|
<xsl:text>, </xsl:text>
|
||||||
<xsl:value-of select="@uy"/>
|
<xsl:value-of select="@uy"/>
|
||||||
<xsl:text>, </xsl:text>
|
<xsl:text>, </xsl:text>
|
||||||
<xsl:value-of select="@uz"/>
|
<xsl:value-of select="@uz"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</lookAt>
|
</lookAt>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="shape">
|
<xsl:template match="shape">
|
||||||
<xsl:copy>
|
<xsl:copy>
|
||||||
<xsl:apply-templates select="@*|node()"/>
|
<xsl:apply-templates select="@*|node()"/>
|
||||||
|
|
||||||
<!-- The vertical component of OBJ texture coordinates is now
|
<!-- The vertical component of OBJ texture coordinates is now
|
||||||
flipped, which seems to be the standard behavior. Undo
|
flipped, which seems to be the standard behavior. Undo
|
||||||
this change for consistency in old scenes. -->
|
this change for consistency in old scenes. -->
|
||||||
<xsl:if test="@type='obj'">
|
<xsl:if test="@type='obj'">
|
||||||
<boolean name="flipTexCoords" value="false"/>
|
<boolean name="flipTexCoords" value="false"/>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
|
||||||
<!-- Apply a diffuse material to shapes that don't have any media or BSDFs -->
|
<!-- Apply a diffuse material to shapes that don't have any media or BSDFs -->
|
||||||
<xsl:if test="not(bsdf) and not(ref) and not(medium) and not(subsurface)">
|
<xsl:if test="not(bsdf) and not(ref) and not(medium) and not(subsurface)">
|
||||||
<bsdf type="diffuse"/>
|
<bsdf type="diffuse"/>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
</xsl:copy>
|
</xsl:copy>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- There are no more 'diffuseAmount' or 'specularAmount' parameters in
|
<!-- There are no more 'diffuseAmount' or 'specularAmount' parameters in
|
||||||
the microfacet/phong/ward plugins, and the default values have changed -->
|
the microfacet/phong/ward plugins, and the default values have changed -->
|
||||||
<xsl:template match="bsdf[@type='microfacet' or @type='phong' or @type='ward']">
|
<xsl:template match="bsdf[@type='microfacet' or @type='phong' or @type='ward']">
|
||||||
<xsl:variable name="diffuseAmount">
|
<xsl:variable name="diffuseAmount">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="float[@name='diffuseAmount']">
|
<xsl:when test="float[@name='diffuseAmount']">
|
||||||
<xsl:value-of select="float[@name='diffuseAmount']/@value"/>
|
<xsl:value-of select="float[@name='diffuseAmount']/@value"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>1.0</xsl:otherwise>
|
<xsl:otherwise>1.0</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<xsl:variable name="specularAmount">
|
<xsl:variable name="specularAmount">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="float[@name='specularAmount']">
|
<xsl:when test="float[@name='specularAmount']">
|
||||||
<xsl:value-of select="float[@name='specularAmount']/@value"/>
|
<xsl:value-of select="float[@name='specularAmount']/@value"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>1.0</xsl:otherwise>
|
<xsl:otherwise>1.0</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<xsl:variable name="specularReflectance">
|
<xsl:variable name="specularReflectance">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="@type='microfacet'">1.0</xsl:when>
|
<xsl:when test="@type='microfacet'">1.0</xsl:when>
|
||||||
<xsl:when test="@type='phong'">0.2</xsl:when>
|
<xsl:when test="@type='phong'">0.2</xsl:when>
|
||||||
<xsl:when test="@type='ward'">0.2</xsl:when>
|
<xsl:when test="@type='ward'">0.2</xsl:when>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
<xsl:variable name="diffuseReflectance">
|
<xsl:variable name="diffuseReflectance">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="@type='microfacet'">0.0</xsl:when>
|
<xsl:when test="@type='microfacet'">0.0</xsl:when>
|
||||||
<xsl:when test="@type='phong'">0.5</xsl:when>
|
<xsl:when test="@type='phong'">0.5</xsl:when>
|
||||||
<xsl:when test="@type='ward'">0.5</xsl:when>
|
<xsl:when test="@type='ward'">0.5</xsl:when>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:variable>
|
</xsl:variable>
|
||||||
|
|
||||||
<bsdf>
|
<bsdf>
|
||||||
<xsl:apply-templates select="@*"/>
|
<xsl:apply-templates select="@*"/>
|
||||||
|
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="node()[@name='diffuseReflectance']">
|
<xsl:when test="node()[@name='diffuseReflectance']">
|
||||||
<xsl:apply-templates select="node()[@name='diffuseReflectance']" mode="scaled">
|
<xsl:apply-templates select="node()[@name='diffuseReflectance']" mode="scaled">
|
||||||
<xsl:with-param name="scale" select="$diffuseAmount"/>
|
<xsl:with-param name="scale" select="$diffuseAmount"/>
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<spectrum name="diffuseReflectance" value="{number($diffuseAmount)*number($diffuseReflectance)}"/>
|
<spectrum name="diffuseReflectance" value="{number($diffuseAmount)*number($diffuseReflectance)}"/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
|
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="node()[@name='specularReflectance']">
|
<xsl:when test="node()[@name='specularReflectance']">
|
||||||
<xsl:apply-templates select="node()[@name='specularReflectance']" mode="scaled">
|
<xsl:apply-templates select="node()[@name='specularReflectance']" mode="scaled">
|
||||||
<xsl:with-param name="scale" select="$specularAmount"/>
|
<xsl:with-param name="scale" select="$specularAmount"/>
|
||||||
</xsl:apply-templates>
|
</xsl:apply-templates>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<spectrum name="specularReflectance" value="{number($specularAmount)*number($specularReflectance)}"/>
|
<spectrum name="specularReflectance" value="{number($specularAmount)*number($specularReflectance)}"/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
<xsl:apply-templates select="node()[@name!='specularReflectance' and @name!='diffuseReflectance' and @name!='diffuseAmount' and @name!='specularAmount']"/>
|
<xsl:apply-templates select="node()[@name!='specularReflectance' and @name!='diffuseReflectance' and @name!='diffuseAmount' and @name!='specularAmount']"/>
|
||||||
</bsdf>
|
</bsdf>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="ref|texture|rgb|srgb|spectrum|blackbody" mode="scaled">
|
<xsl:template match="ref|texture|rgb|srgb|spectrum|blackbody" mode="scaled">
|
||||||
<xsl:param name="scale"/>
|
<xsl:param name="scale"/>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="number($scale)!=1">
|
<xsl:when test="number($scale)!=1">
|
||||||
<texture type="scale">
|
<texture type="scale">
|
||||||
<xsl:if test="@name">
|
<xsl:if test="@name">
|
||||||
<xsl:attribute name="name">
|
<xsl:attribute name="name">
|
||||||
<xsl:value-of select="@name"/>
|
<xsl:value-of select="@name"/>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
<float name="scale" value="{$scale}"/>
|
<float name="scale" value="{$scale}"/>
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="texture|ref">
|
<xsl:when test="texture|ref">
|
||||||
<xsl:copy>
|
<xsl:copy>
|
||||||
<xsl:attribute name="name">value</xsl:attribute>
|
<xsl:attribute name="name">value</xsl:attribute>
|
||||||
<xsl:apply-templates select="@*[local-name() != 'name']|node()"/>
|
<xsl:apply-templates select="@*[local-name() != 'name']|node()"/>
|
||||||
</xsl:copy>
|
</xsl:copy>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:copy>
|
<xsl:copy>
|
||||||
<xsl:attribute name="name">value</xsl:attribute>
|
<xsl:attribute name="name">value</xsl:attribute>
|
||||||
<xsl:apply-templates select="@*[local-name() != 'name']|node()"/>
|
<xsl:apply-templates select="@*[local-name() != 'name']|node()"/>
|
||||||
</xsl:copy>
|
</xsl:copy>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</texture>
|
</texture>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:copy>
|
<xsl:copy>
|
||||||
<xsl:apply-templates select="@*|node()"/>
|
<xsl:apply-templates select="@*|node()"/>
|
||||||
</xsl:copy>
|
</xsl:copy>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the parameters of the sphere plugin -->
|
<!-- Update the parameters of the sphere plugin -->
|
||||||
<xsl:template match="shape[@type='sphere']/boolean[@name='inverted']/@name">
|
<xsl:template match="shape[@type='sphere']/boolean[@name='inverted']/@name">
|
||||||
<xsl:attribute name="name">flipNormals</xsl:attribute>
|
<xsl:attribute name="name">flipNormals</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the parameters of the cylinder plugin -->
|
<!-- Update the parameters of the cylinder plugin -->
|
||||||
<xsl:template match="shape[@type='cylinder']/point[@name='p1']/@name">
|
<xsl:template match="shape[@type='cylinder']/point[@name='p1']/@name">
|
||||||
<xsl:attribute name="name">p0</xsl:attribute>
|
<xsl:attribute name="name">p0</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="shape[@type='cylinder']/point[@name='p2']/@name">
|
<xsl:template match="shape[@type='cylinder']/point[@name='p2']/@name">
|
||||||
<xsl:attribute name="name">p1</xsl:attribute>
|
<xsl:attribute name="name">p1</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the parameters of the checkerboard plugin -->
|
<!-- Update the parameters of the checkerboard plugin -->
|
||||||
<xsl:template match="texture[@type='checkerboard']/spectrum[@name='brightColor']/@name">
|
<xsl:template match="texture[@type='checkerboard']/spectrum[@name='brightColor']/@name">
|
||||||
<xsl:attribute name="name">color0</xsl:attribute>
|
<xsl:attribute name="name">color0</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="texture[@type='checkerboard']/spectrum[@name='darkColor']/@name">
|
<xsl:template match="texture[@type='checkerboard']/spectrum[@name='darkColor']/@name">
|
||||||
<xsl:attribute name="name">color1</xsl:attribute>
|
<xsl:attribute name="name">color1</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the parameters of the gridtexture plugin -->
|
<!-- Update the parameters of the gridtexture plugin -->
|
||||||
<xsl:template match="texture[@type='gridtexture']/spectrum[@name='brightColor']/@name">
|
<xsl:template match="texture[@type='gridtexture']/spectrum[@name='brightColor']/@name">
|
||||||
<xsl:attribute name="name">color0</xsl:attribute>
|
<xsl:attribute name="name">color0</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="texture[@type='gridtexture']/spectrum[@name='darkColor']/@name">
|
<xsl:template match="texture[@type='gridtexture']/spectrum[@name='darkColor']/@name">
|
||||||
<xsl:attribute name="name">color1</xsl:attribute>
|
<xsl:attribute name="name">color1</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the name of the lambertian plugin -->
|
<!-- Update the name of the lambertian plugin -->
|
||||||
<xsl:template match="bsdf[@type='lambertian']/@type">
|
<xsl:template match="bsdf[@type='lambertian']/@type">
|
||||||
<xsl:attribute name="type">diffuse</xsl:attribute>
|
<xsl:attribute name="type">diffuse</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the parameters of the ward plugin -->
|
<!-- Update the parameters of the ward plugin -->
|
||||||
<xsl:template match="bsdf[@type='ward']/float[@name='alphaX']/@name">
|
<xsl:template match="bsdf[@type='ward']/float[@name='alphaX']/@name">
|
||||||
<xsl:attribute name="name">alphaU</xsl:attribute>
|
<xsl:attribute name="name">alphaU</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="bsdf[@type='ward']/float[@name='alphaY']/@name">
|
<xsl:template match="bsdf[@type='ward']/float[@name='alphaY']/@name">
|
||||||
<xsl:attribute name="name">alphaV</xsl:attribute>
|
<xsl:attribute name="name">alphaV</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the name of the microfacet plugin -->
|
<!-- Update the name of the microfacet plugin -->
|
||||||
<xsl:template match="bsdf[@type='microfacet']/@type">
|
<xsl:template match="bsdf[@type='microfacet']/@type">
|
||||||
<xsl:attribute name="type">roughplastic</xsl:attribute>
|
<xsl:attribute name="type">roughplastic</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="bsdf[@type='microfacet']/float[@name='alphaB']/@name">
|
<xsl:template match="bsdf[@type='microfacet']/float[@name='alphaB']/@name">
|
||||||
<xsl:attribute name="name">alpha</xsl:attribute>
|
<xsl:attribute name="name">alpha</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<xsl:template match="float[@name='sizeMultiplier']/@name">
|
<xsl:template match="float[@name='sizeMultiplier']/@name">
|
||||||
<xsl:attribute name="name">densityMultiplier</xsl:attribute>
|
<xsl:attribute name="name">densityMultiplier</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- There is no more 'mirror' plugin; replace with smooth chrome -->
|
<!-- There is no more 'mirror' plugin; replace with smooth chrome -->
|
||||||
<xsl:template match="bsdf[@type='mirror']/@type">
|
<xsl:template match="bsdf[@type='mirror']/@type">
|
||||||
<xsl:attribute name="type">conductor</xsl:attribute>
|
<xsl:attribute name="type">conductor</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="bsdf[@type='mirror']">
|
<xsl:template match="bsdf[@type='mirror']">
|
||||||
<xsl:copy>
|
<xsl:copy>
|
||||||
<xsl:apply-templates select="@*|node()"/>
|
<xsl:apply-templates select="@*|node()"/>
|
||||||
<string name="material" value="Cr"/>
|
<string name="material" value="Cr"/>
|
||||||
</xsl:copy>
|
</xsl:copy>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the name of the roughmetal plugin -->
|
<!-- Update the name of the roughmetal plugin -->
|
||||||
<xsl:template match="bsdf[@type='roughmetal']/@type">
|
<xsl:template match="bsdf[@type='roughmetal']/@type">
|
||||||
<xsl:attribute name="type">roughconductor</xsl:attribute>
|
<xsl:attribute name="type">roughconductor</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="bsdf[@type='roughmetal']/float[@name='alphaB']/@name">
|
<xsl:template match="bsdf[@type='roughmetal']/float[@name='alphaB']/@name">
|
||||||
<xsl:attribute name="name">alpha</xsl:attribute>
|
<xsl:attribute name="name">alpha</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="bsdf[@type='roughmetal']/float[@name='ior']/@name">
|
<xsl:template match="bsdf[@type='roughmetal']/float[@name='ior']/@name">
|
||||||
<xsl:attribute name="name">eta</xsl:attribute>
|
<xsl:attribute name="name">eta</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the name of the roughglass plugin -->
|
<!-- Update the name of the roughglass plugin -->
|
||||||
<xsl:template match="bsdf[@type='roughglass']/@type">
|
<xsl:template match="bsdf[@type='roughglass']/@type">
|
||||||
<xsl:attribute name="type">roughdielectric</xsl:attribute>
|
<xsl:attribute name="type">roughdielectric</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
<xsl:template match="bsdf[@type='roughglass']/float[@name='alphaB']/@name">
|
<xsl:template match="bsdf[@type='roughglass']/float[@name='alphaB']/@name">
|
||||||
<xsl:attribute name="name">alpha</xsl:attribute>
|
<xsl:attribute name="name">alpha</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the name of the composite plugin -->
|
<!-- Update the name of the composite plugin -->
|
||||||
<xsl:template match="bsdf[@type='composite']/@type">
|
<xsl:template match="bsdf[@type='composite']/@type">
|
||||||
<xsl:attribute name="type">mixturebsdf</xsl:attribute>
|
<xsl:attribute name="type">mixturebsdf</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the name of the exrtexture plugin -->
|
<!-- Update the name of the exrtexture plugin -->
|
||||||
<xsl:template match="texture[@type='exrtexture']/@type">
|
<xsl:template match="texture[@type='exrtexture']/@type">
|
||||||
<xsl:attribute name="type">bitmap</xsl:attribute>
|
<xsl:attribute name="type">bitmap</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the name of the ldrtexture plugin -->
|
<!-- Update the name of the ldrtexture plugin -->
|
||||||
<xsl:template match="texture[@type='ldrtexture']/@type">
|
<xsl:template match="texture[@type='ldrtexture']/@type">
|
||||||
<xsl:attribute name="type">bitmap</xsl:attribute>
|
<xsl:attribute name="type">bitmap</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Default copy rule -->
|
<!-- Default copy rule -->
|
||||||
<xsl:template match="@*|node()">
|
<xsl:template match="@*|node()">
|
||||||
<xsl:copy>
|
<xsl:copy>
|
||||||
<xsl:apply-templates select="@*|node()"/>
|
<xsl:apply-templates select="@*|node()"/>
|
||||||
</xsl:copy>
|
</xsl:copy>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
|
@ -3,126 +3,126 @@
|
||||||
<!-- Stylesheet to upgrade from Mitsuba version 0.3.x to 0.4.0 scenes -->
|
<!-- Stylesheet to upgrade from Mitsuba version 0.3.x to 0.4.0 scenes -->
|
||||||
|
|
||||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
|
||||||
<xsl:output method="xml" indent="yes" encoding="utf-8"/>
|
<xsl:output method="xml" indent="yes" encoding="utf-8"/>
|
||||||
<xsl:preserve-space elements="*"/>
|
<xsl:preserve-space elements="*"/>
|
||||||
|
|
||||||
<!-- Update the scene version -->
|
<!-- Update the scene version -->
|
||||||
<xsl:template match="scene/@version">
|
<xsl:template match="scene/@version">
|
||||||
<xsl:attribute name="version">0.4.0</xsl:attribute>
|
<xsl:attribute name="version">0.4.0</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Cameras have been renamed to sensors -->
|
<!-- Cameras have been renamed to sensors -->
|
||||||
<xsl:template match="camera">
|
<xsl:template match="camera">
|
||||||
<sensor>
|
<sensor>
|
||||||
<xsl:apply-templates select="@*"/>
|
<xsl:apply-templates select="@*"/>
|
||||||
|
|
||||||
<!-- Handle the mapSmallerSide parameter -->
|
<!-- Handle the mapSmallerSide parameter -->
|
||||||
<xsl:if test="@type='perspective'">
|
<xsl:if test="@type='perspective'">
|
||||||
<string name="fovAxis">
|
<string name="fovAxis">
|
||||||
<xsl:attribute name="value">
|
<xsl:attribute name="value">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="boolean[@name='mapSmallerSide' and @value='false']">
|
<xsl:when test="boolean[@name='mapSmallerSide' and @value='false']">
|
||||||
<xsl:text>larger</xsl:text>
|
<xsl:text>larger</xsl:text>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<xsl:text>smaller</xsl:text>
|
<xsl:text>smaller</xsl:text>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:attribute>
|
</xsl:attribute>
|
||||||
</string>
|
</string>
|
||||||
</xsl:if>
|
</xsl:if>
|
||||||
|
|
||||||
<xsl:apply-templates select="node()[not(@name) or @name!='mapSmallerSide']"/>
|
<xsl:apply-templates select="node()[not(@name) or @name!='mapSmallerSide']"/>
|
||||||
</sensor>
|
</sensor>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Fix the handedness yet once more.. -->
|
<!-- Fix the handedness yet once more.. -->
|
||||||
<xsl:template match="camera/transform[@name='toWorld']">
|
<xsl:template match="camera/transform[@name='toWorld']">
|
||||||
<transform>
|
<transform>
|
||||||
<xsl:apply-templates select="@*"/>
|
<xsl:apply-templates select="@*"/>
|
||||||
<scale x="-1"/>
|
<scale x="-1"/>
|
||||||
<xsl:apply-templates select="node()"/>
|
<xsl:apply-templates select="node()"/>
|
||||||
</transform>
|
</transform>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Rename the 'intensity' parameter of certain luminaires to 'radiance' -->
|
<!-- Rename the 'intensity' parameter of certain luminaires to 'radiance' -->
|
||||||
<xsl:template match="luminaire[@type='area' or @type='constant']/node()[@name='intensity']/@name">
|
<xsl:template match="luminaire[@type='area' or @type='constant']/node()[@name='intensity']/@name">
|
||||||
<xsl:attribute name="name">radiance</xsl:attribute>
|
<xsl:attribute name="name">radiance</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the 'intensity' parameter of directional light sources -->
|
<!-- Update the 'intensity' parameter of directional light sources -->
|
||||||
<xsl:template match="luminaire[@type='directional']/node()[@name='intensity']/@name">
|
<xsl:template match="luminaire[@type='directional']/node()[@name='intensity']/@name">
|
||||||
<xsl:attribute name="name">irradiance</xsl:attribute>
|
<xsl:attribute name="name">irradiance</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Rename the luminaireSamples parameter of the direct sampling strategy -->
|
<!-- Rename the luminaireSamples parameter of the direct sampling strategy -->
|
||||||
<xsl:template match="integrator/node()[@name='luminaireSamples']/@name">
|
<xsl:template match="integrator/node()[@name='luminaireSamples']/@name">
|
||||||
<xsl:attribute name="name">emitterSamples</xsl:attribute>
|
<xsl:attribute name="name">emitterSamples</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Rename the depth parameter of samplers -->
|
<!-- Rename the depth parameter of samplers -->
|
||||||
<xsl:template match="sampler/node()[@name='depth']/@name">
|
<xsl:template match="sampler/node()[@name='depth']/@name">
|
||||||
<xsl:attribute name="name">dimension</xsl:attribute>
|
<xsl:attribute name="name">dimension</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the name of the errctrl plugin -->
|
<!-- Update the name of the errctrl plugin -->
|
||||||
<xsl:template match="integrator[@type='errctrl']/@type">
|
<xsl:template match="integrator[@type='errctrl']/@type">
|
||||||
<xsl:attribute name="type">adaptive</xsl:attribute>
|
<xsl:attribute name="type">adaptive</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the name of the exrfilm plugin -->
|
<!-- Update the name of the exrfilm plugin -->
|
||||||
<xsl:template match="film[@type='exrfilm']/@type">
|
<xsl:template match="film[@type='exrfilm']/@type">
|
||||||
<xsl:attribute name="type">hdrfilm</xsl:attribute>
|
<xsl:attribute name="type">hdrfilm</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Translate the 'alpha' parameter in the old films -->
|
<!-- Translate the 'alpha' parameter in the old films -->
|
||||||
<xsl:template match="film/boolean[@name='alpha']">
|
<xsl:template match="film/boolean[@name='alpha']">
|
||||||
<xsl:choose>
|
<xsl:choose>
|
||||||
<xsl:when test="@value='true'">
|
<xsl:when test="@value='true'">
|
||||||
<string name="pixelFormat" value="rgba"/>
|
<string name="pixelFormat" value="rgba"/>
|
||||||
</xsl:when>
|
</xsl:when>
|
||||||
<xsl:otherwise>
|
<xsl:otherwise>
|
||||||
<string name="pixelFormat" value="rgb"/>
|
<string name="pixelFormat" value="rgb"/>
|
||||||
</xsl:otherwise>
|
</xsl:otherwise>
|
||||||
</xsl:choose>
|
</xsl:choose>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the name of the pngfilm plugin -->
|
<!-- Update the name of the pngfilm plugin -->
|
||||||
<xsl:template match="film[@type='pngfilm']/@type">
|
<xsl:template match="film[@type='pngfilm']/@type">
|
||||||
<xsl:attribute name="type">ldrfilm</xsl:attribute>
|
<xsl:attribute name="type">ldrfilm</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the 'focusDepth' attribute name -->
|
<!-- Update the 'focusDepth' attribute name -->
|
||||||
<xsl:template match="float[@name='focusDepth']/@name">
|
<xsl:template match="float[@name='focusDepth']/@name">
|
||||||
<xsl:attribute name="name">focusDistance</xsl:attribute>
|
<xsl:attribute name="name">focusDistance</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the 'intensityScale' attribute name -->
|
<!-- Update the 'intensityScale' attribute name -->
|
||||||
<xsl:template match="float[@name='intensityScale']/@name">
|
<xsl:template match="float[@name='intensityScale']/@name">
|
||||||
<xsl:attribute name="name">scale</xsl:attribute>
|
<xsl:attribute name="name">scale</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the 'densityMultiplier' attribute name -->
|
<!-- Update the 'densityMultiplier' attribute name -->
|
||||||
<xsl:template match="float[@name='densityMultiplier']/@name">
|
<xsl:template match="float[@name='densityMultiplier']/@name">
|
||||||
<xsl:attribute name="name">scale</xsl:attribute>
|
<xsl:attribute name="name">scale</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the blackbody 'multiplier' attribute name -->
|
<!-- Update the blackbody 'multiplier' attribute name -->
|
||||||
<xsl:template match="blackbody/@multiplier">
|
<xsl:template match="blackbody/@multiplier">
|
||||||
<xsl:attribute name="scale"><xsl:value-of select="."/></xsl:attribute>
|
<xsl:attribute name="scale"><xsl:value-of select="."/></xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Luminaires have been renamed to emitters -->
|
<!-- Luminaires have been renamed to emitters -->
|
||||||
<xsl:template match="luminaire">
|
<xsl:template match="luminaire">
|
||||||
<emitter>
|
<emitter>
|
||||||
<xsl:apply-templates select="@*|node()"/>
|
<xsl:apply-templates select="@*|node()"/>
|
||||||
</emitter>
|
</emitter>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Default copy rule -->
|
<!-- Default copy rule -->
|
||||||
<xsl:template match="@*|node()">
|
<xsl:template match="@*|node()">
|
||||||
<xsl:copy>
|
<xsl:copy>
|
||||||
<xsl:apply-templates select="@*|node()"/>
|
<xsl:apply-templates select="@*|node()"/>
|
||||||
</xsl:copy>
|
</xsl:copy>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
|
@ -3,23 +3,23 @@
|
||||||
<!-- Stylesheet to upgrade from Mitsuba version 0.4.x to 0.5.0 scenes -->
|
<!-- Stylesheet to upgrade from Mitsuba version 0.4.x to 0.5.0 scenes -->
|
||||||
|
|
||||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
|
||||||
<xsl:output method="xml" indent="yes" encoding="utf-8"/>
|
<xsl:output method="xml" indent="yes" encoding="utf-8"/>
|
||||||
<xsl:preserve-space elements="*"/>
|
<xsl:preserve-space elements="*"/>
|
||||||
|
|
||||||
<!-- Update the scene version -->
|
<!-- Update the scene version -->
|
||||||
<xsl:template match="scene/@version">
|
<xsl:template match="scene/@version">
|
||||||
<xsl:attribute name="version">0.5.0</xsl:attribute>
|
<xsl:attribute name="version">0.5.0</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Update the name of the bump plugin -->
|
<!-- Update the name of the bump plugin -->
|
||||||
<xsl:template match="bsdf[@type='bump']/@type">
|
<xsl:template match="bsdf[@type='bump']/@type">
|
||||||
<xsl:attribute name="type">bumpmap</xsl:attribute>
|
<xsl:attribute name="type">bumpmap</xsl:attribute>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
|
|
||||||
<!-- Default copy rule -->
|
<!-- Default copy rule -->
|
||||||
<xsl:template match="@*|node()">
|
<xsl:template match="@*|node()">
|
||||||
<xsl:copy>
|
<xsl:copy>
|
||||||
<xsl:apply-templates select="@*|node()"/>
|
<xsl:apply-templates select="@*|node()"/>
|
||||||
</xsl:copy>
|
</xsl:copy>
|
||||||
</xsl:template>
|
</xsl:template>
|
||||||
</xsl:stylesheet>
|
</xsl:stylesheet>
|
||||||
|
|
|
@ -26,13 +26,13 @@ MTS_NAMESPACE_BEGIN
|
||||||
* \brief Current release of Mitsuba
|
* \brief Current release of Mitsuba
|
||||||
* \ingroup libcore
|
* \ingroup libcore
|
||||||
*/
|
*/
|
||||||
#define MTS_VERSION "0.5.0"
|
#define MTS_VERSION "0.6.0"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Year of the current release
|
* \brief Year of the current release
|
||||||
* \ingroup libcore
|
* \ingroup libcore
|
||||||
*/
|
*/
|
||||||
#define MTS_YEAR "2014"
|
#define MTS_YEAR "2017"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A simple data structure for representing and
|
* \brief A simple data structure for representing and
|
||||||
|
|
Loading…
Reference in New Issue