• Dear visitors,

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

    Team ACM.

QUESTION SHADER REPLACEMENT Keep transparency of the material

Ternal

Member
As in the question:

i've changed a the shader of a material from ksGrass to ksMultilayer, added everything and everything works fine except the transparency of the material, which now became solid. Tried to add transparency but nothing changes

[SHADER_REPLACEMENT_...]
SHADER = ksMultilayer
BLEND_MODE = ALPHA_BLEND
IS_TRANSPARENT = 1
MATERIALS = edge_sand,
RESOURCE_0 = txDiffuse
RESOURCE_TEXTURE_0 = EDGE_SAND.dds ; TEXTURE refers to texture in original model
RESOURCE_1 = txDiffuse
RESOURCE_FILE_1 = EDGE_SAND.dds
; RESOURCE_2 = txMask
; RESOURCE_COLOR_2 = 255,255,255
RESOURCE_2 = txMask
RESOURCE_FILE_2 = EDGE_SAND_MASK.dds
RESOURCE_3 = txDetailR
RESOURCE_FILE_3 = EDGE_GRAVEL_MULT.dds
RESOURCE_4 = txDetailG
RESOURCE_FILE_4 = EDGE_GRAVEL_MULT.dds
RESOURCE_5 = txDetailB
RESOURCE_FILE_5 = EDGE_GRAVEL_MULT.dds
RESOURCE_6 = txDetailA
RESOURCE_FILE_6 = EDGE_GRAVEL_MULT.dds
FILL_MISSING_TEXTURES = 0

[SHADER_REPLACEMENT_...]
MATERIALS = edge_sand,
PROP_...=magicMult,0.5
PROP_...=multA,0.2,0.2
PROP_...=multB,0.5
PROP_...=multG,0.5
PROP_...=multR,0.5
PROP_...=ksAlphaRef,1
PROP_...=ksAmbient,0.40
PROP_...=ksDiffuse,0.25
PROP_...=ksSpecular,0.1

Any idea on how to keep the transparency? Thanks
 

Ternal

Member
With ALPHA_TEST it works fine, but now i have a stretched textures, which is not happening with the other one i replaced (without Alpha)

[SHADER_REPLACEMENT_...]
SHADER = ksPerPixelAT
BLEND_MODE = ALPHA_TEST
IS_TRANSPARENT = 1
MATERIALS = edge_sand,
RESOURCE_0 = txDiffuse
RESOURCE_TEXTURE_0 = EDGE_SAND.dds ; TEXTURE refers to texture in original model
RESOURCE_1 = txDiffuse
RESOURCE_FILE_1 = EDGE_GRAVEL_MULT.dds
 

Ternal

Member
With ALPHA_TEST it works fine, but now i have a stretched textures, which is not happening with the other one i replaced (without Alpha)

[SHADER_REPLACEMENT_...]
SHADER = ksPerPixelAT
BLEND_MODE = ALPHA_TEST
IS_TRANSPARENT = 1
MATERIALS = edge_sand,
RESOURCE_0 = txDiffuse
RESOURCE_TEXTURE_0 = EDGE_SAND.dds ; TEXTURE refers to texture in original model
RESOURCE_1 = txDiffuse
RESOURCE_FILE_1 = EDGE_GRAVEL_MULT.dds
Any idea @Johnr777? Thanks man :)
 

Johnr777

Moderator
Any idea @Johnr777? Thanks man :)
Yes...

Code:
RESOURCE_0 = txDiffuse
RESOURCE_TEXTURE_0 = EDGE_SAND.dds ; TEXTURE refers to texture in original model
RESOURCE_1 = txDiffuse
RESOURCE_FILE_1 = EDGE_GRAVEL_MULT.dds
This code is asking to load 2 diffuse textures. ksPerPixelAT only uses one texture - diffuse
 

Ternal

Member
I will try to understand how to make it work properly, thanks for now man :)

Tried everything but i still have problems, i'm about to give up really.

The original material, set to ksGrass have

txDiffuse with the materials of the sand (the one with alpha)
txVariation with the materials of the graveltrap

ksPerPixelAT have only txDiffuse to fill but if i use the sand materials, i have the wrong result, if i use the graveltrap materials is the same result.

I'm missing something.... how can i replace the ksGrass, keep the transparency and have the txVariation texture in it?

I tried everything i know, but something is not working in any case :-/
 
Last edited:

fughettaboutit

aka leBluem
I will try to understand how to make it work properly, thanks for now man :)

Tried everything but i still have problems, i'm about to give up really.

The original material, set to ksGrass have

txDiffuse with the materials of the sand (the one with alpha)
txVariation with the materials of the graveltrap

ksPerPixelAT have only txDiffuse to fill but if i use the sand materials, i have the wrong result, if i use the graveltrap materials is the same result.

I'm missing something.... how can i replace the ksGrass, keep the transparency and have the txVariation texture in it?

I tried everything i know, but something is not working in any case :-/
Shader ksMultilayer is not meant to be used with transparency - I might be wrong with this!

Why not use ksGrass shader? Its the only shader with a variation texture, If you have problems with
[GRASS_FX]
then use this empty line, so it doesnt get hidden:
ORIGINAL_GRASS_MATERIALS =

You could also use ksPerPixelAT_NM, it has a slot for NM-map at least.
 
Last edited:

Ternal

Member
Shader ksMultilayer is not meant to be used with transparency - I might be wrong with this!

Why not use ksGrass shader? Its the only shader with a variation texture, If you have problems with
[GRASS_FX]
then use this empty line, so it doesnt get hidden:
ORIGINAL_GRASS_MATERIALS =

You could also use ksPerPixelAT_NM, it has a slot for NM-map at least.
because with ksGrass the RainFX won't work properly. Graveltrap while rainig should take a darker look which can be replicated with soaking materials, but ksGrass don't let affect it, and it remain to bright

problem (1).jpg
problem (2).jpg
 
Top