Aller au contenu

Photo

Terrain - BUG CHECK // specular palette file [.gpu.rim]


16 réponses à ce sujet

#1
IKe0s

IKe0s
  • Members
  • 80 messages
Hello, I have one question about the toolset mainly for the bioware guy's.
Are the engine capable to utilize the specular map for render the terrain mesh?
If so, did u already flag as red the entry export process, which strip away all the relevant information for such manipulation?
If not, u should be going check all of the retail ".mao" level [.rim] file and the relative missing *__.spc palette [.gpu.rim] ( or whatever it must be called ) for that map.


Best regards

Modifié par IKe0s, 29 novembre 2009 - 10:37 .


#2
IKe0s

IKe0s
  • Members
  • 80 messages
@ very big line I got it working by modifing certain config file:

Image IPB

Image IPB

Still, right now there no reference to the specular map palette and that mean; even if alter the game config for utilize that kind of effect, there are no shader to work with it and u'll will be stuck with one for all or so: in detail, will be impossible get out some better detailed level.

:?

Modifié par IKe0s, 29 novembre 2009 - 10:30 .


#3
IKe0s

IKe0s
  • Members
  • 80 messages
[smilie]../../../images/forum/emoticons/unsure.png[/smilie]

Modifié par IKe0s, 27 novembre 2009 - 02:53 .


#4
IKe0s

IKe0s
  • Members
  • 80 messages
BUMP from the third page - Seriously.

Modifié par IKe0s, 27 novembre 2009 - 10:01 .


#5
IKe0s

IKe0s
  • Members
  • 80 messages
The necessary time for rebuild the terrain shader to include the specular palette work as intended, will be like 25 min of work.
Im not asking for a full implementation on the already existent code/file level and what not, Im just asking for a shader reference implementation - and/or one alternate terrain shader, which would really simple to do. :pinched:

Modifié par IKe0s, 29 novembre 2009 - 10:33 .


#6
IKe0s

IKe0s
  • Members
  • 80 messages
I will do it by myself if u release the plain ".fx" file.
Perhaps u did em with readermoneky so, even here the ".rfx" [ zip ] package will be useful / ".sln" [ with project file ] for visual studio, would even better..  deal? :innocent:

Modifié par IKe0s, 27 novembre 2009 - 11:12 .


#7
IKe0s

IKe0s
  • Members
  • 80 messages
BUMP from the oblivion <_<

#8
Mika Uusnakki

Mika Uusnakki
  • BioWare Employees
  • 6 messages
So the way this works is that the Level Editor simply takes the dds you assign to the specular Texture and converts it to grayscale and writes it to the alpha channel of your LAYOUT__pal.dds texture. You should be able to see the specular in the Level Editor, Area Editor and the game. If you cannot see the effect in game, then most likely your shader quality is set too low.



Does this address your question?



-Mika

#9
IKe0s

IKe0s
  • Members
  • 80 messages
Perhaps it's a wrong steps and besides the engine utilize a different shader to render the mesh captured into the above comparison video; by the way.. you could see, or at least notice the difference while utilizing a real specular map over the diffusive alpha channel to simulate in this case a pure reflection.


Original Diffusive Map - Modified Specular Map\\\\Normal Map





Original Diffusive Map\\\\Specular Map\\\\Normal Map  ( Retail )




Im trying to understand the choice done, alas would be more "walloper" having the right cards to play with it.

Modifié par IKe0s, 01 décembre 2009 - 02:24 .


#10
Mika Uusnakki

Mika Uusnakki
  • BioWare Employees
  • 6 messages
It might be easier if you just send us your .lvl file and textures. Send them as an attachment in an email to toolsetsupport@bioware.com.

#11
IKe0s

IKe0s
  • Members
  • 80 messages
Mika, thanks for uor answer it addressed mine question.
Perhaps at the end we are referring at some different things which are bound, anyhow..
I m referring at the pexel/vertex shader > "Dragon Age\\package\\core\\data\\shader.erf // "terrain" ".psh" ".vsh" (fxo) and his relative material definition > "Dragon Age\\package\\core\\data\\material.erf // "terrain" ".mat" and the ""missing"" (for propose) "smpSpecularMapPalette", over;
 
"mml_vPalette_parameters"
"mml_vPalette_dimensions"

Even if I mail one dummy level there no way, w/o recomplie the shader within some addition to utilize the specular palette over the terrain.
Because as u said "the level editor bring out the specular map, for converse it as greyscale on the diffusive alpha".

So.. in the topic case, that leave to a missing "gloss" from the specular alpha, and u'll be end with plain texture.

#12
Mika Uusnakki

Mika Uusnakki
  • BioWare Employees
  • 6 messages
There is no smpSpecularMapPalette in the terrain shaders or in the terrain material because the specular information is read out of the processed diffuse texture's alpha channel. If you want to set the specular exponent, there is a parameter you can set in the Level Editor.



It sounds like you want the terrain to render like the static props you modified in the videos you posted. To do this you will need to place the modified specular and normal maps you created (as uncompressed dds) into your override folder. Then follow these steps:

