Editing Rich Appearance Format (RAF)

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 9: Line 9:


=RAF contents=
=RAF contents=
It must comply with these max restrictions :
 
It must comply with these restrictions :
  -Textures size max: 15 mb ( 15728640 Bytes ) ( on [[RSX]] local memory at run time )
  -Textures size max: 15 mb ( 15728640 Bytes ) ( on [[RSX]] local memory at run time )
  -Geometry & script size max: 1 mb ( 1048576 Bytes ) ( on main memory at run time )
  -Geometry & script size max: 1 mb ( 1048576 Bytes ) ( on main memory at run time )  
  -Actor size max: 1.25mb ( 1310720 Bytes ) ( in the intermediate buffer )
  -Actor size max: 1.25mb ( 1310720 Bytes ) ( in the intermediate buffer )  
   
  -Actor number max: 128
  -Cameras: 1 (perspective or orthographic)
  -Cameras: 1
  -Lights: 2 (ambient and/or point)
  -Lights: 2 (ambient + point)
  -Scripts: 1
  -Scripts: 1
  -Models: 64 (with 8 animations each model)
  -Actors: 128
  -Models: 64 per actor ?
  -Animations: 8 per model
  -Materials: 1 per actor ?
  -Textures: 4 per material ?


==RAF Scene (.XML)==
==RAF Scene (.XML)==
Line 35: Line 31:
The camera and lights are a bit special, there are different 2 ways to integrate them in the scene because are not visible (is imposible to see the camera because you are looking at the scene from inside of the camera) and lights are just light rays (the emitter is not visible, only the rays)... For this reason camera and lights can be completly defined in the scene.xml (so no need to create 3D object for them)... but they also admits to be defined as 3D objects (for this method is needed to create 3D objects for them, this allows for more complex lights animations or cinematic effects like camera travellings)
The camera and lights are a bit special, there are different 2 ways to integrate them in the scene because are not visible (is imposible to see the camera because you are looking at the scene from inside of the camera) and lights are just light rays (the emitter is not visible, only the rays)... For this reason camera and lights can be completly defined in the scene.xml (so no need to create 3D object for them)... but they also admits to be defined as 3D objects (for this method is needed to create 3D objects for them, this allows for more complex lights animations or cinematic effects like camera travellings)


{{Boxcode|code=<syntaxhighlight lang="xml">
{{Boxcode|content=<syntaxhighlight lang="xml">
<?xml version='1.0' encoding="UTF-8"?>
<?xml version='1.0' encoding="UTF-8"?>


<raf angle_unit="radian/degree">
<raf angle_unit="radian">
 
<!-- model -->
<model id="model" file="model.dae" vertex_color="disable/enable" >
<model id="id_model" file="model.dae" vertex_color="disable" >
<animation id="animation" file="animation.dae" start="1" end="100" sampling_rate="1" />
<animation id="animation" file="animation.dae" start="1" end="100" sampling_rate="1" />
</model>
</model>


<material id="material" effect="pure_texture/pure_texture_alpha_0_depth_1/pure_texture_alpha_1_depth_0/pure_texture_alpha_0_depth_0/basic_lighting/basic_lighting_alpha_0/basic_lighting_edge_lit/basic_lighting_edge_lit_alpha_0/basic_lighting_alpha_add" >
<!-- material -->
<texture file="texture.jpg/texture.dds" type="color_map/normal_map/specular_map/tangent_normal_map" />
<material id="id_material" effect="pure_texture" >
<texture file="texture.jpg" type="color_map" />
</material>
</material>


<actor id="actor" model="model" material="material" position="x,y,z" rotation="x,y,z" scale="x,y,z" color="r,g,b,a" uv_scale="u,v" uv_offset="u,v" anim_weight="anim0, anim1, anim2, anim3" anim_speed="anim0, anim1, anim2, anim3" anim_time="anim0, anim1, anim2, anim3" />
<!-- actor -->
<actor id="name" model="id_model" material="id_material" position="x,y,z" rotation="x,y,z" scale="x,y,z" color="r,g,b,a" uv_scale="u,v" uv_offset="u,v" anim_weight="anim0, anim1, anim2, anim3" anim_speed="anim0, anim1, anim2, anim3" anim_time="anim0, anim1, anim2, anim3" />


<camera id="camera" file="camera.dae" type="perspective/orthographic" yfov="1" ymag="1" znear="1" zfar="1" position="x,y,z" direction="x,y,z" up="x,y,z" />
<!-- camera -->
<camera id="name" file="camera.dae" type="perspective / orthographic" yfov="1" ymag="1" znear="1" zfar="1" position="x,y,z" direction="x,y,z" up="x,y,z" />


<light id="light" file="light.dae" type="ambient/point" color="r,g,b" position="x,y,z" direction="x,y,z" attenuation="1,1,1" />
<!-- light -->
<light id="name" file="light.dae" type="ambient / point" color="r,g,b" position="x,y,z" direction="x,y,z" attenuation="1,1,1" />


<!-- script -->
<script file="script.js" />
<script file="script.js" />
</raf>


</raf>
</syntaxhighlight>}}
</syntaxhighlight>}}
*Notes
*Notes
Line 67: Line 68:


