Possible bug in Unshaded.frag

I was dabbling with my orbit lines and decided they were standing out too much so I decided to use an alpha of 0.5 on them but it was still rendered opaque.



After checking the frag I noticed the following:



[java]

vec4 color = vec4(1.0);

[…]

#ifdef HAS_COLOR

color *= m_Color;

#endif

[/java]



Changing it to “Color = m_Color;” fixed this, but the problem had to be elsewhere since if you multiply 1.0 * 0.5 it should still give you an alpha of .5…



After digging a bit more I think I found the solution.



I changed this:

[java]

#ifdef HAS_LIGHTMAP

#ifdef SEPARATE_TEXCOORD

color.rgb *= texture2D(m_LightMap, texCoord2).rgb;

#else

color.rgb *= texture2D(m_LightMap, texCoord1).rgb;

#endif

#endif

[/java]



to



[java]

#ifdef HAS_LIGHTMAP

#ifdef SEPARATE_TEXCOORD

color *= vec4(texture2D(m_LightMap, texCoord2).rgb, color.a);

#else

color *= vec4(texture2D(m_LightMap, texCoord1).rgb, color.a);

#endif

#endif



gl_FragColor = color;

[/java]



It seems to have taken care of the problem and the tests I did with my scene gave perfect results, but maybe there are circumstances where it would break things.



Waiting for input on this.

Last time i checked transparency was working fine with unshaded.



I don’t get what you changed in the end? Do you have 2 sets of texture coordinates?

I made two classes, Circle and Trail , which are meshes. I’ve used the Sphere mesh as a basis for them. There’s no texture, only a color applied to it.



In short they’re Mode.Lines meshes.

Thinking about it, if you want to test the transparency, make a WireSphere and try a color with an alpha of .20 or something. It should still be rendered opaque.

@nehon you’ve got to stop hacking into my computer. Or something.



Now it works fine w/o the mods I just made. IT WASN’T WORKING damnit! :cry:



goes to sulk in a corner

that’s the devil’s pact again :wink:

Or just a typo… sigh