Jump to content


Photo

How to create a light projection texture: HowTo Video


18 replies to this topic

#1 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20281 posts

Posted 10 August 2018 - 06:28 AM

*
POPULAR

So got a PM from JoeBarnin in relation to his current beta for some help looking for a window protection texture, so rather than just do the work I thought I would make a little howto vid -

 


  • joebarnin, Dragofer, RPGista and 2 others like this

#2 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 12726 posts

Posted 10 August 2018 - 06:53 AM

Well done, Biker, thx!!!!

#3 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 10 August 2018 - 07:26 AM

You don't have to struggle like that, at least in Gimp there are two options for simplifying colors: Threshold and Posterize. You can use either of them to have black and white image, and then you can blur it a bit, for projection. And it will take you like 2 minutes instead of 12.



#4 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20281 posts

Posted 10 August 2018 - 07:36 AM

This was just a example rather than a definitive, and had I not been taking the time to explain, it would have been 2 mins rather than 12.



#5 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 10 August 2018 - 08:34 AM

Hah, I wasn't literal, if that's the case that would be like 20 seconds ;) Anyway, this is a time-consuming and inflexible method, imagine painting over something like this:

 

639px-Rose_du_transept_Sud_Notre-Dame_de


Edited by Judith, 10 August 2018 - 08:41 AM.


#6 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37446 posts

Posted 10 August 2018 - 08:35 AM

You probably don't even need to use threshold or polarize; you can just increase the contrast to make the darks black and the brights white.  It also has the benefit of maintaining imperfections in the shape of the wood that you lose when you manually paint over everything. That and adding a blur, as Judith said, will look good and be easier for the average user. 


  • Judith and Boiler's_hiss like this
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#7 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 10 August 2018 - 08:44 AM

True, in this case it would be faster simply to adjust the input levels to increase the contrast. You played with that for a while, but then switched to the output levels, and then gave up because you didn't get the desired effect.



#8 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 747 posts

Posted 10 August 2018 - 10:57 AM

Thanks for the video Bikerdude making light textures is something that i don't think anyone made a video before but i could be wrong.

 

IMO there's no reason to always use high resolution projection textures, if you use a 256x256 projection texture it will give the projection a softer look almost simulating penumbra (blurry) shadows if you use a high resolution one the projection will be stronger and sharper but that could be the effect you want.

About jpgs, I don't know about TDM engine but i add fhDoom crash on me more than one time because i add a .jpg texture as a ingame texture, why i don't know. Also jpg is a lossy format, it removes quality from the original tga ( if the original texture is a good quality to start with) so if you want to retain high quality, tga is the best format, jpg also creates blocky artifacts that can specially be bad for normal maps. If you make a jpg from .dds like you did, you are removing even more quality .DDS (Direct Draw Surface) textures, specially dxt1 compression is a highly compressed and lossy format. But personally i don't recommend jpgs for game textures for a very important reason, jpg doesn't support mipmapping (texture LOD) so is not optimized for GPU rendering and games.    


Edited by HMart, 10 August 2018 - 10:58 AM.

  • Bikerdude and Boiler's_hiss like this

#9 RPGista

RPGista

    Advanced Member

  • Member
  • PipPipPip
  • 1595 posts

Posted 10 August 2018 - 11:06 AM

Apart from the gimp techniques, the crucial part for me was the how-to explaining the process of making it work in game and in DR, thats always the hardest part for beginners, thanks for that.



#10 Boiler's_hiss

Boiler's_hiss

    Member

  • Member
  • PipPip
  • 32 posts

Posted 10 August 2018 - 11:22 AM

You probably don't even need to use threshold or polarize; you can just increase the contrast to make the darks black and the brights white.  It also has the benefit of maintaining imperfections in the shape of the wood that you lose when you manually paint over everything. That and adding a blur, as Judith said, will look good and be easier for the average user. 

I might also add, that in this case, applying Otsu's binormal threshold on image would make a good premise for mask to cull non projected parts of image.
But generally, the best action would be preservation of source image file (.psd/.xcf/whatever) alongside with all layers because diffuse texture could have all possible window frame colors.
 


Edited by Boiler's_hiss, 10 August 2018 - 11:28 AM.

  • Judith likes this

#11 joebarnin

joebarnin

    Member

  • Member
  • PipPip
  • 260 posts

