Jump to content

Recommended Posts

Posted

Is there any way to make light sources more natural, in the manner that they cast a sphere of light?

 

In some situations, a cube-shaped light seems strange.

Posted

Note that the standard light entity is not a cube - it is displayed that way in the editor but its light is cast like a chunky 6-pointed star with pyramids pointing outwards to the centres of the sides of the cube. This is a compromise for performance and roughly simulates how a sphere of light is cast. Try creating a light in the middle of a room and somewhat bigger than the room. It's light is brightest in the centre of the walls, floor and ceiling and darkest in the corners - just like a sphere would be. And its faster than calculating a sphere of light.

Posted

The light volume of a point light IS a cube. It projects a texture in all 6 directions and the intensity changes with the distance from the origin (falloff). It's spherical because of this falloff (the texture also affects this) but the affected geometry is determined by the cubic volume.

Please correct me I'm mistaken somewhere. :)

Posted

I can't confirm at this time. That's what I recall from about 2 years ago when I was just a lad so it might well be wrong. :blush: I can't find the old post I got it from.

Posted

I found the old post in one of the internal forums. I was asking the same sort of question as you. I'm not sure I got it exactly right:

 

The default light is not a sphere, but a fading square (like a pyramid viewed from above).

 

The image posted is like a pyramid on top of an inverted pyramid. I think also it ought to be rotated 45 degrees. So it's like a diamond with 6 points rather than a star with its points in the centre of each side of the cube volume. I think this is probably right. Someone will confirm or correct no doubt.

 

[EDIT] Otherwise, why do we want a spherical light if the falloff is already perfectly spherical?

Posted

You're both kind of right actually -- the light volume as considered by the game is a cube, but the default falloff textures are linear in each dimension which means that the illuminated area will be a sort of eight-sided diamond shape (like two pyramids on top of each other, one pointing up and the other down).

 

Of course this depends on the texture you choose; with biground1 the shape is more like two cones on top of each other (possibly two rounded cones, or even an actual sphere; I haven't checked the Z falloff texture it uses).

Posted

I don't really know how the falloff works. I thought it was just determined by the distance and a 1D look up texture. But it seems to be more complicated.

Posted

In the XY plane, yes, it's just a lookup in the light texture, though it's a 2D lookup.

 

However, to calculate the intensity in the entire volume another value is read from a separate z falloff image (presumably it just gets multiplied) - that's what you specify by lightFalloffImage in the material.

Posted

Yes exactly, the XY planar texture is multiplied by the value from the Z falloff texture to produce the final value. If the XY texture is a gradient (as most are), the Z falloff will cause it to "shrink" to a point as you go further from the center, with the gradient in the Z falloff determining the rate of shrinkage.

Posted

I also read somewhere that the Z falloff image defaults to makeIntensity(lights/squarelight1a), so you get a smooth falloff in the vertical direction by default.

Posted
the Z falloff image defaults to makeIntensity(lights/squarelight1a)
It's in the "lights/defaultPointLight" material in "lights.mtr".

 

So the 2D falloff texture is the projected texture and lightFalloffImage is the 1D falloff?

Posted

Can't be sure - there's lots of stuff I don't know about the D3 engine, so maybe it has actually some use. Z-Falloff images are 2D textures too, so maybe they got some cool effect out of it by using a special pattern there?

Posted

I guess they figured it was easier for an artist to use a 2D texture, rather than having to create a 1D texture. Also this approach means that you can use the same texture for both XY and Z falloffs, for example you could use the lights/biground1 image as a Z falloff if you didn't want it to be linear.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • JackFarmer

      "The Year of the Rat." 
      😄

      Al Stewart must be proud of you!
      Happy testing!
      @MirceaKitsune
      · 1 reply
    • datiswous

      I posted about it before, but I think the default tdm logo video looks outdated. For a (i.m.o.) better looking version, you can download the pk4 attached to this post and plonk it in your tdm root folder. Every mission that starts with the tdm logo then starts with the better looking one. Try for example mission COS1 Pearls and Swine.
      tdm_logo_video.pk4
      · 2 replies
    • JackFarmer

      Kill the bots! (see the "Who is online" bar)
      · 3 replies
    • STiFU

      I finished DOOM - The Dark Ages the other day. It is a decent shooter, but not as great as its predecessors, especially because of the soundtrack.
      · 5 replies
    • JackFarmer

      What do you know about a 40 degree day?
      @demagogue
      · 4 replies
×
×
  • Create New...