See site in english Voir le site en francais
Website skin:
home  download  forum  link  contact

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Author Topic: Un tuto pour les trucs de ouf qu'on peut faire avec D3D9?  (Read 5364 times)

0 Members and 1 Guest are viewing this topic.

Offline orbitermat

  • Legend
  • ******
  • Posts: 2257
  • Country: Canada ca
  • Karma: 19
  • Man must explore.
09 February 2014, 19:10:06
Salut :)

Polaris est presque fini, et après j'ai une petite idée de ce que je pourrais faire. :)

Donc voilà: Existe-t-il un tuto qui explique comment faire des normal maps et des reflection maps?

Merci! :)

Orbitermat


Offline Fast_toche

  • Legend
  • ******
  • Posts: 1329
  • Country: France fr
  • Karma: 34
  • Time is nothing...
Reply #1 - 11 February 2014, 01:14:59
Tu peux utiliser The Gimp avec son plug'in pour faire tes normals maps à partir d'une image.
Aprés tu peux aussi faire des normals maps à partir d'un mesh High poly pour le cloner sur un mesh Lowpoly.
Comme la combinaison spatiale de Dan dans UCGO.

« Last Edit: 11 February 2014, 01:26:54 by Fast_toche »

Offline SolarLiner

  • Global Moderator
  • Legend
  • *****
  • Posts: 2769
  • Country: France fr
  • Karma: 55
  • a été remercié par Le Créateur
Reply #2 - 11 February 2014, 19:22:03
Il y a plusieurs sujets (tu peux te joindre à celui de jaquesmomo pour apprendre à faire les normal maps) pour les maps différentes de D3D9, mais quelques précision quant aux paramètres à utiliser:
_norm (Normal Maps)
- Prend l'option d'exportation "V8U8" qui est un format DDS non-compressé et qui n'utilise que 2 octets par pixel.
- Ne peint pas toi même la normal map, si tu veux la peindre, passe d'abord par une bump map (noir et blanc, noir 100% c'est "enfoncé" dans le mesh, 100% blanc, ça "ressort" du mesh, gris total et le mesh reste inchangé) et ensuite utilise des plugins de GIMP ou les utilitaires nVidia pour convertir ta bump map en normal map.

_spec (Specular Map)
Contrôle la réflection spéculaire de la texture (la "brillance" de la texture)

