FAQ  •  Register  •  Login

DarkPlaces - Model Shadows.

Moderator: Inside3D Admins

<<

Qrv

Posts: 45

Joined: Thu Oct 20, 2011 7:43 am

Location: Stuck in a Slipgate.

Post Tue Nov 15, 2011 3:05 am

DarkPlaces - Model Shadows.

Hello,

Here I have a few tree models, q3 format. As you can see, they load in-game fine, however, two main problems.

Image

Image

First thing to notice, the leaves are pretty fullbright. Here's the shader currently being played with for the leaves:

  Code:
models/mapobjects/oak/oakblaetter
{
   //cull none
   cull disable
   nopicmip
   dpshadow
   {
      map models/mapobjects/oak/oakblaetter.tga
      alphaFunc GE128
      //depthWrite
      //rgbGen vertex
      rgbGen lightDiffuse
   }
}


The comment out parts are from the original shader, as I've adjusted it some to how I understand the shader should be, for non-full bright leaves.

Also notice, that "dpshadow" is enabled in the shader, which leads me to my next issue.

In the second screenshot, you'l see a lack of shadows for leaves.
Although the second screenshot doesnt show it, with dpshadow enabled inside the shader, the leaves polygon casts shadows, ie, you get a square shaped shadow, not leaf shapes.

Can DarkPlaces not cast RT Shadows using the alpha layer of textures as a mask? And also, is there anyway to sort out the lighting for the leaves, so their not practically fullbright?




( DarkPlaces needs more, correct and up-to-date documentation. -.- )
I'm looking for a Mapper, Modeller/Animator and a Sound effect/Music person, to work on an exciting project. PM Me here, or catch me on IRC for further info.
<<

Nahuel

User avatar

Posts: 370

Joined: Wed Jan 12, 2011 8:42 pm

Location: mar del plata

Post Tue Nov 15, 2011 11:06 am

Re: DarkPlaces - Model Shadows.

I do not understand many about shaders and darkplaces suppport. But for a texture with channel alpha this shader will work correctly (no fullbright) . Maybe this shader has innecesary lines :oops:, I do not know how works the "dpshadow".
  Code:
models/mapobjects/oak/oakblaetter
{   

   {
   map models/mapobjects/oak/oakblaetter
      blendFunc GL_ONE GL_ZERO
      alphaFunc GE128
      depthWrite
      rgbGen identity
   }

   {
         map $lightmap
         rgbGen identity
         blendFunc GL_DST_COLOR GL_ZERO
         depthFunc equal
   }

}


I do not know if darkplaces can cast shadows with a poligon with a texture with chanel alpha, or some transparency. I didn´t get it at the time :)
hi, I am nahuel, I love quake and qc.
<<

Qrv

Posts: 45

Joined: Thu Oct 20, 2011 7:43 am

Location: Stuck in a Slipgate.

Post Tue Nov 15, 2011 12:01 pm

Re: DarkPlaces - Model Shadows.

Hmm, thanks for that Nahuel, it's still not quite right. I'm starting to wonder if its just DarkPlaces and not the shader, prehaps my expectations for DP engine is a bit beyond what it can actually do, I dunno.

Image

Shader used:

  Code:
models/mapobjects/oak/oakblaetter
{
   cull none
   //cull disable
   //nopicmip
   //dpmeshcollisions
   //dpshadow
   {
      map models/mapobjects/oak/oakblaetter.tga
      blendFunc GL_ONE GL_ZERO
      alphaFunc GE128
      depthWrite
      //rgbGen vertex
      //rgbGen lightDiffuse
      rgbGen identity
   }
   
   {
      map $lightmap
      rgbGen identity
      blendfunc GL_DST_COLOR GL_ZERO
      depthFunc equal
   }
}



As for "dpshadow" in shaders, Nahuel, it's supposed to allow 'stuff' to cast shadows. One usage for it, is to allow invisible brushes to cast shadows.
Taken from the DP Wiki:

  Code:
textures/common/shadowmesh
{
 dpshadow
}


Such a shader should be invisible in-game, but cast shadows. I suppose it's there for strange circumstances, like to recreate the "Q" logo on the ground, in one of iD's maps, but the sky doesnt show the Q in brushes. I'm sure it can be pretty usefull with some imaginative usage. Theres also "dpnoshadow" you can stick in your shaders, to do the opposite. Cast no shadows.
I'm looking for a Mapper, Modeller/Animator and a Sound effect/Music person, to work on an exciting project. PM Me here, or catch me on IRC for further info.
<<

Sami

Posts: 5

Joined: Sat May 13, 2006 4:09 pm

Post Tue Dec 27, 2011 7:23 pm

Re: DarkPlaces - Model Shadows.

Take a look at the alphashadow shader keyword - it should do what you want (i.e. use the alpha channel when working out shadows rather than the opaque polygons).
<<

Qrv

Posts: 45

Joined: Thu Oct 20, 2011 7:43 am

Location: Stuck in a Slipgate.

Post Thu Dec 29, 2011 6:26 pm

Re: DarkPlaces - Model Shadows.

I thought alphashadow only applied when using the standard q3bsp lightmapping?
If i recall correct, thats exactly what it's for.

Unless your telling me DP has something like dpalphashadow? I've never heard of such a thing, but alot of DP's stuff seems undocumented so, it might exist.

But the lighting im using here is the Real Time lighting within DarkPlaces, to get these shadows.
I'm looking for a Mapper, Modeller/Animator and a Sound effect/Music person, to work on an exciting project. PM Me here, or catch me on IRC for further info.

Return to Modeling

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.
Icons provided by Aha Soft