07-19-2017, 09:03 PM
(07-14-2017, 05:49 AM)TehSe7en Wrote: That is sooo awesome! Thanks for your hard work! Hopefully I can use GLSL shaders in 3dsmax (I heard vray support rendering them)
Thank you. I don't think that GLSL is widely supported through, mainly because it's tied to OpenGL, and I think that most engines supports both DirectX and OpenGL, so they use something else that supports both and compiles as needed.
At this point I kind of regret working on this, since it probably won't find much use, but anyway since I already started this, I just decided to make the changes also work on Sun/Moon models, where some had the same problems affecting the Koffing model. One example is Cosmog:
Same problem Koffing had. Point sprites being treated as triangles.
So here a few things I discovered with this:
- Sun/Moon shaders are mostly the same compared to OR/AS ones, main change is shader uniform ids, some code related to matrix transform, and when the point sprite size is calculated, it multiplies the color by 3 (!), and OR/AS doesn't have such multiplication.
- Shader have a uniform called "PressDir" that controls the direction of the projected shadow. This direction is stored inside the model file, on OR/AS as a uniform command and meta data, on Sun/Moon directly inside the material section.
- The name of the shader used to project shadow is called "PressShadow". The shader used for billboarded effects like Cosmog stars and Koffing smoke is "PokeFire", and the one for projected shadows is called "PokeFireShadow". The "normal" shader for Pokémon is called "PokePack" on OR/AS, and just "Poke" on Sun/Moon.
- Like on OR/AS, the low res Pokémon model is ALSO used on the projected shadow. I also suspect that the projected shadow model is using the stencil buffer to render the entire model as a single plain color, but I didn't made any analysis on this yet.
It's probably worth noting that the above fix only works when using the original shaders from Pokémon OR/AS, because the default shader supplied with SPICA isn't capable of rendering those effects.