I wish to thank the developers, specifically jK who revamped the shadow code and made its transformation matrix linear, for their valuable time and effort invested into improving engine features.
I would like to ask if the possibility of reversing the triangle facing on the shadow map would be possible?
Because currently many of Mr Bobs wonderful remakes have non closed volumes, and the shadows look buggy on those because of the shadowmap triangle direction inversion.
I feel that making the tri's on these models double sided would be very wasteful wrt. to tri count.
I know this next question will sound dumb, but is it possible to have the vertex shader animations done in lua unit rendering to pass along to the shadows and have the shadows be animated corresponding to the units? It may just have been me who screwed up this part, but I couldnt get this to work.
See the following screenshot for details.
Shadows with reversed triangle facing
Moderator: Moderators
Re: Shadows with reversed triangle facing
Where does this model come from and how do I put it in a game? :)
I'm curious to see what it looks like in master :)
I'm curious to see what it looks like in master :)
Re: Shadows with reversed triangle facing
The model is Mr Bobs core air repair pad. Checkout the mod from google code here: http://code.google.com/p/baremake/
Re: Shadows with reversed triangle facing
Tried it on master (b182bcbd686aef8e5913), sadly pretty much the same result:
Was hoping it might be fixed with new shadow code, but alas :)Re: Shadows with reversed triangle facing
Tried it it master too, though the shadows are much nicer now (linear :D) they still are back faced.
Is there a technical reason for the back faced shadowing? Like if front faces were used then everything would shadow itself?
Is there a technical reason for the back faced shadowing? Like if front faces were used then everything would shadow itself?
Re: Shadows with reversed triangle facing
That's not so strange, face-culling is disabled for features of any type during the shadow pass (because features are often modelled trees with non-manifold surfaces, and their shadows would otherwise look like those in your screenshots). Also, 3DO models of old tended to have gaps in them that became exposed with culling enabled.
For units the back-faces are always culled in both normal and shadow rendering (http://imageshack.us/f/546/screen00001.png), there is no "triangle direction inversion" (anymore). You only notice this in the shadow projection if a model is not a closed volume.
For units the back-faces are always culled in both normal and shadow rendering (http://imageshack.us/f/546/screen00001.png), there is no "triangle direction inversion" (anymore). You only notice this in the shadow projection if a model is not a closed volume.
Re: Shadows with reversed triangle facing
Shouldn't the shadowmap then contain exactly the same triangles as the onscreen buffer?Kloot wrote:there is no "triangle direction inversion" (anymore)
In BD's examples the sun is above the units and so the sun looks on the _front_ faces. But they obviously aren't rendered instead the back faces are -> means culling is inverted in shadowpass.
Re: Shadows with reversed triangle facing
Relevant OpenGL state (glFrontFace(GL_CCW), glCullFace(GL_BACK)) is the same in each pass, so it would have to be the shadow-matrix projection flipping an axis.
edit, after looking at it more closely: https://github.com/spring/spring/commit ... 74eef0b2be (-> http://imageshack.us/f/233/screen00000a.png)
edit, after looking at it more closely: https://github.com/spring/spring/commit ... 74eef0b2be (-> http://imageshack.us/f/233/screen00000a.png)
Re: Shadows with reversed triangle facing
Oh my god I LOVE YOU!
This was one of the major obstacles in the path of the BA remake, as many buildings had holes in them. It also enables me to keep working on bump mapped ba :D
This was one of the major obstacles in the path of the BA remake, as many buildings had holes in them. It also enables me to keep working on bump mapped ba :D
Re: Shadows with reversed triangle facing
0.83 is going to be awesome. 

Re: Shadows with reversed triangle facing
<3 klooty
Behe, roamz, nao!
Behe, roamz, nao!