{| class="wikitable"
{| class="wikitable"
|+ <raf>
|-
! Attribute !! Description
! colspan="2" {{cellcolors|blue|white}} Root Element: <raf>
|-
! Attribute  
! Description
|-
|-
| angle_unit  ||  Unit of angles in the scene file (radian/degree)
| angle_unit  ||  Unit of angles in the scene file (radian/degree)
|-
|}
|}


Line 77: Line 82:
===Model===
===Model===
{| class="wikitable"
{| class="wikitable"
|+ <model>
|-
! Attribute !! Description
! colspan="2" {{cellcolors|blue|white}} Element: <model>
|-
! Attribute  
! Description
|-
|-
| id  || String accessed as the model attribute of the <actor> element
| id  || String accessed as the model attribute of the <actor> element
Line 86: Line 94:
| vertex_color || Usage (or lack) of color regarding each vertex
| vertex_color || Usage (or lack) of color regarding each vertex
*enable/disable
*enable/disable
|-
|}
|}


====Animation====
====Animation====
{| class="wikitable"
{| class="wikitable"
|+ <animation>
|-
! Attribute !! Description
! colspan="2" {{cellcolors|lightblue|white}} Sub Element: <animation>
|-
! Attribute  
! Description
|-
|-
| id || String accessed by scripts
| id || String accessed by scripts
Line 102: Line 114:
|-
|-
| sampling_rate || Sampling rate
| sampling_rate || Sampling rate
|-
|}
|}


===Material===
===Material===
{| class="wikitable"
{| class="wikitable"
|+ <material>
|-
! Attribute !! Description
! colspan="2" {{cellcolors|blue|white}} Element: <material>
|-
! Attribute  
! Description
|-
|-
| id  || String accessed as the material attribute of the <actor> element
| id  || String accessed as the material attribute of the <actor> element
Line 121: Line 137:
* basic_lighting_edge_lit_alpha_0 : Remove alpha from basic_lighting_edge_lit
* basic_lighting_edge_lit_alpha_0 : Remove alpha from basic_lighting_edge_lit
* basic_lighting_alpha_add : Derive blending of basic_lighting by addition calculation
* basic_lighting_alpha_add : Derive blending of basic_lighting by addition calculation
* sce01 : internal/reserved ? (used in coldboot.raf compiled with raf tools v1.00)
|-
|}
|}


====Texture====
====Texture====
{| class="wikitable"
{| class="wikitable"
|+ <texture>
! colspan="2" {{cellcolors|lightblue|white}} Sub Element: <texture>
! Attribute !! Description
|-
! Attribute  
! Description
|-
|-
| file || Path to the texture file
| file || Path to the texture file
Line 136: Line 154:
*specular_map : Specular strength (G)
*specular_map : Specular strength (G)
*tangent_normal_map : Normal in tangent space, valid only for models with TEXTANGENT (RGB)
*tangent_normal_map : Normal in tangent space, valid only for models with TEXTANGENT (RGB)
|-
|}
|}


