Skip to content

Misc 1.) Using this shader with Raycast

Manashiku edited this page Apr 3, 2023 · 1 revision

Thanks to Chips for figuring out how to do this!


Before you start loading stuff into MMD

Because of Genshin's diffuse textures, you're going to run into pretty apparent errors immediately. If you've tried to use the shader with raycast in the past, you already know what those are.
So to start, you're actually going to want to go into your raycast folder. Inside the Shadow folder are a few different fx. Select PSSM1.fx, PSSM2.fx, PSSM3.fx, and PSSM4.fx. Create a copy of each of these files and name them whatever you want, just make sure its something you will remember later.
Now, in each of those new copies you made, edit the line const float CasterAlphaThreshold = 0.0; and set the float to 1.0f. image Don't use notepad to edit shaders. I will actually curse you.
This will fix the model not casting shadows.


Setting everything in MMD

After doing the above step, you're ready to set up the raycast scene. Don't worry about assigning any raycast stuff to the actual model(s) yet, just worry about the environment.

I will explain things tab by tab in the MMEffect window, starting at the Main tab.

Main

In this tab, you will assign the MMDGenshin shader as normal.
(3:Mat_face is the eye star material, I didn't have the morph for it set up yet so don't mind that.) image

MaterialMap

Moving down the tab list you'll end up on MaterialMap. In this tab you're going to assign the model the material_skybox.fx shader. This will fix the model's transparent look as well as any weird artifacts. image

PSSM1, PSSM2, PSSM3, & PSSM4

Your final stop is these 4 tabs. In these tabs, you're going to load the copies of the original fx that you made in the Before you start section. image


Now you're all set!

image