Assign Custom Textures To Dynamic Lights

Moderator: GZDoom Developers

User avatar
Steve5563
Posts: 80
Joined: Sun Jan 27, 2019 11:18 pm
Location: Australia

Assign Custom Textures To Dynamic Lights

Post by Steve5563 »

Hi,
Just curious if it would be possible to have a feature that can allow users to assign a custom texture for a newly created dynamic light that you can define in the GLDEFS lump. https://zdoom.org/wiki/GLDEFS
if a custom texture is to be used with the newly created dynamic light, the user will need to define what texture is to be used for this particular light and the location of the texture, something similar to the material setup.
if no custom texture is to be defined then possibly just make the engine revert back to the gzdoom default textures that are located in the GLstuff folder.

the reason for the request is i have been working on liquid shaders (Liquid texture pack V6.7) and this idea could be useful for adding a custom texture to a dedicated dynamic light that you can place in a map.
which i would then also like to take it one step further and assign a custom shader to the newly defined dynamic light texture, which would be used to create the final water caustic animation that the new light will then project in the area.
Rather then using ANIMDEFS for the animation shaders are great for minimum gpu vram usage, but ANIMDEFS can still be useful in certain situations.
I am sure with a bit of creativity, users could find other uses for a feature like this from simple realistic looking flash lights (that use the gzdoom cone / dynamic spot lights) or for creative map decoration.
such as custom shadow projection effects through wire fences / movie theater projector etc.

this is just something i have just thought of today and im not sure if this feature has been requested before in the past. and if it's a viable feature for the engine.
here is an example on what i am thinking, just on a more bare bones level for gzdoom.


Example where just static textures can be used.

Code: Select all

pointlight WaterCaustic
{
    color 0.5 0.5 0.8
    size 256
    offset 0 0 0
    Use_texture  "Textures / Lights / WATERLT.png " // this tells gzdoom to overly like a hires texture  or just override the original texture, for this newly defined texture. 
}

if you was to add a shader to the point light water caustic texture to create an animation effect. possibly something like this.

Code: Select all

material texture WATERLT 
{ 
    shader "shaders/Watercausticr.fp"
    texture Diffuse "textures/Lights/Watercaustic.png"
    texture lightmask "textures/Lights/lightmask.png" // possibly used to lower brightness of the water caustic texture near the edges 
}
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48602
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Assign Custom Textures To Dynamic Lights

Post by Graf Zahl »

Dynamic lights do not use textures. They did a long time ago when there were no shaders, but that code no longer exists because it was far too limiting.
User avatar
Steve5563
Posts: 80
Joined: Sun Jan 27, 2019 11:18 pm
Location: Australia

Re: Assign Custom Textures To Dynamic Lights

Post by Steve5563 »

Dynamic lights do not use textures. They did a long time ago when there were no shaders, but that code no longer exists because it was far too limiting.
Roger that, i remember altering the dynamic lights by adjusting the default textures (years ago) that's why i made the request as i did.

so you still dont think it's possible on allowing the dynamic lights to have the option to use a grey scale texture as information to alter the dynamic light shader pattern similar to what was shown in the video?

Also on a side note, if the dynamic light feature is not possible, do you think something as i have described above could be possible as a more simpler alternative option where this could be done for the gzdoom glow effect,
allow the user to have the option to use a mask (grey scale) texture to alter the brightness of the glow's RGB values in gldefs.
the mask (grey scale) texture would need to tile along the walls (maybe have a scale / tile value to adjust texture size along the walls) and the height value can be based on the height of the glow value so the mask texture would just stretch it's height based on that value
just a thought, i have no idea how this would need to be correctly setup in the engine.
cheers.

Return to “Closed Feature Suggestions [GZDoom]”