Jump to content
Eternal Lands Official Forums
Roja

Shadow bug with alpha objects

Recommended Posts

There's a bug that your shadow disappears if your character wears an object with an alpha map. You can try it by equipping a saw or the rose bouquet.

 

Would be great if this can be fixed, because with the new medallions-they ALL have alpha maps :D

 

 

Another thing to note is that it appears that alpha maps on player characters are a bit different than those of static 3d objects. They seem to use grayscale alpha..which is great! Makes it have soft, non jaggedy, edges. I hope it can stay, however it might be part of the problem? I don't know.

Share this post


Link to post
Share on other sites

haven't noticed the shadow disappearing bug before, but there's one thing i noticed:

 

having done custom clothing, some of which have alpha maps (torn cloaks, cutaway helms, crowns, etc), if you have UVP=0, the alpha effect (or see-through, whether fully transparent or semi-transparent) is shown quite effectively. but, if you have UVP=1, the transparent effect goes beyond making the mesh see-through only for that layer - in fact, it makes the whole character see-through, as shown in the following screen shots:

 

alphabug001.jpg

 

the above screen shot (using UVP=0) shows the legs through the cape, which is the favored effect, but:

 

alphabug002.jpg

 

the above screenshot (using UVP=1) shows the background itself - THROUGH THE CHARACTER.

 

this could be a property of the graphics card, or the OpenGL, i'm not sure. quite a funny thing really, but then it could be related to the bug reported.

Edited by DibClark

Share this post


Link to post
Share on other sites

Can anyone maybe take a look at this bug? It'll be a much bigger issue with the upcoming update because like I said, all medallions have transparency, and with more items with alpha coming it's gonna look odd with some users not having shadows :P

Share this post


Link to post
Share on other sites

Can't reproduce this. Got a shadow with and without saw equipped, UVP = 0 though.

 

Maybe it's bug in the vertex program.

 

 

 

btw. (caution getting technical) lots of unused variables in the anim_shadows.vert program: diffuse 1-4, attenuation 1-4 and light_position 1-4 thats 64 wasted variables (96 is the minimum in the specs)

Share this post


Link to post
Share on other sites

I've looked a bit at it and first, the feature that allows you to have grayscale transparency on actors should be disabled IMO. The problem is that there's 2 ways to manage the transparency in the engine, the first one is by disabling the display of pixels that have an alpha value under a threshold. The second one is blending the pixels that are already displayed on the screen with the new transparent pixels.

 

The first one allows to display objects in any order and ensure that the display will always be good. The second one requires a pretreatment that sorts the triangles along their screen depth in order to display them in the right order. The problem is that it's costly and so it isn't done actually in the engine. I've took a screenshot that illustrates the problem:

elscreen001.png

 

I've drawn an S on the alpha map of the cape. The middle of the S has an alpha under the alpha threshold. As you can see, for these pixels, the display is correct. On the borders of the S, I have a smooth transparency and here we see that the display is not good. This happens because the cape is displayed before the character body so then when drawing the body, the corresponding pixels are not displayed because they are behind the pixels of the cape.

 

Now, about the shadow bug, I've not spotted yet where the problem is exactly. In fact, if I disable the alpha threshold, it works but the shadows will not take in account the transparent areas. What is weird is that the vertex program used to display the shadow is the same that the one used to display the actor on the screen. So I don't understand why the alpha threshold works with the normal display and not with the shadow display. I'll try to investigate more on it though...

Share this post


Link to post
Share on other sites

Thanks for replying Schmurk :)

 

Yes I guess the grayscale alpha should be disabled..I dont' even know how that got in there. I know we tested it before for ALL alpha objects in the game, which is when we noticed that problem and decided not to use it. But somehow it stayed with the actors.

Share this post


Link to post
Share on other sites

Thanks for replying Schmurk :)

 

Yes I guess the grayscale alpha should be disabled..I dont' even know how that got in there. I know we tested it before for ALL alpha objects in the game, which is when we noticed that problem and decided not to use it. But somehow it stayed with the actors.

There is a possibility that such a thing could be used when averaging together an area. Say there is a texture that you downscale. Or maybe later on, waving grass is pre-rendered and used as a texture. Something like that. If you don't want the engine dealing with a level of detail that is pointless, a threshold cut-off would be useful. Such a thing could be used to downscale the details of textures on loadup to allow slower video cards to handle it at lower resolutions.

 

If you disable it, I suggest you don't forget it or remove it.

 

Of course, I have not fiddled with the rendering engine code, but I hope that this opinion is useful.

Edited by nathanstenzel

Share this post


Link to post
Share on other sites

If the grayscale alpha is disabled, will the (excuse my ignorance for the term) translucent items not be rendered? Like my cape in my previous post, will that be rendered solid? The way I understand it, only solid whites and blacks alpha maps will be allowed?

 

If so, is there any way to keep the grayscale alpha (so that translucent items are displayed) and work on the vector engine itself?

Share this post


Link to post
Share on other sites

Yes, disabling the grayscale will forbid what you did on your cape.

 

It is maybe possible to do something in the engine to keep this feature but I'm not totally sure, it has to be studied.

The idea would be to order the display of actors' parts in order to display parts which could have transparency after parts which are not supposed to have some.

The order I propose would be: feets, legs, gloves, torso, medallion, head, helm, weapon/shield, cape.

 

Thus we would be able to ensure the display of the transparency per actor. Then, the actors could be sorted according to their distance to the screen in order to display them in the right order as well and ensure the correctness of the display between actors.

 

