Detail mapping: Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
New page: Detail mapping is a great justice feature, here it is applied on the 884 crate texture from the HRP : Example of a detail map definition : Get to the 884 crate texture definition in the...
 
No edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Detail mapping is a great justice feature, here it is applied on the 884 crate texture from the HRP :
Detail mapping is one of the new engine features in EDuke32. It uses hardware multitexturing to combine a regular texture map with a greyscale texture scaled differently, resulting in memory-efficient additionnal detail.


[[DEF Language|DEF syntax]] to define detail textures inside '''model''' or '''texture''' blocks :
'''detail { file ''filename'' scale ''scale'' surf ''surface''}'''
where ''filename'' is a regular double-quoted texture complete path and ''scale'' a positive floating-point value that'll determine how much your detail map should repeat on your diffuse map (if you want your detail map to repeat five times, use a 1/5 scale : '''0.2''') and ''surface'' the surface id you want to work with if you're dealing with MD3s.
== Example of a detail map definition : ==


Example of a detail map definition :


Get to the 884 crate texture definition in the textures.def included with the HRP :
Get to the 884 crate texture definition in the textures.def included with the HRP :
Line 17: Line 23:
}</pre>
}</pre>


Get this detail texture (I found it [http://www.web3d-fr.com/tutoriels/modelisation/Textures1/index.php:here]) and save it as '''0884_detail.jpg''' in the '''highres/textures/''' directory :
Get this detail texture (I found it here : [http://www.web3d-fr.com/tutoriels/modelisation/Textures1/index.php]) and save it as '''0884_detail.jpg''' in the '''highres/textures''' directory :


[[Image:detail.jpg]]
[[Image:detail.jpg]]
Line 28: Line 34:


[[Image:evenmoredetailedmapping.jpg]]
[[Image:evenmoredetailedmapping.jpg]]
Detail mapping can also be used on models :
[[Image:detailedpigcop.jpg]]

Latest revision as of 23:01, 3 January 2016

Detail mapping is one of the new engine features in EDuke32. It uses hardware multitexturing to combine a regular texture map with a greyscale texture scaled differently, resulting in memory-efficient additionnal detail.

DEF syntax to define detail textures inside model or texture blocks :

detail { file filename scale scale surf surface}

where filename is a regular double-quoted texture complete path and scale a positive floating-point value that'll determine how much your detail map should repeat on your diffuse map (if you want your detail map to repeat five times, use a 1/5 scale : 0.2) and surface the surface id you want to work with if you're dealing with MD3s.

Example of a detail map definition :

Get to the 884 crate texture definition in the textures.def included with the HRP :

texture 884 {
  pal 0 { file "highres/textures/0884.jpg" }
}

Add a detail texture definition line so it looks like that :

texture 884 {
  pal 0 { file "highres/textures/0884.jpg" }
  detail { file "highres/textures/0884_detail.jpg" scale 1.0 }
}

Get this detail texture (I found it here : [1]) and save it as 0884_detail.jpg in the highres/textures directory :

Make sure detail mapping is enabled in the advanced graphics option menu (or just type r_detailmapping 1 in the console), fire up E1L1 and see the result on the roof crate :

Try setting the scale to a lower value to add even more detail (a 1.0 scale doesn't make much sense because your it doesn't add any potential detail to your texture). Here's the same crate with a 0.2 scale (meaning that the detail map will fit five times on the diffuse map) :

Detail mapping can also be used on models :