external lightmaps problems

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
Rav3n
Posts: 51
Joined: Sat Mar 12, 2011 7:50 pm

external lightmaps problems

Post by Rav3n »

I'm trying to figure out external lightmaps.
So I'm following these instructions but i can't get it to work.
http://www.smokin-guns.net/viewtopic.php?t=1444
The shader makes the texture i apply it to appear as missing texture.
But that's not the only problem, when the higher resolution lightmap is generated it basically looks like a 1024x1024 black square with the original 128x128 placed in the corner.
Anyone got an idea what I"m doing wrong.
Rav3n
Posts: 51
Joined: Sat Mar 12, 2011 7:50 pm

Re: external lightmaps problems

Post by Rav3n »

i know now why do i get missing image problem, in the shader i shouldn't use .jpeg or .tga extensions or r_findimage can't find it.
Now i got a new problem, the lightmap is high res as i want it to be, shader applies it and all, but there's a huge offset.
Rav3n
Posts: 51
Joined: Sat Mar 12, 2011 7:50 pm

Re: external lightmaps problems

Post by Rav3n »

looks like _samplesize 1 has to be in BSP stage in order to get the lightmap of proper resolution.
however the blendfunc isn't blending the ightmap.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: external lightmaps problems

Post by obsidian »

Lightmaps don't have an alpha channel so blendFunc blend doesn't work with it. Lightmaps usually use blendFunc filter.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Rav3n
Posts: 51
Joined: Sat Mar 12, 2011 7:50 pm

Re: external lightmaps problems

Post by Rav3n »

obsidian wrote:Lightmaps don't have an alpha channel so blendFunc blend doesn't work with it. Lightmaps usually use blendFunc filter.
I know i am using blendfunc filter, poor choice of words i guess. I should have said they're not being filtered.
It looks like external lightmap is replacing the texture.
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: external lightmaps problems

Post by obsidian »

Post your shader as well as the one generated by Q3Map2.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Rav3n
Posts: 51
Joined: Sat Mar 12, 2011 7:50 pm

Re: external lightmaps problems

Post by Rav3n »

Code: Select all

textures/ut4_siberia/stone_wall
	{
        q3map_lightmapSize 1024 1024
        q3map_lightmapbrightness 2.0
        {
        tcgen lightmap
        map $lightmap
        rgbGen identity
        }
        {

        map textures/ut4_siberia/stone_wall
        blendfunc filter
	}
        } 

Code: Select all

// Custom shader file for high_res_test.bsp
// Generated by Q3Map2 (ydnar)
// Do not edit! This file is overwritten on recompiles.

high_res_test/7BBBA5E1C3B16F7FA2B3862B469EF80F
{
	q3map_lightmapSize 1024 1024
	q3map_lightmapbrightness 2.0
	{
		tcgen lightmap
		map maps/high_res_test/lm_0000.tga
		rgbGen identity
	}
	{
		map textures/ut4_siberia/stone_wall
		blendfunc filter
	}
}
This is how it looks like in game. Image
As you can see the lightmap has a big offset and it seems to be mirrored as well. Blendfunc filter isn't kicking in either.
I'm using 27's FS_q3map2_radbump_4a http://www.urbanterror.info/forums/topi ... -required/ to compile this but since I'm using shader instead of switches i think it shouldn't be affecting the outcome.
Post Reply