Comment ça marche dans D3D9:
- Les couleurs modifient la couleur de la spéculaire
- Le canal alpha contrôle la puissance de la spéculaire (comme dans les paramètres de spéculaire du matériau, plus le chiffre est élevé, plus la "brillance" sera précise, alors qu'un petit nombre donnera une spéculaire très diffuse).

Conseils:
- Exporte en DXT5. Meilleure compression pour une qualité bien gardée.

_refl (Reflection Map)
Contrôle la réflection de la scène sur la texture.

Comment ça marche dans D3D9:
- Chaque canal de couleur contrôle la puissance de la réflexion dans ladite couleur (càd le canal rouge contrôlera la puissance de la réflexion dans le canal rouge)
- Le canal alpha est ignoré, donc vaut mieux ne pas en mettre.

Conseils:
- Exporte en DXT1. C'est compressé, et comme il n'y a pas d'alpha tu n'aura aucun problème.


Offline orbitermat

  • Legend
  • ******
  • Posts: 2257
  • Country: Canada ca
  • Karma: 19
  • Man must explore.
Reply #3 - 12 February 2014, 04:00:12
Merci beaucoup pour vos réponses :wor:

Je n'ai plus qu'à étudier tout cela... :bug


Offline jacquesmomo

  • Le budget !!!
  • Legend
  • ******
  • Posts: 7408
  • Country: France fr
  • Karma: 598
  • Plus on rate, plus on a de chances de réussir !..
Reply #4 - 12 February 2014, 14:47:53
moi aussi j'étudie...  :badsmile:

Mes add-ons sont là !

Offline romass

  • Jr. Member
  • **
  • Posts: 21
  • Karma: -2
Reply #5 - 15 April 2014, 19:01:05
merci beaucoup, très belle initiative.


Offline Kendo

  • Jr. Member
  • **
  • Posts: 30
  • Country: United Kingdom gb
  • Karma: 2
Reply #6 - 17 April 2014, 12:54:08
Solarliner, I use the Nvidia plugin with Photoshop.
Can you tell me which setting I use for Normal maps.?
Also, do I need  any/all mipmaps for Norm and Spec files.?
Regards, Ken.


Offline SolarLiner

  • Global Moderator
  • Legend
  • *****
  • Posts: 2769
  • Country: France fr
  • Karma: 55
  • a été remercié par Le Créateur
Reply #7 - 17 April 2014, 16:59:34
Normal Maps are the trickiest when it comes to DDS saving. It's a balance of quality/texture size.
DXT1 would be the best because no alpha information is stored (and alpha channel is not needed anyway), and the pixel information is uncompressed. So this gives the best results in Orbiter.

DXT5 uses interpolated alpha, so not all the information is stored, but only the most important one, and algorithms will take care of the rest. But, as this doesn't save the entire image, you will sometimes result in artifacts that will appear as unwanted bumps on the mesh later. But this is good enough when the normal map isn't the most important part.

But, compression isn't the only thing to take into account; you also have the pixel depth. A 8bpp pixel depth will be able to store 256 possible values for each channel, for one pixel. 16bpp will store 65536 possible values per pixel for a channel, and 32bpp, 4 294 267 296.
What does that mean? If you take a gradient that goes from black to white, with 8bpp you will see 256 different "steps", with 16bpp 65536 steps and so on.
So, 32bpp should be the one to use, right? Not really. There too is a balance between quality and texture size. 8bpp will take 8 bits (1 byte) per pixel and per channel. 16bpp will take 16 bits (2 bytes) per pixel and channel, and 32bpp will take 4 bytes.
With that, you can compute the amount of space the texture will take, given the size of the texture, the number of channels and the pixel depth you want to take. For example, a 1024 and 16bpp ARGB texture will have 1024*1024=1 048 576 pixels. Take that and multiply by the pixel depth: 1 048 5746*16=16 777 216 bits/channel. Multiply by the number of channels (here 4: A, R, G, B) : 16 777 216*4=67 108 864 bits, which is 8 388 608 bytes or 8 192 kb. (exactly 8 Mb)
If we do the same with a 8bpp texture, you'll only have a 4 096 kb (exactly 4 Mb) texture!

Anyway, aside of the maths aspect, picking a 8bpp pixel depth for your normal map will sometimes make "terraces" on your meshes, because of the only 256 different values for a channel (this is equivalent to the gradient example). with 16bpp the terrace effect will still be there, but way less noticeable.

TL;DR: Take a format without alpha channel, take 8bpp first, but if the normal map makes the "terrace" effect than switch to 16bpp (better quality, more file space required). Also, first compress the texture (using a "compressed" type) but if too many artifacts are noticeable, switch to uncompressed.

My personal favorite: DXT5 RGB 8bpp; compressed, 8bpp, but largely enough for the job.


Offline Kendo

  • Jr. Member
  • **
  • Posts: 30
  • Country: United Kingdom gb
  • Karma: 2
Reply #8 - 17 April 2014, 18:03:16
Thank you for your answers.
Are you saying, I can use DXT5 RGB 8bpp for Normal textures.?
And do I need Mipmaps.?


Offline SolarLiner

  • Global Moderator
  • Legend
  • *****
  • Posts: 2769
  • Country: France fr
  • Karma: 55
  • a été remercié par Le Créateur
Reply #9 - 17 April 2014, 18:35:00
IIRC, Mipmaps are not used, so they are useless.
And yes, I've been using DXT5 RGB 8bpp since a while now, without big, noticeable problems. Most of the time it is the format I am taking. If it gives bad results, I use the knowledge of the first port to pick another one.


Offline Kendo

  • Jr. Member
  • **
  • Posts: 30
  • Country: United Kingdom gb
  • Karma: 2
Reply #10 - 17 April 2014, 18:41:37
Thank you for the info.  :beer: