Giter VIP home page Giter VIP logo

jsontofx's Introduction

Overview of functionality:

Originally built for a friend, this code converts the JSON files used in Genshin Impact to .fx files to be used in the MMDGenshin shader by Manashiku.

How to use:

Place the .json files to convert in the same directory as the Converter.exe executable. Launch the executable and type in the name of the JSON file to convert.

Optional features:

Use Normals: Decide whether or not to use normals in the .fx file. Please note that current functionality does not contain a normal texture file path in the outputted .fx file. (Default is to not use normals)

Outline Multiplier: For some reason, the raw JSON's outline size is very thin. It is possible that in-game some additional multiplication or math is done to this raw value. Regardless, you may specify a multiplier float to increase the size of the outline. (Eyeballing it, 8 seems to be a reasonable multiplier. Default is 1)

Final notes:

You may want to consider editing the outputted .fx files to your liking of course. The raw numbers alone converted to the .fx files may look off without additional tweaking.

Some things are hardcoded, such as the base material values which all seem to be (1.0F, 1.0F, 1.0F, 1.0F), the paths to the /sub/tex files in the shader, and the fact that "define USE_LIGHTMAP_AO", "define USE_VERTEXCOLOR_AO", and "define USE_VERTEXCOLOR_RAMP_WIDTH" are all enabled regardless of JSON data. Finally, this code uses only the Girl_Tex_FaceLightmap to drive .fx face light map option.

Download the source code if needed and feel free to implement changes. (Consider a PR, if you want.)

To respect intellectual property, the JSON files will not be provided. Do not ask. You can extract them from the game yourself or find them online.

Additional reading:

Official Shader Wiki: https://github.com/Manashiku/MMDGenshin/wiki Table of JSON value conversion: https://docs.google.com/document/d/1AxOFEiPqNvBOYcR5RFI4UzHg6z9tr8Ex7U1lIBVXFwU/edit

Thank you to @Manashiku https://twitter.com/manashiku and @MonoCereal https://twitter.com/monocereal

jsontofx's People

Contributors

octavope avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.