{"name":"Rvmat File Format","title":"Rvmat File Format","type":"topic","url":"https://community.bistudio.com/wiki/Rvmat_File_Format","revid":373457,"updated":"2025-05-08T13:33:37Z","aliases":[],"markdown":"Rvmat files are the texture (material) files introduced with Armed Assault. Their syntax is similar to that of a config file.\n\n### Base Format\n\nThe minimum construct of an rvmat file is as below; however, it is recommended to use TexGen as described below to save on `uvTransform` declarations.\n\n```cpp\n// rgba values being replaced by the value of your choice\nambient[] = { r, g, b, a };\ndiffuse[] = { r, g, b, a };\nforcedDiffuse[] = { r, g, b, a };\nemmisive[] = { r, g, b, a };\nspecular[] = { r, g, b, a };\nspecularPower = 64.0;\npixelShaderID = \"Normal\";\nvertexShaderID = \"BasicAlpha\";\n\nclass Stage0\n{\n    texture = \"#(rgb,8,8,3)color(0,0,1,1,SMDI)\";\n    // uvSource = \"tex\"; // default uvSource is \"tex\"\n    filter = \"Point\";\n};\n// ...\nclass StageLast\n{\n    texture = \"#(rgb,8,8,3)color(0,0,1,1,SMDI)\";\n    filter = \"Point\";\n};\n```\n\n#### Values\n\n- `ambient`\n- `diffuse`\n- `forcedDiffuse`\n- `emmisive`\n- `specular`\n- `specularPower`\n- `pixelShaderID`\n- `vertexShaderID`\n\n##### Stage\n\n- `texture`\n- `uvSource`\n- `filter`\n\n### TexGen Usage\n\nTexGen usage prevents `uvTransform` to be redeclared in every stage.\n\n```cpp\nambient[] = { 1, 1, 1, 1 };\ndiffuse[] = { 1, 1, 1, 1 };\nforcedDiffuse[] = { 0, 0, 0, 0 };\nemmisive[] = { 0, 0, 1, 10 };\nspecular[] = { 1, 1, 1, 1 };\nspecularPower = 100;\npixelShaderID = \"SuperExt\";\nvertexShaderID = \"Super\";\n\nclass TexGen0\n{\n    uvSource = \"tex\";\n    class uvTransform\n    {\n        aside[] = { 1, 0, 0 };\n        up[] = { 0, 1, 0 };\n        dir[] = { 0, 0, 1 };\n        pos[] = { 0, 0, 0 };\n    };\n};\n\nclass TexGen1\n{\n    uvSource = \"none\";\n};\n\nclass Stage1\n{\n    texture = \"z\\wolf\\addons\\wolflogo\\tex\\wolflogo_nohq.paa\";\n    texGen = 0;\n};\nclass Stage2\n{\n    texture = \"#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)\";\n    texGen = 0;\n};\nclass Stage3\n{\n    texture = \"#(argb,8,8,3)color(0,0,0,0,MC)\";\n    texGen = 0;\n};\nclass Stage4\n{\n    texture = \"z\\wolf\\addons\\wolflogo\\tex\\wolflogo_as.paa\";\n    texGen = 0;\n};\nclass Stage5\n{\n    texture = \"z\\wolf\\addons\\wolflogo\\tex\\wolflogo_smdi.paa\";\n    texGen = 0;\n};\nclass Stage6\n{\n    texture = \"#(ai,64,64,1)fresnel(1.29,0.01)\";\n    texGen = 1;\n};\nclass Stage7\n{\n    texture = \"a3\\data_f\\env_co.paa\";\n    texGen = 0;\n};\nclass Stage8\n{\n    texture = \"z\\wolf\\addons\\wolflogo\\tex\\wolflogo_em.paa\";\n    texGen = 0;\n};\n```","sections":[{"heading":null,"level":1,"markdown":"Rvmat files are the texture (material) files introduced with Armed Assault. Their syntax is similar to that of a config file."},{"heading":"Base Format","level":3,"markdown":"The minimum construct of an rvmat file is as below; however, it is recommended to use TexGen as described below to save on `uvTransform` declarations.\n\n```cpp\n// rgba values being replaced by the value of your choice\nambient[] = { r, g, b, a };\ndiffuse[] = { r, g, b, a };\nforcedDiffuse[] = { r, g, b, a };\nemmisive[] = { r, g, b, a };\nspecular[] = { r, g, b, a };\nspecularPower = 64.0;\npixelShaderID = \"Normal\";\nvertexShaderID = \"BasicAlpha\";\n\nclass Stage0\n{\n    texture = \"#(rgb,8,8,3)color(0,0,1,1,SMDI)\";\n    // uvSource = \"tex\"; // default uvSource is \"tex\"\n    filter = \"Point\";\n};\n// ...\nclass StageLast\n{\n    texture = \"#(rgb,8,8,3)color(0,0,1,1,SMDI)\";\n    filter = \"Point\";\n};\n```"},{"heading":"Values","level":4,"markdown":"- `ambient`\n- `diffuse`\n- `forcedDiffuse`\n- `emmisive`\n- `specular`\n- `specularPower`\n- `pixelShaderID`\n- `vertexShaderID`"},{"heading":"Stage","level":5,"markdown":"- `texture`\n- `uvSource`\n- `filter`"},{"heading":"TexGen Usage","level":3,"markdown":"TexGen usage prevents `uvTransform` to be redeclared in every stage.\n\n```cpp\nambient[] = { 1, 1, 1, 1 };\ndiffuse[] = { 1, 1, 1, 1 };\nforcedDiffuse[] = { 0, 0, 0, 0 };\nemmisive[] = { 0, 0, 1, 10 };\nspecular[] = { 1, 1, 1, 1 };\nspecularPower = 100;\npixelShaderID = \"SuperExt\";\nvertexShaderID = \"Super\";\n\nclass TexGen0\n{\n    uvSource = \"tex\";\n    class uvTransform\n    {\n        aside[] = { 1, 0, 0 };\n        up[] = { 0, 1, 0 };\n        dir[] = { 0, 0, 1 };\n        pos[] = { 0, 0, 0 };\n    };\n};\n\nclass TexGen1\n{\n    uvSource = \"none\";\n};\n\nclass Stage1\n{\n    texture = \"z\\wolf\\addons\\wolflogo\\tex\\wolflogo_nohq.paa\";\n    texGen = 0;\n};\nclass Stage2\n{\n    texture = \"#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)\";\n    texGen = 0;\n};\nclass Stage3\n{\n    texture = \"#(argb,8,8,3)color(0,0,0,0,MC)\";\n    texGen = 0;\n};\nclass Stage4\n{\n    texture = \"z\\wolf\\addons\\wolflogo\\tex\\wolflogo_as.paa\";\n    texGen = 0;\n};\nclass Stage5\n{\n    texture = \"z\\wolf\\addons\\wolflogo\\tex\\wolflogo_smdi.paa\";\n    texGen = 0;\n};\nclass Stage6\n{\n    texture = \"#(ai,64,64,1)fresnel(1.29,0.01)\";\n    texGen = 1;\n};\nclass Stage7\n{\n    texture = \"a3\\data_f\\env_co.paa\";\n    texGen = 0;\n};\nclass Stage8\n{\n    texture = \"z\\wolf\\addons\\wolflogo\\tex\\wolflogo_em.paa\";\n    texGen = 0;\n};\n```"}],"categories":["ArmA: Armed Assault: File Formats","Operation Flashpoint: Modelling","Real Virtuality File Formats"],"groups":["Tools and File Formats"]}