Scenes File Format - GRF (Granada File)

scene:: =
list_blocks.

list_blocks:: =
block |
block list_blocks |
nothing.

block:: =
block_descripcion |
block_mesh |
block_mesh_light |
block_light_source |
block_include |
block_transformation |
block_definition |
nothing.


block_descripcion: =
params begin list_params end

list_params: =
dependent observant

observer: =
view vector3D.


block_mesh:: =
begin mesh
     use listVertexs listFaces
end mesh.

block_mesh_light:: =
mesh light basic_block_mesh  

basic_block_mesh:: =
begin listVertexs listFaces end

block_light_source:: =
light begin color_definition region [] end

region:: =
vector3D edge edge

edge:: =
vector3D

block_include:: =
include fileName


block_transformation
transform transformation begin list_blocks end

transformation:: =
basic_transformation transformation |
basic_transformation

basic_transformation:: =
scale vector3D |
rotation vector3D |
translation vector3D.


block_definition: =
definitions begin list_blocks end

definitions:: =
basic_definition |
definitions basic_definition |
nothing.

basic_definition:: =
def identifier = body_definition

body_definition:: =
texture_definition |
brdf_definition.
pdf_definition |

texture_definition:: =
texture fileName.

brdf_definition:: =
brdf fileName |  
brdf brdf_instance.

brdf_instance:: =
PerfectDiffuse_BRDF | PerfectSpecular_BRDF | Phong_BRDF |
Blinn_BRDF | Torrance-Sparrow_BRDF |
Cilindrico-PF_BRDF | HTSG_BRDF |
Ward_BRDF | Lewis_BRDF | Schlick_BRDF |
Oren-Nayar_BRDF | Strauss_BRDF | Lafortune_BRDF |
Shirley_BRDF | Minnaert_BRDF |
BeardMaxwell_BRDF | combinacion_BRDFs.

PerfectDiffuse_BRDF:: =
diffuse kd=value.

PerfectSpecular_BRDF:: =
specular ks=value.

Phong_BRDF:: =
phong n=value ks=value kd=value.

Blinn_BRDF:: =
blinn n=value ks=value kd=value.

Torrance-Sparrow_BRDF:: =
torrance rough=value nreal=value nimag=value ks=value kd=value.

Cilindrico-PF_BRDF:: =
poulin d=value n=value ks=value kd=value.

HTSG_BRDF:: =
he sigma=value tau=value lambda=value.

Ward_BRDF:: =
ward sx=value sy=value ks=value kd=value.

Lewis_BRDF:: =
Lewis n=value ks=value kd=value.

Schlick_BRDF:: =
schlick SC=value Sr=value Sp=value Ly=boolean_value [DC=value Dr=value Dp=value].

Oren-Nayar_BRDF:: =
oren s=value r=value .

Strauss_BRDF:: =
strauss s=value m=value ks =value kd =value .

Lafortune_BRDF:: =
lafortune Cx=value Cy=value Cz=value n=value kp=value .

Shirley_BRDFs:: =
coupled Rm=value

Minnaert_BRDFs:: =
minnaert k=value kd=value

BeardMaxwell_BRDFs:: =
beardmaxwell Omega=value tau=value nreal=value nimag=value RS=value Rd=value Rv=value

combination_BRDFs:: =
combine base_Brdf, base_Brdf*

base_BRDF:: =
value identifier |
nothing.

pdf_definition::=
pdf pdf_instance .

pdf_instance ::=
Uniform_PDF | Sphere_PDF | Hemisphere_PDF |
Adaptive_PDF | Anisotropic_PDF |
Rejection_PDF | Factored_PDF .

Uniform_PDF ::=
diffuse

Sphere_PDF ::=
sphere  exp =valor

Hemisphere_PDF ::=
hemisphere  exp =valor

Adaptive_PDF ::=
adaptive  nQT =valor aniso =valor_logico

Anisotropic_PDF ::=
anisotropic  nu =valor nv =valor

Rejection_PDF ::=
reject 

Factored_PDF ::=
factored  uTh =valor uPh =valor pTh =valor pPh =valor J =valor K =valor half =valor_logico


use:: =
[usotexture] [usoBrdf].

usotexture:: =
texture identifier.

usoBrdf:: =
brdf identifier.


listVertexs:: =
begin vertex Vertexs end vertex |
begin vertexs Vertexs end vertexs |
begin vertexes Vertexs end vertexes.

Vertexs:: =
vertex |
vertex Vertexs |
nothing.

vertex:: =
[normal vector3D] [listIrrandiances] [uv vector2D] vector3D.

listIrrandiances:: =
irradiance |
begin list (ray irradiance) * end list.

ray:: =
ray vector3D.

irradiance:: =
irad vector3D.

vector3D:: =
(value, value, value).

vector2D:: =
(value, value).

listFaces:: =
begin faces faces end faces.

faces:: =
faces face |  
color_definition face |  
nothing.

face:: =
nVertexs (position*) |
(position, position*).

nVertexs:: =
integer.

position:: =
integer.


nombreEscena: =
fileName.

fileName:: =
<cadena >.

colorValue:: =
(value, value, value).

string:: =
“joint of Unicode characters”.

valor_logico:: =
true | false.

value:: =
float |
integer;

float =
(decimal “.” [decimal] [explaining] [sufijo_tipo]) |
(“.” decimal [explaining] [sufijo_tipo]) |
(decimal [explaining] [sufijo_tipo]). ;

decimal:: =
0..9.

exponent:: =
“and” [“+”/” - “] decimal.

sufijo_tipo:: =
“f” |
“d”.

integer:: =
0..9.

identifier:: =
a. .z, A. Z, 0..9, $, _.

commentary:: =
// string.

nothing:: =
;

Previous

Last modification: April 13th 2007