• Dear visitors,

    The email issue has been finally solved.
    Thank you for your patience and happy browsing.

    Team ACM.

QUESTION ksEditor not saving material BlendMode

austint30

New Member
Hello,

So I have been having a problem ever since I've first started making Assetto Corsa tracks (haven't released any yet but I will some day). Oddly enough I haven't been able to find a solution to this issue by Googling.

Don't know why, but the ksEditor seems to forget the BlendMode that I set for materials. Every time I start the editor and load my track FBX all of my transparent textures that I've set to eAlphaTest are set back to eOpaque. I have to set them all back to eAlphaTest manually or else it would save the kn5 track file with the textures opaque. It still forgets even though I am saving the persistence.

It wasn't so bad on my previous projects since they typically didn't use a lot of transparent textures. But this latest track I am working on will be using a lot of transparent textures used for adding details to the pavement (cracks, lanes, patches, etc), so having to manually set everything back to transparent is just a huge waste of time.

Did anyone else have this problem? How did you solve it?

Here is a couple of pictures of my problem. Huge props if you can guess the location of this track :)

Before editor restart
Screenshot 2022-05-22 173040.png


After editor restart
Screenshot 2022-05-22 173048.png
 

austint30

New Member
Literally an hour after I asked my question I solved the problem myself. Despite me having trouble with this for months, I only figured out exactly what is going wrong right after I post my question online. This happens to me all the time.

I needed to use the ksPerPixelAT shader instead of the ksPerPixel shader. The ksPerPixel shader doesn't preserve the BlendMode apparently, but the ksPerPixelAT does.
 

DennyT

New Member
Hi! May I ask how to make the preview window in Kseditor looks like yours? Mine looks really small and low res.
 

fughettaboutit

aka leBluem
Literally an hour after I asked my question I solved the problem myself. Despite me having trouble with this for months, I only figured out exactly what is going wrong right after I post my question online. This happens to me all the time.

I needed to use the ksPerPixelAT shader instead of the ksPerPixel shader. The ksPerPixel shader doesn't preserve the BlendMode apparently, but the ksPerPixelAT does.
just seen that...

In addition to that i can confirm that BLENDMODE is not correctly loaded from the persistence "...fbx.ini" for at least those shaders, maybe more:
ksPerPixel, ksPerPixelReflection, ksFlags

Not sure about this, but it might also depend on TRANSPARENT=TRUE for at least one/all (?) object(s) using that material

(keep in mind: dont ever use materials blendmode 'alphatest' and objects 'transparent=true' ! - but alphablend+transparent is ok)
 
Last edited:

immortalx

New Member
Sorry to necrobump this thread but I was struggling with this for days and thought it was some common wisdom I was missing. I was making a diff of my current ini and a backup one and all that was changing was that one flag! So thank you OP for the solution (even if you don't ever see this)!
I'm not sure what triggers this. In previous versions of my track ksPerPixel kept the BlendMode value (at least I think so).
 

fughettaboutit

aka leBluem
A known bug; use ksPerPixelReflection shader, for that it works iirc. ksEditor just will not load that value correctly from ...fxb.ini for some reason.

I made a program "kn5FIX_by_INI" that fixes your KN5 after you saved/built it, but you need a correct ....fbx.ini
 

Johnr777

Moderator
If you want ksperpixel to use transparency, why not just use the correct shader? ksPerPixelAlpha or _AT

or am I missing something?
 

immortalx

New Member
John if you're asking me, I tried before ksPerPixelAlpha and it doesn't produce shadows at least on my end. Also ksPerPixel and ksPerPixeAT both work if I set the BlendMode to eAlpha Test, the only difference is that the former works only for the current session but doesn't save the value in persistence. Since ksPerPixel produced the desired result I thought it was valid to use it for transparency (has the same parameters with the AT variant).
I'm using the AT variant now and it's all fine!
 

immortalx

New Member
I understand and I'll stick to those! I just wanted to stress that it's easy for any beginner (me included) to get confused because the bare ksPerPixel has also parameters for transparency and it outputs a valid kn5 with transparency working.
 

Johnr777

Moderator
You can technically set blend on any shader, but that’s more of a kseditor thing than game compatibility. If you also use CSP, its replacement shaders expect the right shaders and setup.
 
Top