===Actor===
===Actor===
{| class="wikitable"
{| class="wikitable"
|+ <actor>
|-
! Attribute !! Description
! colspan="2" {{cellcolors|blue|white}} Element: <actor>
|-
! Attribute  
! Description
|-
|-
| id || String accessed by scripts
| id || String accessed by scripts
Line 151: Line 173:
| position || Vector to the initial position (x, y, z)
| position || Vector to the initial position (x, y, z)
|-
|-
| rotation || Vector to the initial rotation angle (x, y, z)
| rotation || Vector to the initial rotation angle (x-axis, y-axis, z-axis)
|-
|-
| scale || Vector to the initial scale (x, y, z)
| scale || Vector to the initial scale (x, y, z)
Line 166: Line 188:
|-
|-
| anim_time || Vector to the animation's initial time (anim0, anim1, anim2, anim3)
| anim_time || Vector to the animation's initial time (anim0, anim1, anim2, anim3)
|-{{cellcolors|lightgrey}}
|-
| zsort || String indicating the z sort type (unspecified/back to front/front to back) <!-- mandatory in raf format v1.02... not mandatory/inexistant in raf format v1.00 -->
| zsort || String indicating the z sort type (unspecified/back to front/front to back)
|-
|}
|}
*'''zsort''' was not supported in raf tools v1 (the version used to build [[coldboot.raf]]), it was implemented in later versions of the raf tools, because this reason the "actors" in coldboot.raf doesnt uses zsort, see [[Coldboot.raf#Scene]]


===Camera===
===Camera===
{| class="wikitable"
{| class="wikitable"
|+ <camera>
|-
! Attribute !! Description
! colspan="2" {{cellcolors|blue|white}} Element: <camera>
|-
! Attribute  
! Description
|-
|-
| id || String accessed by scripts
| id || String accessed by scripts
Line 196: Line 220:
|-
|-
| up || Vector to the initial up direction (x, y, z)
| up || Vector to the initial up direction (x, y, z)
|-
|}
|}


===Light===
===Light===
{| class="wikitable"
{| class="wikitable"
|+ <light>
|-
! Attribute !! Description
! colspan="2" {{cellcolors|blue|white}} Element: <light>
|-
! Attribute  
! Description
|-
|-
| id || String accessed by scripts
| id || String accessed by scripts
Line 216: Line 244:
|-
|-
| attenuation || Vector to the initial attenuation (zero-order, first-order, second-order)
| attenuation || Vector to the initial attenuation (zero-order, first-order, second-order)
|-
|}
|}


===Script===
===Script===
{| class="wikitable"
{| class="wikitable"
|+ <script>
|-
! Attribute !! Description
! colspan="2" {{cellcolors|blue|white}} Element: <script>
|-
! Attribute  
! Description
|-
|-
|-
| file || Path to the script file
| file || Path to the script file
|-
|}
|}


Line 286: Line 320:
=Links=
=Links=
*RAF pages in other wiki/s
*RAF pages in other wiki/s
**https://web.archive.org/web/20141027141848/http://dudu.clx.free.fr/wiki/index.php?title=PS3RAF
**http://dudu.clx.free.fr/wiki/index.php?title=PS3RAF
**http://ps3.duduclx.fr/index.php?title=Th%C3%A8mes_dynamiques_PS3
**http://ps3.duduclx.fr/index.php?title=Th%C3%A8mes_dynamiques_PS3
**https://web.archive.org/web/20141119010210/http://dudu.clx.free.fr/wiki/index.php?title=PS3Them
**http://dudu.clx.free.fr/wiki/index.php?title=PS3Them
*Interesting info about Animations/3D support in themes https://web.archive.org/web/20141119010206/http://www.ps3hax.net/showthread.php?t=28426
*Interesting info about Animations/3D support in themes http://www.ps3hax.net/showthread.php?t=28426
*See also: [[Qt Resource Container (QRC)]]
*See also: [[Qt Resource Container (QRC)]]


Please note that all contributions to PS3 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS3 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)