Thứ Tư, Tháng Chín 28, 2022
- Quảng cáo -
HomePOSTarticles/Grabing models and textures from game or 3D application.md at master ·...

articles/Grabing models and textures from game or 3D application.md at master · aknavj/articles

THIS ARTICLE IS STILL UNDER CONSTRUCTION

Grabing Models and Textures from Game or 3D application

Goal

The main goal of the article is to summarize methods and techniques what you can use to extract 3D Models 
and Textures from a game or 3D Application. For further reading, I will provide additional, explanatory 
links as the article progress for a better understanding.

Introduction

There are already a few methods of how to grab or export models with textures from any game or application. I would like to divide them into two main groups:

Bonus: (This section will come)

There is many ways and reasons how or why you want to use obtained data:

  • Personal usage: Just play with it around for a fun.
  • Study how GFX is made: 3D geometry topology, UV-Maps, level design, etc…
  • Study how Game engine functions: Mostly for a viewing rendering optimizations. Check this study of GTA 5 Rendering engine made by Adrian Courrèges.
  • To learn programming: Use assets for rendering models, textures because no one wants to look whole life on textured CUBE.
  • Optimizing speed-runs: Some tools can get/show trigger which are represented by boxes. This can be used to find an exploit.
  • 3D printing: For example just follow this instructions!
  • Creating an impressive video: Known as “3D Edit” for example CS:GO 3D-Edit like NikkyHD, Fuze or maro2k8!
  • Modding a game:
    • Total conversion: For example Duke Nukem 3D ‘Forever’ in Serious Sam 3

Lethal way

Lethal way breaks all Legal agreements with software/game vendor and distributor. Simply you are not supposed to reverse engineer a product or ‘steal’ any kind of content created by a vendor it is their own intellectual property. But we are doing it because it is fun and most the hardcore fans do not simply care. At least what you can do is not to share “ripped” content for commercial purposes.

Before you will start to use any Ripper tool or Graphics analyzer it is a good practice to understand what the Tool does and what is happening inside application.

At first,you must be aware of which Graphics API does the game run and check if tool or software of your selection does support that criteria, otherwise it might not work.

There are some cases of “software protection” against reverse engineering tools that will disable the functionality of software disassemblers or profilers or even prevent it from running the application.

The second you must realize that it is impossible to capture Frames per second in real-time from the graphic card, so every time you will do the ‘Frame grab’, the application will freeze for a few seconds or minutes.

And for the third, you must be aware that everything you are grabbing is handled by Game Engine of the game itself. Generally, Game Engine has its sub-system called ‘Rendering engine’ which is in the most common way responsible for managing everything that you see on the screen and in what order it will be displayed.

The Rendering engine is working with all 3D data structures such as vertices, polygons, UV coordinates, and textures. Under the hood Rendering engine is also handling their optimization before sending it to the video buffer memory and before it is all displayed in the frame of the application.

You will find more informations in Own Tool section.

So you might also grab additional “unwanted” data, which are practically hidden but their representation still exists in video memory such as:

  • Light cones (volumetric FX effect)
  • Portal areas for indoor or outdoor rendering
  • Trigger areas (represented by Cube/Box shape or Positional Null Axis)
  • Level of details
  • Collision-shaped representations (boxes, cylinders, spheres)

Example of Usage:

The following game selection was made not because I loved those titles, but because there is still a lack of third-party community extraction tools for file formats. They are hard to crack or not interesting enough to give a try. This serves as proof that you can still extract game data from most of the games without official or community support.

  • For a Graphics Analyzer section I have used the DirectX 11 game steam-version of Alien: Isolation from Creative Assembly.

  • For Ripper Tools section I choose to use older DirectX 9 game steam-version of Dead Space 2 from Visceral games (EA)

Graphics Analyzers

Ripper Tools

Using a following software:

  • PC Game Dead Space 2 – steam version
  • 3D Ripper DX
  • Ninja Ripper
  • Autodesk 3D Studio Max 2010 – For model Import/Export
  • Maxon Cinema 4D – For viewing data
Using 3D Ripper DX
  • For a more detailed software usage please follow this guide.

A 3D Ripper DX is a tool which enables you a grab frame data like 3d models, textures, and shaders. For 3d models it utilizes own file format called “.3DR” so for a successful viewing you must have any version of 3D Studio Max from 2009 to 2014 and installed import plugin which is included in 3D Ripper DX installation. Any other data such as textures (DDS Format) and shaders (Plain Text format) are viewable with common tools included in Windows 10.

Note: Shaders are in compiled form so you need to understand for DirectX HLSL Shading language with Fixed Function pipeline its instruction set and registers for a proper decomposition. You can follow for example this guide

Using Ninja Ripper
  • For a more detailed software usage please follow this guide.

Usage and principles are almost the same as 3D Ripper DX, but Ninja does not support wireframe mode. Ninja Ripper also utilizes its own format “.RIP” which is exportable via Python plugin for 3D Studio Max. (Already included in software folder ‘/tool’ directory).

Comparing Data

From results, we are able to see one main difference between Ninja Ripper and 3D Ripper DX is that tool captures the scene before any transformations from GPU shaders, it simply means that characters remain in the T-pose and additional/other geometry is also captured without rotation or deformation. That is one of the reasons why 3D Ripper DX is able to grab only what you are seeing on the screen.

Conclusion

I would like to say that every software has its own use case. For example, if I want to create “diorama” scene I will be choosing a 3D Ripper DX for a “models in motion”, on another side if I would like to have non-deformed assets in their original stage I would choose Ninja Ripper instead.

Non-lethal way

Photogrammery method

Is an easy method, but time and computing-power consuming. The technique is pretty simple only what you need to do is to take many screenshots as possible from different camera angles in the application and use “processing” application which will generate a 3D model with textures from your screenshots. Quality of the generated 3D model with texture is depended on how many “takes” (screenshots) from different camera angle you did. You can follow this guide from page 8 chapter 2.

In theory, you are not altering with original data, or reverse engineering (“cracking”) file structures from the software vendor’s game engine, because you are just taking screenshots.

Example of usage: (Agisoft Metashape)

If you are not familiar with usage of Agisoft Metashape (Photoscan) you can folow this guide

So as first step I started game, in my case it was Doom 2016 – Steam version. In the game I have used built-in Photo Mode where I taken around 300 screenshots from Free camera. Even that most of my screenshots are blured because I didnt turn off “Motion-blur” in Game Advanced Rendering settings, I think final result just came fine.

Drag and drop photos into Agisoft Metashape do a Photo alignment which will generate a Point-cloud data.

After Point-cloud data just build Mesh

For a beter texture resolution you can rebuild Texture using “Build Texture” with higher resolution settings than defined, I have used 8k resolution which is 4 times bigger than source image resolution (1920×1080).


So a little comparsion for final image quality or result.

I will not bother you with optimisations and what you can do as next step but I will recommend to reduce polygon mesh by using something like Simplygon or InstaLOD or built-in functionality like Cinema 4D have called Polygon reduction.

Files for Download:

Summary

Data
Pros
Cons
Note

Models
Generated
Single file
Might have big file size. Needs optimisition

Textures
Generated
Single file
Might have big size. In-correct UV

Shaders
Baked
Not included
Shaders are baked in texture

Legal
Not altering with legal agreement
x

Game Modding

The most easiest way to extract data from game is to have oficial tools from game/software vendor.

Own Tool:

Techniques

Đánh giá post
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments