Lighting
Re: Lighting
Yes, by specmap I meant specular color texture.
Also, where can I set the material and light constants like light position/direction, specular, diffuse and ambient?
Also, where can I set the material and light constants like light position/direction, specular, diffuse and ambient?
-insert deep philosophical statement here-
Re: Lighting
viewtopic.php?f=33&t=7250#p75835Jorzi wrote:Also, where can I set the material and light constants like light position/direction, specular, diffuse and ambient?
Re: Lighting
@SafetyOff: I just realized that including normals, tangents and bitangents(aka binormals) into the file format turns out to be a bad idea after all. Warzone will need to be able to recalculate it anyway, because the main reason we need tangent space is for bone deformation of geometry when animating stuff like cyborgs. Since the code needs to get into warzone sooner or later, there is no longer any reason to store the data in the file format.
-insert deep philosophical statement here-
Re: Lighting
Why? (You only need two of those, or a quaternion in the format).Jorzi wrote:@SafetyOff: I just realized that including normals, tangents and bitangents(aka binormals) into the file format turns out to be a bad idea after all.
I suppose once silhouette computation is added it can share some data.
Re: Lighting
Umm, no.MaNGusT wrote:Safety0ff, are you talking with yourself?
Re: Lighting
The thing is, we want normalmaps to display correctly for mirrored uv:s. They should do this if the tangent always follows the u(horizontal on the texture) axis and the binormal always follows the v axis. However, if we calculate the binormal through the cross product, mirrorirng on the u-axis will flip both the tangent and binormal, while mirroring on the v-axis will flip neither. Therefore we need to calculate all three vectors separately, and as I said, if we are to have deformation at any point in the future, they will have to be calculated at rendertime (non-deforming objects can of course have them precalculated, but the code needs to be in warzone anyway).
-insert deep philosophical statement here-
Re: Lighting
Just to make sure that we are on the same page: we're not talking about mirroring models in warzone, we're only talking about the uv's being mirrored for symmetric parts of the model.
Anyways, the solution that seems to be used by others is an additional sign parameter on the tangent vector.
(sign stored in w component of tangent vector:) http://forum.unity3d.com/threads/65859- ... post420888
(section 1.4) http://wiki.blender.org/index.php/Dev:S ... ormal_Maps
Besides, if the calculated normals don't match up with the normals used by the renderer things could potentially look different.
Anyways, the solution that seems to be used by others is an additional sign parameter on the tangent vector.
(sign stored in w component of tangent vector:) http://forum.unity3d.com/threads/65859- ... post420888
(section 1.4) http://wiki.blender.org/index.php/Dev:S ... ormal_Maps
Besides, if the calculated normals don't match up with the normals used by the renderer things could potentially look different.
Re: Lighting
well, You've found the solution. Who will implement it?
Re: Lighting
IMO, that is the only sane approach, by having it all in the model (texture)format. Open up some .dds files for some major games and look.Safety0ff wrote:I disagree, vertex normals should be incorporated into the model format, this way we can have the model editor do all the heavy lifting, and the same normals that are used in the editor are used in game (this matters for tangent space normal mapping).Per wrote:The normals are calculated in a very naive manner. This should be improved one day. I think the right place to do this is in the C++ code.
Btw, gouraud shading is turned on, but like per said, the normals are specified in such a way that it is the same as if it used flat shading.
In fact, that is what most other game companies do with their games, so let's not reinvent the wheel with more home brewed code.
If need be, we can also have dudv maps, but, currently, I only plan that for water.
and it ends here.
Re: Lighting
Can we use dds format for wz?Buginator wrote: Open up some .dds files for some major games and look.
In fact, that is what most other game companies do with their games, so let's not reinvent the wheel with more home brewed code
Re: Lighting
Hmm, maybe they only transform the coordinate system according to the deformation instead of actually recalculating stuff? They seemed to do that in an article I read about using bone animation with object space(!) normal maps. Anyway, I can't really brag about having any experience (at all :/ ) about these things. In fact, anything I know about glsl shaders is merely what I learned while rewriting them for warzone
I'm also afraid that home brewed code might be one of my specialities, as well as reinventing the wheel
I'm also afraid that home brewed code might be one of my specialities, as well as reinventing the wheel
-insert deep philosophical statement here-
Re: Lighting
Short answer is: not as the primary texture format (i.e. not the default/packaged texture format).MaNGusT wrote:Can we use dds format for wz?
To use (dxt compressed) dds textures as our primary format we would need to include a dxt decompressor to allow computers whose drivers and / or cards do not support dxt compression.
Since there are patent issues with dxt algorithms, we cannot include them.
The patent issue is also why some software (e.g. X11, open source drivers) do not enable the dxt algorithms by default (people have to enable it manually).
I think Spring TA requires people to enable these functions.
Re: Lighting
Can anyone tell me the default values of the MATERIALS diective in the .pies? The wiki says "MATERIALS 1.0 1.0 1.0 1.0 1.0 1.0 20", are these defaults or just random examples?
-insert deep philosophical statement here-
Re: Lighting
Default values are 1.0 for the first 9 (ambient, diffuse, specular, respectively,) and 10 for the shininess.Jorzi wrote:Can anyone tell me the default values of the MATERIALS diective in the .pies? The wiki says "MATERIALS 1.0 1.0 1.0 1.0 1.0 1.0 20", are these defaults or just random examples?