Framed Art: Difference between revisions

From The DarkMod Wiki
Jump to navigationJump to search
(→‎Implementations: Add sections on files & their locations, names, resolutions)
(→‎Implementations: Add Cross Reference Listing)
Line 160: Line 160:


The .tga bumpmaps (aka normal maps) are 256 x 256. The specular .dds maps are 128 x 128 x 32-bit. Editor jpgs are generally 256x256, 24-bit, rarely 512x512, 24 bit. If not present, the editor uses the dds.
The .tga bumpmaps (aka normal maps) are 256 x 256. The specular .dds maps are 128 x 128 x 32-bit. Editor jpgs are generally 256x256, 24-bit, rarely 512x512, 24 bit. If not present, the editor uses the dds.
=== Cross Reference Listing of Image Skin and DDS File Names ===
''With information about art orientation & support for lootability.''
As indicated at the outset, in DR’s Entity Viewer, with a TDM framed painting model, if you select the skin spawnarg and hit the "Choose Skin", you will get an alphabetic list of painting skin names. If you needed the underlying image name, you’d consult the skin & material files; that information is summarized here. In the following list, images are "vertical" (portrait-mode) unless indicated ''by italics'' as "horizontal" (landscape-mode). The skin names all have a "..._torn" variant defined, as well, unless indicated <span style="color: red;>in red</span>.
{| class="wikitable"
|+ Cross Reference Listing
|-
| '''Starter Set: painting[01-11]_d.dds'''
01) †
02) portrait_in_armour
03) shepherd_boy
04) portrait_mage
05) still_life01
06) portrait_peasant_woman
''07) landscape_ruin01''
08) portrait_pagan_queen
''09) artist''
10) portrait_villagemaid
<span style="color: red;> 11) cathedral *
<span style="color: red;>'''Continuation Set: painting[12-15].dds''' (no “_d”)
<span style="color: red;> ''12) carravagio1''
<span style="color: red;> 13) portrait_with_skull01 *
<span style="color: red;> 14) portrait_with_skull02 *
<span style="color: red;> ''15) angel_with_skulls''
<span style="color: red;>'''Builder Set: painting_builder[02-04].dds'''
<span style="color: red;> 02) builder02 *
<span style="color: red;> 03) builder03 *
<span style="color: red;> 04) builder04 *
<span style="color: red;>'''Dead Set: painting_dead[1-2].dds'''
<span style="color: red;> ''1) dead1''
<span style="color: red;> 2) dead2 *
||  '''"M" Set: painting[01-10]_m_d.dds'''
''01) stormy_sea'' **
02) village_dance
''03) windmill''
''04) builder_godisangry''
05) portrait_nobleman
''06) still_life02''
''07) lighthouse''
08) woman_abducted
09) builder_mythology
''10) presenting_severed_head''
'''"L" Set: painting[01-10]_l_d.dds'''
''01) landscape_ruin02''
''02) farmland''
''03) execution''
04) master_builder
05) sorceress
''06) harbor''
07) woman_bathing
08) builder_forge
09) warriors
''10) knight_and_maiden''
<span style="color: red;>'''Merry Set: merrypainting[01,14,40].dds'''
<span style="color: red;> 01) portrait_official *
<span style="color: red;> 14) builder_priest *
<span style="color: red;> 40) portrait_fair_maiden  *
|}
<nowiki>*</nowiki> Image is "vertical", but incorrectly marked as "horizontal" (as of TDM 2.09). That is, skin says:
  model "models/darkmod/decorative/painting_desktop_horizontal.ase"
but, given the image, should say:
  model "models/darkmod/decorative/painting_desktop_vertical.ase"
<nowiki>**</nowiki> Image is "horizontal", but incorrectly marked as “vertical” in skin definition.
† This unnamed vertical male portrait is the default image baked into the model


== See Also ==
== See Also ==

Revision as of 19:49, 12 October 2021

An Introduction to TDM's Framed Painting System

By Geep, October, 2021

The Basics

To add a framed "oil" painting to your FM using DR, right-click and select "Create Model..." to bring up the "Choose Model" dialog. Then either search for “painting” or navigate to models/darkmod/decorative/wall/ and look for "painting…".

From the tree listing, select a particular size model (discussed in the next section), then expand the alphabetized list of available art image "skins". Selecting a skin allows you to inspect it in the dialog’s view pane as shown. If you just see wood boards, you’re looking at the backside; fly around to the front. (See the skins with the "_torn" suffix? Don't select them... they're implementation devices for the lootables discussed further below.)

DR "Choose Model" dialog, with example skin builder_mythology

Available Models

Under decorative/wall/painting… are the models listed in the table below, here from largest to smallest. Frames can accommodate portrait or landscape art by simple rotation on the wall. An exception are the two "desktop" models, which are tilted and have a stand, and have a specified orientation. The "round" frames are actually oval. (There are also "…_tearable" variant models, which you should generally ignore; again, they're mainly used to implement lootables.)

This convenient system of multiple sizes predates the ability of DR to easily rescale a model. You can now use the latter to create additional sizes if required.

Frame Models
Informal Size Name Model Name External Size, h x w Art Size, h x w
Large painting01_l 104.2 x 96.8 94.9 x 65.4
Medium painting01_m 84.1 x 58.0 63.0 x 39.4
Original painting01 56.1 x 38.7 42.0 x 26.1
Round, Original painting_round 56.0 x 40.0 46.0 x 30.0
Round, Small painting_round_s 36.0 x 28.0 28.0 x 20.0
Small painting01_s 32.0 x 23.0 24.0 x 15.0
Miniature painting_minature 16.0 x 12.0 12.0 x 8.0
Desktop, Portrait Mode painting_desktop_vertical 16.9 x 12.0 12.0 x 8.0
Desktop, Landscape Mode painting_desktop_horizontal 13.1 x 16.0 8.0 x 12.0

Sizes are the approximate dimensions in DR units when in portrait orientation (except painting_desktop_horizontal is landscape).

Regrettably, miniature is mis-spelled as "minature" in TDM's formal object names here.

For the desktop frames (whose models are under .../decorative/, not .../decorative/wall/), the dimensions given are with frame and canvas rotated into the vertical plane, i.e., untilted. Kickstand ignored.

In the round frames, art is visibly stretched, along the narrower frame direction.

Random Paintings

For quick decoration of a wall, entities are available that will randomly choose the art within the frame, but just for the 3 largest rectangular frames. See "Create Entity..." then Static/Decoration/Paintings/. Choose the entity for the orientation you want ("hor" or "ver") and frame size: large, medium, or (implied) original.

Lootable Paintings

These entities incorporate essentially the same models and skins as above. Use "Create Entity..." and choose one of the relevant classnames found under Loot/Static (see the table below). With the entity created and selected, open the Entity Viewer, add the spawnarg "skin" with some dummy value, then select that to get the "Choose Skin" viewer. (You will need to filter out the collision texture to see the art in the viewing pane.)

As with every type of loot entity, there is a default loot value that you can change.

When a miniature or desktop painting is looted, it disappears from the game, and a grouping of 3 "mini" paintings is shown as the inventory icon.

With a larger painting, the looted frame remains behind, and a rolled canvas appears in inventory. The looted frame shows wood boards with little bits of canvas where the art had been. If you'd rather have a see-through hole where the art had been, change the value in the "replace" spawnarg, e.g., from "atdm:empty_painting_medium" to "atdm:removed_painting_medium". (But "removed painting..." is only defined for the 3 largest size frames.)

Lootable Paintings
Informal Size Name Class Name
Large atdm:loot_painting_large
Medium atdm:loot_painting_medium
Original atdm:loot_painting
Round, Original atdm:loot_painting_round
Round, Small atdm:loot_painting_round_small
Small atdm:loot_painting_small
Miniature atdm:loot_painting_minature_wall
Desktop, Portrait Mode atdm:loot_painting_minature_desktop_vertical
Desktop, Landscape Mode atdm:loot_painting_minature_desktop_horizontal

(There are also "…_tearable" variant models of all sizes except miniature and desktop.)

Bonus Model

There’s an additional "ornate" frame, that (as of TDM 2.09) just offers one skin, but can use any TDM painting skin, provided you alter the skin’s definition to include that model. The model's gold frame is indeed ornate and created geometrically, superseding whatever framestyle would otherwise supplied by the skin itself. This model is optimized for portrait orientation, including mounting hardware on the back and a slight tilt. The back also has more intricate texturing and modeling.

Ornate Frame
Informal Size Name Model Name External Size, h x w Art Size, h x w
Ornate ornate_frame01 58.4* x 40.5 39.9* x 24.5

The sizes given for the vertical dimension are with the slight tilt. Without tilt, that dimension would be slightly greater.

Implementations

Models & Skins that Combine Art & Frame

For the "builder_mythology" skin, the diffuse texture "painting09_m_d" (distributed by TDM as a dds)

TDM's painting models expect a skin with underlying square factor-of-2 textures (diffuse, normal, and specular). These textures each combine the art area with a 1D-tileable linear painting-frame sample. At right is a diffuse-texture example. The art here is portrait oriented. If it were landscape oriented, the frame sample would still be at the right edge, but the art would be rotated 90 degrees.

Nowadays, the diffuse texture would always 512 x 512, with the art taking up 512 h x 400 w, an aspect ratio of 1.28:1 or equivalently about 1:0.78 . The specular and normal (bump) maps, at lower resolution, deliver the surface topology of a particular frame, while treating the art as simply flat with a coarse canvas-like grain.

As a model, the frame itself is basically 4 perimeter flats with a depressed central rectangle. As already stated, the front side detailing of the frame (and more subtly the art) is provided by the bumpmap. The backside is simply a flat plane with wood planks and no hanging hardware. Of course, models for the round and desktop frames are more involved.

Lootable Paintings

When a loot painting is frobbed, it calls script "frob_loot()". This retains the calling entity's attributes, then calls "frob_item()", which does the standard lootable actions of

  • deleting the calling entity from the game;
  • adding to the loot count;
  • displaying the specified inventory icon, in this case either guis/assets/hud/inventory_icons/painting_rolled_icon or .../loot_icon_mini_paintings.

If the calling entity was of miniature or desktop size (which display loot_icon_mini_paintings), we're done.

Otherwise, frob_loot() instantiates a new entity given by the "replace" spawnarg, in the same place and angles that the original caller had been. By default, this new entity is the appropriate size of "atdm:empty_painting...", which uses as its model the appropriate size of "..._tearable" and as its skin the original caller's skin name with "_torn" appended.

Skin, Material, & Definition Files

Skins for framed paintings are included in tdm_models_decls01.pk4/skins/...

   tdm_decorative_wall.skin	generally
   campaign.skin		for dead1, dead2 materials (painting_dead*.dds files)

Materials associated with skins for framed paintings are included in

   tdm_models_decls01.pk4/materials/tdm_model_decorative_wall.mtr

Definitions for loot painting entities, including after-frob empty-frame entities, are included in

   tdm_defs01.pk4/def/tdm_loot.def 

Underlying Image File Locations and Naming Conventions

Existing painting texture images may be found within tdm_models02.pk4 …

In dds form: /dds/models/darkmod/props/textures/

   painting*.dds
   merrypainting*.dds

In other forms: /models/darkmod/props/textures/...

   painting*_d_ed.jpg
   painting*_local.tga

Texture filenames in general follow this TDM naming convention, though early textures less so:

  • Suffix _d means "Diffuse map"
  • Suffix _s means "Specular map"
  • Suffix _local means "Bump map" aka normal map
  • Suffix _d_ed means "Diffuse for Editor Preview"

The standard painting filenames appear as named sets, reflecting not their artistic content, but instead their history of incorporation into TDM core assets. Just looking at the diffuse ones, and inferring names for the sets and for individual items giving skin names. It is likely that "M" & "L" sets were introduced at the same time as the Medium & Large size painting models, and at that time may have distinguished between 256 x 256 and 512 x 512 DDS files. But now (at least for the core asset DDS) all the DDS are 512 x 512. So really, skins from any of these sets can be used with any size "painting01…" frame model.

File Resolutions

As mentioned above, the diffuse .dds are 512 x 512 x 32 bits. They all contain

  • The art in the leftmost 400 pixels (x positions 0-399)
  • A vertical sample of the frame in the rightmost pixels.

In older FMs, you may encounter lower-resolution versions of the diffuse files. In a 256-wide image, the art takes up 200 pixels (0-199), the frame 57 pixels.

The .tga bumpmaps (aka normal maps) are 256 x 256. The specular .dds maps are 128 x 128 x 32-bit. Editor jpgs are generally 256x256, 24-bit, rarely 512x512, 24 bit. If not present, the editor uses the dds.

Cross Reference Listing of Image Skin and DDS File Names

With information about art orientation & support for lootability.

As indicated at the outset, in DR’s Entity Viewer, with a TDM framed painting model, if you select the skin spawnarg and hit the "Choose Skin", you will get an alphabetic list of painting skin names. If you needed the underlying image name, you’d consult the skin & material files; that information is summarized here. In the following list, images are "vertical" (portrait-mode) unless indicated by italics as "horizontal" (landscape-mode). The skin names all have a "..._torn" variant defined, as well, unless indicated in red.

Cross Reference Listing
Starter Set: painting[01-11]_d.dds

01) †