1. Create a new terrain level.

2. Expand the Terrain World node, expand the Terrain Mesh node, expand the Palette node and click on Grass.

3. In the Object Inspector window replace the Diffuse texture with snowpa01_d.dds

4. Replace the Normal and Specular textures with your modified ones.

Now the terrain should look the same as the prop in your video.

#13
IKe0s

IKe0s
  • Members
  • 80 messages
Understood and still.. I belive would be nice to have the possibility to utilize the specular map over the TERRAIN :lol:

..
Becuase at example check the above image, it's taken from the toolset itself by utilizing the very same texture file on both's mesh.

Image IPB

And as u might notice, on the STATIC we have a slighty different outcome.

Modifié par IKe0s, 05 décembre 2009 - 06:30 .


#14
Mika Uusnakki

Mika Uusnakki
  • BioWare Employees
  • 6 messages
At this point, you should really just send me your static/terrain test level and textures, and I'll see what's going on because this really should be possible to accomplish.

#15
IKe0s

IKe0s
  • Members
  • 80 messages
I followed your suggestion and u should got a PM with sample texture.
U should see something like the above image on the static.

Image IPB

Modifié par IKe0s, 09 décembre 2009 - 02:43 .


#16
Mika Uusnakki

Mika Uusnakki
  • BioWare Employees
  • 6 messages
Ok, so here's the whole story of what's going on. I'll be using our brc100d level as an example here. If you open that level's rims, you should be able to find the files I'm referring to.
The level editor outputs 3 palette texture files (ARGB 8.8.8.8 dds format) when the level is exported:
brc100d__pal.dds
brc100d__nrm.dds
brc100d__hgt.dds
Each is a 1024x2048 texture, which is split into 2 columns and 4 rows. Each cell is a 512x512 source for a particular terrain material, with a 128 pixel repeat gutter to avoid bleeds in the mipmaps. So the max resolution you'll ever have in game is 256x256.

Now the brc100d__pal.dds texture has 4 channels ARGB. The RGB channels contain a copy the diffuse texture's RGB channels. The Alpha channel contains a greyscale copy of the RGB channels of the texture you assigned in the level editor to the terrain material's specular slot. The texture you sent me has the star in the alpha channel of that texture, so it won't be represented in the terrain palette. The alpha channel of the specular texture controls the specular exponent, which determines how much the specular bleeds over. For the terrain this is controlled by a single value from the level editor's terrain material in the object inspector.

The final piece of information critical to comparing terrain to props is that terrain doesn't handle specular from placed static lights - it only calculates it based on the directional light from the sun.

There are a few things that were not quite right about the assets you sent me. Firstly, the normal map you sent cannot be used for a normal map source on the level editor's terrain material because it is in DXT5NM format. It needs to be in ARGB 8.8.8.8 format with the X in the Red channel and Y in the Green channel. However, even after I manually converted yours back, it still behaved strangely - it looks like the whole normal map is angled in one direction.

Also, in the second to last screenshot, it looks like your UV tiling
setting for the terrain material is too high. When I was matching the
two, the value 7 seemed to produce the closest results.

In summary: to get the closest match to a static object:
 * If you want a normal map - use a good quality uncompressed normal map for the terrain material source and then DXT5NM compress that same texture and use it for your static object's normal map.
 * Adjust the UVTiling parameter in the level editor to visually match your static model.
 * Don't try to use the specular texture's alpha channel on the static prop to do neat tricks with specular power, as the terrain doesn't support that. Use a single value for the alpha, and match that value in the level editor.
 * Make sure to turn on the sunlight so that you can see specular on your terrain - static lights won't work.

-Mika

#17
IKe0s

IKe0s
  • Members
  • 80 messages
About the normal map I voluntarily "removed" the coord as not inherent to the example, which was targeting the alpha specular :P

As for the first two shoot, I've added the following line to the "LOD1" terrain material;

<!--Information from the material library -->
<Parameter Type = "Texture" Name = "mml_tDiffuse" SamplerName = "smpDecal" Default = "Default_Missing"/>
<Parameter Type = "Texture" Name = "mml_tNormalMap" SamplerName = "smpNormalMap" Default = "Default_FlatNM"/>
<Parameter Type = "Texture" Name = "mml_tSpecularMask" SamplerName = "smpSpecularMask" Default = "Default_SpecularMask"/>
<Parameter Type = "Float" Name = "mml_fSpecularReflectionMult" Default = "1.0"/>

<!--Information from the mesh -->
<RequiredStreamData Name = "POSITION"/>
<RequiredStreamData Name = "NORMAL"/>
<RequiredStreamData Name = "TEXCOORD0"/>
<RequiredStreamData Name = "BINORMAL"/>
<RequiredStreamData Name = "TANGENT"/>
and then adjusted all the ".mao" relative to the level for utilize the parameter; as u might know the down side will be having only one map for all terrain mesh.
Thanks, for the big explanation mika, I will keep reading it few more time.

Modifié par IKe0s, 19 décembre 2009 - 09:02 .