TomClancy
April 8th, 2009, 12:39 PM
Okay, this is probably going to be an insanely long post, but this has been bugging me for a long time now.
I play EVE (many of you may know of this game), and with it you can extract models and textures via a tool called TriExporter. I've gotten the model and textures for a ship (Rifter; Frigate Class).
I can render it with VRay and it looks alright, but nothing like the game or what other people have been coming up with. I discovered they have been manipulating the data found in the shader files (.RED) and inputting that data into their rendering engine. The guy I talked to didn't disclose what engine he uses, just some information about the shaders.
Here is a quick excerpt from the .RED file for the Rifter model I was referring to earlier:
type: EveShip2
turrets: []
name: "MF4"
mesh:
type: Tr2Mesh
geometryResPath: "res:/dx9/model/ship/minmatar/mf4/MF4_mod3Shape.gr2"
lowDetailGeometryResPath: "res:/dx9/model/ship/minmatar/mf4/MF4_mod3Shape_lowDetail.gr2"
opaqueAreas:
- type: Tr2MeshArea
name: "Cockpit"
effect:
type: Tr2Effect
name: "Cockpit"
effectFilePath: "res:/Graphics/Effect/Managed/Space/Ship/DoubleFresnelReflectionWithGlow.fx"
parameters:
- type: Tr2Vector4Parameter
name: "MaterialDiffuseColor"
value: [0.6117647, 0.5843138, 0.5568628, 1]
- type: Tr2Vector4Parameter
name: "MaterialSpecularFactors"
value: [0.3, 10, 0, 0]
- type: Tr2Vector4Parameter
name: "MaskDiffuseColor"
value: [0, 0, 0, 1]
- type: Tr2Vector4Parameter
name: "MaskSpecularFactors"
value: [2, 0, 0, 0]
- type: Tr2Vector4Parameter
name: "GlowColor"
value: [3, 1.6833, 0.8824, 1]
- type: Tr2Vector4Parameter
name: "FresnelFactors"
value: [2, 0.5, 0, 0]
- type: TriVariableParameter
name: "ReflectionMap"
variableName: "EnvMap2"
- type: TriVariableParameter
name: "ReflectionMapTransform"
variableName: "EnvMapTransform"
- type: Tr2Vector4Parameter
name: "ReflectionFactors"
value: [0.5, 2.5, 0.5, 1]
- type: Tr2Vector4Parameter
name: "MaskReflectionFactors"
value: [0.5, 0, 1, 0]
- type: TriVariableParameter
name: "MaskReflectionMap"
variableName: "EnvMap1"
- type: Tr2FloatParameter
name: "MaterialAmbientFactor"
value: 0.6
- type: Tr2Vector4Parameter
name: "MaterialSpecularCurve"
value: [50, 180, 0.5, 0]
- type: Tr2Vector4Parameter
name: "MaskSpecularCurve"
value: [170, 850, 0.35, 0]
- type: Tr2FloatParameter
name: "MaskAmbientFactor"
value: 0.6
- type: Tr2Vector4Parameter
name: "MaskFresnelFactors"
value: [1, 1, 0, 0]
resources:
- type: TriTexture2DParameter
name: "DiffuseMap"
resourcePath: "res:/dx9/model/ship/Minmatar/MF4/MF4_tex_d.dds"
- type: TriTexture2DParameter
name: "MaskMap"
resourcePath: "res:/dx9/model/ship/Minmatar/MF4/MF4_tex_p.dds"
- type: TriTexture2DParameter
name: "GlowNormalSpecularMap"
resourcePath: "res:/dx9/model/ship/Minmatar/MF4/MF4_tex_ngs.dds"
index: 3As you can tell, the .RED file links to .FX files. (There is a lot more to the shader than this.) When I navigate to the directory of the .FX file, it is in not in the .FX format. Rather, it's in .SM_3_0_hi, the compiled version of the .FX for the high-quality shader model 3 I'm assuming. Any way, the guy I talked to didn't talk much about the .FX files, just the parameters it talks about below.
He said this:
The values you see are for the vectors, they can manipulate color, lighting, glow or power of a parameter.
Most ships have multiable layers and colors, so you need to drop in the proper value to grab the proper color.
Vectors have 4 values when applied to a texture. [RED, GREEN, BLUE, ALPHA], but that is only when a parameter is calling colors. Otherwise its [VALUE1, VALUE2, VALUE3, VALUE4]
Glow controls lighting for the alpha layer on the diffuse map as defined in the .FX file.
Anywho, a good number of ships require 2 different shaders just for the tech 1 stuff.
There is a special tech 2 shader in the .RED file also.Which makes sense, only I can't figure out what to do this those values, and how to use them with VRay and 3ds Max. It goes completely over my head and I was wondering if anyone on this forum could assist me.
Just to give you an idea of the different between his renders and mine, I'll show a preview of his and mine.
His:
http://i41.tinypic.com/3505ph4.jpg
Mine:
http://img139.imageshack.us/img139/3371/rifter1.jpg
(My lighting is pretty awful too.) Just two VRayLights above and to the sides of it.
His is obviously more sleek and better rendered than mine. We both used the same materials (Diffuse, Specular, Normal etc.)
Thank you for reading!
Anthony
I added more to the CODE section, might help a bit more. Finished up the parameters and such for that portion of the Shader.
I play EVE (many of you may know of this game), and with it you can extract models and textures via a tool called TriExporter. I've gotten the model and textures for a ship (Rifter; Frigate Class).
I can render it with VRay and it looks alright, but nothing like the game or what other people have been coming up with. I discovered they have been manipulating the data found in the shader files (.RED) and inputting that data into their rendering engine. The guy I talked to didn't disclose what engine he uses, just some information about the shaders.
Here is a quick excerpt from the .RED file for the Rifter model I was referring to earlier:
type: EveShip2
turrets: []
name: "MF4"
mesh:
type: Tr2Mesh
geometryResPath: "res:/dx9/model/ship/minmatar/mf4/MF4_mod3Shape.gr2"
lowDetailGeometryResPath: "res:/dx9/model/ship/minmatar/mf4/MF4_mod3Shape_lowDetail.gr2"
opaqueAreas:
- type: Tr2MeshArea
name: "Cockpit"
effect:
type: Tr2Effect
name: "Cockpit"
effectFilePath: "res:/Graphics/Effect/Managed/Space/Ship/DoubleFresnelReflectionWithGlow.fx"
parameters:
- type: Tr2Vector4Parameter
name: "MaterialDiffuseColor"
value: [0.6117647, 0.5843138, 0.5568628, 1]
- type: Tr2Vector4Parameter
name: "MaterialSpecularFactors"
value: [0.3, 10, 0, 0]
- type: Tr2Vector4Parameter
name: "MaskDiffuseColor"
value: [0, 0, 0, 1]
- type: Tr2Vector4Parameter
name: "MaskSpecularFactors"
value: [2, 0, 0, 0]
- type: Tr2Vector4Parameter
name: "GlowColor"
value: [3, 1.6833, 0.8824, 1]
- type: Tr2Vector4Parameter
name: "FresnelFactors"
value: [2, 0.5, 0, 0]
- type: TriVariableParameter
name: "ReflectionMap"
variableName: "EnvMap2"
- type: TriVariableParameter
name: "ReflectionMapTransform"
variableName: "EnvMapTransform"
- type: Tr2Vector4Parameter
name: "ReflectionFactors"
value: [0.5, 2.5, 0.5, 1]
- type: Tr2Vector4Parameter
name: "MaskReflectionFactors"
value: [0.5, 0, 1, 0]
- type: TriVariableParameter
name: "MaskReflectionMap"
variableName: "EnvMap1"
- type: Tr2FloatParameter
name: "MaterialAmbientFactor"
value: 0.6
- type: Tr2Vector4Parameter
name: "MaterialSpecularCurve"
value: [50, 180, 0.5, 0]
- type: Tr2Vector4Parameter
name: "MaskSpecularCurve"
value: [170, 850, 0.35, 0]
- type: Tr2FloatParameter
name: "MaskAmbientFactor"
value: 0.6
- type: Tr2Vector4Parameter
name: "MaskFresnelFactors"
value: [1, 1, 0, 0]
resources:
- type: TriTexture2DParameter
name: "DiffuseMap"
resourcePath: "res:/dx9/model/ship/Minmatar/MF4/MF4_tex_d.dds"
- type: TriTexture2DParameter
name: "MaskMap"
resourcePath: "res:/dx9/model/ship/Minmatar/MF4/MF4_tex_p.dds"
- type: TriTexture2DParameter
name: "GlowNormalSpecularMap"
resourcePath: "res:/dx9/model/ship/Minmatar/MF4/MF4_tex_ngs.dds"
index: 3As you can tell, the .RED file links to .FX files. (There is a lot more to the shader than this.) When I navigate to the directory of the .FX file, it is in not in the .FX format. Rather, it's in .SM_3_0_hi, the compiled version of the .FX for the high-quality shader model 3 I'm assuming. Any way, the guy I talked to didn't talk much about the .FX files, just the parameters it talks about below.
He said this:
The values you see are for the vectors, they can manipulate color, lighting, glow or power of a parameter.
Most ships have multiable layers and colors, so you need to drop in the proper value to grab the proper color.
Vectors have 4 values when applied to a texture. [RED, GREEN, BLUE, ALPHA], but that is only when a parameter is calling colors. Otherwise its [VALUE1, VALUE2, VALUE3, VALUE4]
Glow controls lighting for the alpha layer on the diffuse map as defined in the .FX file.
Anywho, a good number of ships require 2 different shaders just for the tech 1 stuff.
There is a special tech 2 shader in the .RED file also.Which makes sense, only I can't figure out what to do this those values, and how to use them with VRay and 3ds Max. It goes completely over my head and I was wondering if anyone on this forum could assist me.
Just to give you an idea of the different between his renders and mine, I'll show a preview of his and mine.
His:
http://i41.tinypic.com/3505ph4.jpg
Mine:
http://img139.imageshack.us/img139/3371/rifter1.jpg
(My lighting is pretty awful too.) Just two VRayLights above and to the sides of it.
His is obviously more sleek and better rendered than mine. We both used the same materials (Diffuse, Specular, Normal etc.)
Thank you for reading!
Anthony
I added more to the CODE section, might help a bit more. Finished up the parameters and such for that portion of the Shader.