02) portrait_in_armour

03) shepherd_boy

04) portrait_mage

05) still_life01

06) portrait_peasant_woman

07) landscape_ruin01

08) portrait_pagan_queen

09) artist

10) portrait_villagemaid

11) cathedral *

Continuation Set: painting[12-15].dds (no “_d”)

12) carravagio1

13) portrait_with_skull01 *

14) portrait_with_skull02 *

15) angel_with_skulls

Builder Set: painting_builder[02-04].dds

02) builder02 *

03) builder03 *

04) builder04 *

Dead Set: painting_dead[1-2].dds

1) dead1

2) dead2 *

"M" Set: painting[01-10]_m_d.dds

01) stormy_sea **

02) village_dance

03) windmill

04) builder_godisangry

05) portrait_nobleman

06) still_life02

07) lighthouse

08) woman_abducted

09) builder_mythology

10) presenting_severed_head

"L" Set: painting[01-10]_l_d.dds

01) landscape_ruin02

02) farmland

03) execution

04) master_builder

05) sorceress

06) harbor

07) woman_bathing

08) builder_forge

09) warriors

10) knight_and_maiden

Merry Set: merrypainting[01,14,40].dds

01) portrait_official *

14) builder_priest *

40) portrait_fair_maiden *

* Image is "vertical", but incorrectly marked as "horizontal" (as of TDM 2.09). That is, skin says:

 model "models/darkmod/decorative/painting_desktop_horizontal.ase"

but, given the image, should say:

 model "models/darkmod/decorative/painting_desktop_vertical.ase"

** Image is "horizontal", but incorrectly marked as “vertical” in skin definition.

† This unnamed vertical male portrait is the default image baked into the model

See Also

Fidcal's March 3, 2011 forum post

OGDA's March 10, 2021 forum post