Posted 10 August 2018 - 11:45 AM

So got a PM from JoeBarnin in relation to his current beta for some help looking for a window protection texture, so rather than just do the work I thought I would make a little howto vid -

 

 

Thank you! This makes perfect sense.

 

Just thought I'd mention, there's one issue with the video. Around 8:47, you start doing work with the .mtr file - this all happens off screen (maybe a dual monitor issue?). I can't see exactly what you did, but I can figure it out based on the .mtr file you sent (and your audio commentary). Looks like you searched lights.mtr for an existing window light texture, eg:

 

lights/mansion01_window01
{
description "projection for mansion01 window01"
{
forceHighQuality
map lights/mansion01_window02
colored
zeroClamp
}
}
 
Copied this, and then modified it to match the new .tga file name:
 
lights/diamond_pattern01
{
description "projection for diamond_pattern01"
{
forceHighQuality
map lights/diamond_pattern01
colored
zeroClamp
}
}
 
Save this in a separate file in the materials folder.
 
Thanks again.

  • Bikerdude likes this

#12 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20281 posts

Posted 10 August 2018 - 12:16 PM

You probably don't even need to use threshold or polarize; you can just increase the contrast to make the darks black and the brights white.

That was my first thought, and it does apply to alot of the windows textures. But the issue there was the parts if the glass texture got too dark too, as show in the video. I have fond that just grabbing the windows texture you want, removing the saturation to grayscale the image and then painting over the frame gave me the benefits of the textured glass and defined frame.



#13 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 10 August 2018 - 01:14 PM

About jpgs, I don't know about TDM engine but i add fhDoom crash on me more than one time because i add a .jpg texture as a ingame texture, why i don't know. Also jpg is a lossy format, it removes quality from the original tga ( if the original texture is a good quality to start with) so if you want to retain high quality, tga is the best format, jpg also creates blocky artifacts that can specially be bad for normal maps. If you make a jpg from .dds like you did, you are removing even more quality .DDS (Direct Draw Surface) textures, specially dxt1 compression is a highly compressed and lossy format. But personally i don't recommend jpgs for game textures for a very important reason, jpg doesn't support mipmapping (texture LOD) so is not optimized for GPU rendering and games.    

 

Yup, definitely jpegs shouldn't be used as they cause a lot of problems due to their compression format. You should use either uncompressed .tga or .dds with proper compression mode. And you should always keep original files in your app native format, like .xcf for Gimp, so you can return to it later. If you save your file as .dds and then make changes to it, and save it as .dds again, you'll be stacking compression and lose detail with every such change.

 

Also using levels to get the texture output to pure white or something close to it is better, because then you can control it with light intensity in DarkRadiant. If you leave your white level at e.g. 128 and setting the light to RGB 256 will still be too dark, you'll have to make changes in the image again. At least maintaining some workflow consistency here will help you with more predictable lighting settings.



#14 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20281 posts

Posted 10 August 2018 - 02:57 PM

So the only place we can use .JPG files is for the _ed files then by the sounds of it.



#15 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 10 August 2018 - 05:44 PM

There is no point in using separate jpegs for editor preview, it'a waste of time since Dark Radiant needs only a few seconds to load diffuse textures used for the same purpose. Even with 2048 textures it just takes a moment, and the editor handles them well during mapping, no slowdown or anything like that.

#16 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37446 posts

Posted 10 August 2018 - 10:15 PM

One place it's useful is when the diffuse has color stages that change the way the texture looks in-game.


TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#17 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20281 posts

Posted 11 August 2018 - 02:58 AM

There is no point in using separate jpegs for editor preview, it'a waste of time since Dark Radiant needs only a few seconds to load diffuse textures

But when you have a lot of textures those seconds all add up, to slower opening times when mappers are working on thier maps. I would be curious to see a .JPG versus .TGA use-case comparison though in relation to _ed files..



#18 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 1724 posts

Posted 11 August 2018 - 06:57 AM

They really don't, speaking from experience, 2k textures for everything. And they're not slowing down the editor as it uses quite aggressive mipmapping. +2 seconds to loading time is nothing in comparison to time and space wasted for separate preview textures.

Edited by Judith, 11 August 2018 - 07:04 AM.

  • Bikerdude likes this

#19 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 20281 posts

Posted 11 August 2018 - 07:30 AM

Fair enough.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users