Patch at SimpleTextured.j3md to work with transparent png images

Hi!



For my sky sphere, I needed a material that shows transparency from png files, but without darkening it up (thats what happens if I use Lighting.j3md, I get the alpha transparency but it also darkens the sky!).



So I did this change below to allow SimpleTextured.j3md to work properly with png transparent images.



I wonder if that is a missing feature, or if SimpleTextured is intended to be fully opaque?

If so (fully opaque) I will just create a new j3md for myself. Otherwise, below is the patch :slight_smile:



Btw, any tips or advices on this?



[patch]

Index: src/core-data/Common/MatDefs/Misc/SimpleTextured.j3md

===================================================================

— src/core-data/Common/MatDefs/Misc/SimpleTextured.j3md (revision 7551)

+++ src/core-data/Common/MatDefs/Misc/SimpleTextured.j3md (working copy)

@@ -16,6 +16,12 @@

WorldViewProjectionMatrix

}


  •    RenderState {<br />
    
  •        FaceCull Off<br />
    
  •        Blend Alpha<br />
    
  •        AlphaTestFalloff 0.01<br />
    
  •    }<br />
    

+

Defines {

DXT_YCOCG : YCoCg

NORMAL_LATC : LATC

@@ -25,6 +31,11 @@

}



Technique FixedFunc {

  •    RenderState {<br />
    
  •        FaceCull Off<br />
    
  •        Blend Alpha<br />
    
  •        AlphaTestFalloff 0.01<br />
    
  •    }<br />
    

}



-}

No newline at end of file

+}

[/patch]

Note: these are all things that can be set in code on the Material.getAdditionalRenderState() object. Is there something that prevents you from just doing that?

Or by using a j3m and editing the additinal parameters.

@pspeed, knowledge? :>

thx, will take a look at that! so, it seems possible to set them all by code, thats great!!



@normen,

yup, I ran jmonkeyengine alpha4, I saw I can set the alpha blending what would have worked!

Btw, there are several fields that I cannot edit like WireFrame, all the Options for j3m, and other fields are uneditable, is this intended?

Also, I dont use too much it because it freezes too often (doesnt crash) so I cant even report… but my machine does not meet the requirements (it is a mono-core), so that can be the reason…