Anyway, it's just the theory, I'm not sure it can be done easily...

 

 

 

Now, about the shadow problem, I think the problem comes from the anim_depth.vert shader or its use. I had not enough time yet to understand what it does and what are the difference with the normal shader (anim.vert) but I'll try to have a look at it when I can...

Share this post


Link to post
Share on other sites

@Roja:

 

I've submitted a fix for the shadow bug.

So now, you can have shadows on actors with some transparent parts and even better, the transparent parts don't cast shadows (it was not the case before even with the normal render mode). ;)

 

About the greyscale alpha, I've let it as it is for the moment. In fact, the normal render mode and the vertex program one are using 2 different mechanism to render the meshes.

 

The normal render takes in account the order of the equipped items so if you equip your cape after your shirt, the alpha on the cape will work correctly but if you equip the cape first, it won't work.

 

With the vertex programs, the render uses the order of the meshes that is defined in the XML files so actually it's quite good because you can choose it yourself. :)

If you're interested, I can take more time to see if we can use the same mechanism for the normal render mode...

Share this post


Link to post
Share on other sites

Thanks for fixing the shadow bug! :)

 

The xml files you're talking about, which ones exactly? Like I tried changing the order in human_female.xml but it gave the same effect.

 

Oh another thing, when Use animation program is on, then no shadows appear for the characters.--Also does this change the placement of the bones? Because the mesh is moving slightly in the shoulders and other areas when I toggle it on/off.

Share this post


Link to post
Share on other sites

Thanks for fixing the shadow bug! :)

 

The xml files you're talking about, which ones exactly? Like I tried changing the order in human_female.xml but it gave the same effect.

 

For my tests, I've put the capes after the shirts in the player_standard.xml file.

 

 

Oh another thing, when Use animation program is on, then no shadows appear for the characters.--Also does this change the placement of the bones? Because the mesh is moving slightly in the shoulders and other areas when I toggle it on/off.

 

Sorry, I've forgot to say that I've also modified the anim_depth.vert file. So if you didn't copied the file in your shaders directory, it's normal that you still don't have the shadows. ;)

 

About the slight position difference between the vertices of the 2 modes, I never noticed it and I don't know where it comes from. I didn't change anything related to that so it should be there for a quite a long time now. It's quite disturbing though, I'll try to figure why it does that...

Share this post


Link to post
Share on other sites

Ok, thanks, I got the xml thing to work now, order I put:

	&boots;
&legs;
&shirts;	
&necks;
&capes;
&hairs;	
&helmets;
&weapons;	
&shields;

 

 

One odd thing I noticed...If I have "use animation program" turned off, the vertices at the top of the boots while wearing "baggy pants" are messed up. I only seem to be able to get rid of it by putting the animation prog. back on.

Share this post


Link to post
Share on other sites

eek..seems like it appears with animation program on too. I had to take the pants off/put them back on for it to show correctly.

Share this post


Link to post
Share on other sites

Use animation program also changes the appearance of the special swords and there are no longer any particles visible for them.

Share this post


Link to post
Share on other sites

I fear to not have enough time to look at it for a while... :(

As soon as I have some free time, I'll have a look though.

But if anybody else want to take the relay, feel free to do it. I can still give some support about it via the forum.

Share this post


Link to post
Share on other sites

Ok, it's alright Schmurk-thanks for your help thus far :)

 

However is it possible to revert the changes, until someone has time to work on it more? I guess we have to pick what we want: no shadows on transparent, or the other bugs I mentioned above. I think the no shadows is the better option.

Share this post


Link to post
Share on other sites

I don't think so. I touched only the display of the shadow, so the normal display should not be affected. Regarding to the update thread, it seems more linked to the medallions code.

 

I'm sorry but I still didn't have time to revert my changes or look at what is causing the sword bug. I'll try to find some time this evening to look at it...

Share this post


Link to post
Share on other sites

I've looked at it at home and I have the effects on the sword. So I don't understand why you don't have them anymore. As I said just before, I only touched to the display of shadows so the effects on swords should not be affected too.

 

However, there's maybe a difference between hardwares so this is why we don't have the same result. If you disable the shadows, are the effects back on the swords ?

 

Anyway, I've reverted my changes in the code but not in the shader (it's really a very minor change so it can't affect anything). This means that it corrects the shadow bug with transparent objects but the shadows don't take in account the alpha map of items. Tell me if it resolve your issues...

 

If you still have the issues, you can try to revert the old shader, we never know... :)

Open the file shaders/anim_depth.vert. Almost at the end, you have this line:

MOV result.color, constant.xxxx;

 

Replace it by this one:

MOV result.color, constant.xxxz;

 

About the other bugs on the position of the vertices, there were here before my changes and I don't see how my changes could have any impact on that. This issue should have to be looked more in depth...

Share this post


Link to post
Share on other sites

Hi, ok I tried it and it still happens. I also tried changing the line in the shader...so yeah you're right, I guess it's not related-it was just at this time that I first noticed these things :P

And I'm sorry, I was partially wrong about the weapon effects-the particles are still working(I was looking at the axes which apparently don't have particles) it's just that with animation program turned on the glowy swords/axes show as opaque, and when off they show as transparent. But probably also not related..sorry for the needless trouble.

Share this post


Link to post
Share on other sites

Np ;)

 

Then you can keep the fix in the shader that makes the shadows work with transparent items.

If you want the shadows to take in account the alpha maps, I can then redo my changes in the code later, just tell me...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×