Terrain: how to convert and use textures from cc0textures.com

Status
Not open for further replies.

only_a_ptr

Infamous Developer
Administrator
Developer
Joined
Jan 31, 2018
Messages
169
Location
Prague, CZ
I found an excellent resource for ground textures: https://cc0textures.com/. All textures are licensed CC-0, detailed and come with all data needed by our terrn2 shader generator. I'm talking about the "diffusespecular" and "normalheight" combined images, see https://docs.rigsofrods.org/terrain-creation/terrn2-subsystem/#example.

To convert the images for our use, I installed https://imagemagick.org/ (recent version, doesn't really matter) and wrote a Windows shell script:
Code:
:: --------------------------------------------------------------------------------------------
:: Creates "DiffuseSpecular"/"NormalHeight" textures for Ogre terrain shader generator.
:: Doc: https://wiki.ogre3d.org/Ogre+Terrain+System
:: Tutorial: https://ogrecave.github.io/ogre/api/latest/tut__terrain_sky_fog.html
:: rev5
:: --------------------------------------------------------------------------------------------

@set IN_BASENAME=Ground039_1K
@set IN_EXT=jpg

@set OUT_BASENAME=cc0textures_Ground039
@set OUT_EXT=png

:: 1a. if needed, mix AO into diffuse
@set IN_AO_FILE=%IN_BASENAME%_AmbientOcclusion.%IN_EXT%

if exist %IN_AO_FILE% (
    @set DIFFUSE_FILE=%OUT_BASENAME%_Diffuse.%OUT_EXT%
) else (
    @set DIFFUSE_FILE=%IN_BASENAME%_Color.%IN_EXT%
)

if exist %IN_AO_FILE% (
    @echo Generating diffuse file: %DIFFUSE_FILE%
    magick composite -compose Multiply %IN_AO_FILE% %IN_BASENAME%_Color.%IN_EXT% %DIFFUSE_FILE%
)

:: 1b. negate roughness to create specular map.
@set SPECULAR_FILE=%OUT_BASENAME%_Specular.%OUT_EXT%
magick convert %IN_BASENAME%_Roughness.%IN_EXT% -negate %SPECULAR_FILE%

:: 2. compose DiffuseSpecular texture (RGB = diffuse, A = specular).
@set DIFFUSESPECULAR_FILE=%OUT_BASENAME%_DiffuseSpecular.%OUT_EXT%
@set DIFFUSESPECULAR_DDS=%OUT_BASENAME%_DiffuseSpecular.dds
magick composite -compose CopyOpacity   %SPECULAR_FILE%  %DIFFUSE_FILE%  %DIFFUSESPECULAR_FILE%

:: 3. compose NormalHeight texture (RGB = normal map, A = heightmap).
magick composite -compose CopyOpacity %IN_BASENAME%_Displacement.%IN_EXT%  %IN_BASENAME%_Normal.%IN_EXT% %OUT_BASENAME%_NormalHeight.png
To use the script, copy the above text to a text file with .bat/.cmd extension, download some textures, enter filenames to the script and run it.
You can use the resulting images as-is, or convert them to DDS using GIMP (version 2.10.10+ has builtin DDS plugin).

The attached ZIP contains the convert script and some sample textures.
I'm a horrible modder, but I think the textures alone look very good in the screenshot.
 

Attachments

  • cc0textures-converter.zip
    45.5 MB · Views: 192
  • ror cc0textures screenshot.png
    ror cc0textures screenshot.png
    1 MB · Views: 215
Last edited:
Status
Not open for further replies.
Back
Top