Inside3D!
     

Attachments with shadows? (DarkPlaces)

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
jim



Joined: 05 Aug 2005
Posts: 400
Location: In The Sun

PostPosted: Sat Jan 05, 2008 6:30 pm    Post subject: Attachments with shadows? (DarkPlaces) Reply with quote

I'm wondering if there's any way to get shadows for attachments. If I attach a model with setattachment, it doesn't cast any shadows: like this

This same error happens with r_shadows 1 and no real time shadows. The screenshot is with real time shadows.
_________________
zbang!
Back to top
View user's profile Send private message Visit poster's website
LordHavoc



Joined: 05 Nov 2004
Posts: 243
Location: western Oregon, USA

PostPosted: Sat Jan 05, 2008 9:30 pm    Post subject: Re: Attachments with shadows? (DarkPlaces) Reply with quote

jim wrote:
I'm wondering if there's any way to get shadows for attachments. If I attach a model with setattachment, it doesn't cast any shadows: like this

This same error happens with r_shadows 1 and no real time shadows. The screenshot is with real time shadows.


This usually means you have some transparent pixels in the model skin and thus it never casts shadows, but this one does not appear to be rendered by the (quite poor) transparency renderer, so that can't be it.

The shadowing system really has no idea what an attachment is, it shouldn't care at all.

I'll need to test this myself to debug it.

Could you supply the mod for testing purposes? (doesn't matter if it's terribly incomplete or whatever, just that I can easily get a test case running)
Back to top
View user's profile Send private message Visit poster's website
jim



Joined: 05 Aug 2005
Posts: 400
Location: In The Sun

PostPosted: Sun Jan 06, 2008 12:15 am    Post subject: Reply with quote

I just noticed they don't make shadows, because the attachments are doublesided. If I take away this line, shadows will be shown:
Code:

self.weaponent.effects = self.weaponent.effects | EF_DOUBLESIDED;


It also made the character not cast shadows, if I added the effect for it.

I used the doublesided effect, because the weapons actually have some transparent effect models part of them, like here: http://koti.mbnet.fi/jeejeeje/wip/gang_02.jpg

I was a bit lazy on the export stuff, so I just had the effects in the same dpm file and then I just have two .skin files with one setting the effect texture to "common/nodraw". I think I'll just export things again and now have the effects separate from the weapon...
_________________
zbang!
Back to top
View user's profile Send private message Visit poster's website
LordHavoc



Joined: 05 Nov 2004
Posts: 243
Location: western Oregon, USA

PostPosted: Mon Jan 07, 2008 6:39 pm    Post subject: Reply with quote

jim wrote:
I just noticed they don't make shadows, because the attachments are doublesided.


Ahh yes, I still need to make doublesided objects cast shadows, I keep forgetting about this (partly because doublesided opaque objects are a rarity).

jim wrote:
I was a bit lazy on the export stuff, so I just had the effects in the same dpm file and then I just have two .skin files with one setting the effect texture to "common/nodraw". I think I'll just export things again and now have the effects separate from the weapon...


Nah, just make a q3 shader for the second material:
Code:

progs/club/rings
{
        cull disable
        {
                map progs/club/rings.tga
                rgbGen identity
        }
}


That ought to work (tweak the paths as appropriate - the first line is the name of the texture this shader overrides, and the map command is the texture to use instead - you can use animmap to make it animate between several images at a specified framerate).

The rgbGen identity should make it fullbright, and the cull disable makes it double sided (like EF_DOUBLESIDED, but just for this one material), you can throw in other things like "blendfunc add" for EF_ADDITIVE style rendering or "blendfunc blend" for an alpha blend in the inner parentheses.

There are a lot of other things that can be done with q3 shaders of course, like tcmod scroll 1 0 would make it scroll the texture in one direction.
Back to top
View user's profile Send private message Visit poster's website
jim



Joined: 05 Aug 2005
Posts: 400
Location: In The Sun

PostPosted: Wed Jan 09, 2008 12:25 am    Post subject: Reply with quote

Aah, these Q3 shaders sound interesting. I'll have to find more about these... Do they also work for level textures? Do they also work for levels that are in Q1 format? I've thought of using that, because Q3 level format don't like flickering lights...

I'll look more into the shaders tomorrow...
_________________
zbang!
Back to top
View user's profile Send private message Visit poster's website
LordHavoc



Joined: 05 Nov 2004
Posts: 243
Location: western Oregon, USA

PostPosted: Wed Jan 09, 2008 12:44 am    Post subject: Reply with quote

jim wrote:
Aah, these Q3 shaders sound interesting. I'll have to find more about these... Do they also work for level textures? Do they also work for levels that are in Q1 format? I've thought of using that, because Q3 level format don't like flickering lights...

I'll look more into the shaders tomorrow...


Yep, supported on everything except sprites in DP - sprites have been a low priority, they have a special renderer and no one seems to have a need for shaders on them - partly because q3 shaders have "deformvertexes autosprite" and "deformvertexes autosprite2" which make 4-point polygons in models/levels behave like billboard/directional-billboard sprites.

As for flickering in Q3BSP - yes, that's a format limitation, I haven't implemented RavenBSP support which is Q3BSP with lightstyles added (it's difficult to support with all the DP features).

You can still place rtlights in the ingame light editor and mark them as visible in normal lightmapped mode though.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group