Urban Terror Forums: Normalmap on shaders - Urban Terror Forums

Jump to content

 Login | Register 
Advertisement
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Normalmap on shaders Rate Topic: -----

#1 User is offline   ValkoVer Icon

  •   mapper   
  • Account: valkover
  • Country:
  • Joined: 28-February 10
  • Posts: 645

Posted 26 October 2011 - 07:35 PM

I use this shader on my map:

textures/hitechjumps/ecel_bounce_c02mtl
{
	q3map_lightimage textures/hitechjumps/ecel_bounce.blend.tga
	surfaceparm nodamage
	q3map_surfacelight 400
	q3map_nonplanar
	q3map_shadeAngle 179
	q3map_lightmapsampleoffset 32
        q3map_cloneShader textures/hitechjumps/jumppad_glow1
	{
		map textures/hitechjumps/ecel_bounce_c02mtl.tga
		rgbGen identity
	}
	{
		map $lightmap 
		blendfunc filter
		rgbGen identity
		tcGen lightmap 
	}
	{
		map textures/hitechjumps/ecel_bounce.blend.tga
		blendfunc add
		rgbGen wave sin 0.5 0.5 0 1.5 
	}
	{
		clampmap textures/hitechjumps/ecel_bouncesmall.tga
		blendfunc add
		rgbGen wave square 0.5 0.5 0.25 1.5 
		tcMod stretch sin 1.2 0.8 0 1.5 
	}
}


The problem is texture isn't affected by normalmap at all, i've tried this texture without shader, and normalmap worked. I've been thinking about making "effects" on texture via decal as workaround (it don't worked correctly too, but thats dfferent story)

#2 User is offline   NulL Icon

  •   former FS member   
    Level Designer
  • Account: null
  • Country:
  • Joined: 28-April 09
  • Posts: 2,606

Posted 26 October 2011 - 07:53 PM

Yeah do the additive effects as a separate shader with polygonOffset. I do a similar thing in cascade. You can even put q3map_cloneshader in the base shader to automagically create the second surface for you.

textures/null_c/pk01_panel_small02:q3map
{
	q3map_cloneshader textures/null_c/pk01_panel_small02_add
}

textures/null_c/pk01_panel_small02_add
{
	q3map_surfacelight 350
	//q3map_lightimage textures/null_c/pk01_panel_small02_add.tga
	q3map_lightRGB 1 1 1
	polygonOffset
	sort 7
	surfaceparm trans
	surfaceparm nomarks
	surfaceparm nonsolid
	{
		map textures/null_c/pk01_panel_small02_add.tga
		blendfunc add
		rgbgen wave noise 0.85 0.35 0.5 3.7
	}
}


#3 User is offline   ValkoVer Icon

  •   mapper   
  • Account: valkover
  • Country:
  • Joined: 28-February 10
  • Posts: 645

Posted 26 October 2011 - 11:48 PM

Ok, seems like its working, thanks. But now i have problem with correct blending, all blend functions i've tried looks incorrect, it looks like this (ignore normalmap differences):
Posted Image
Base texture shader:
textures/hitechjumps/ecel_bounce_c02mtl
{
        surfaceparm nodamage
        qer_editorimage textures/hitechjumps/ecel_bounce_c02mtl.tga
	q3map_nonplanar
	q3map_shadeAngle 179
	q3map_lightmapsampleoffset 32
        q3map_cloneshader textures/hitechjumps/ecel_bounce_c02mtl_sfx
	{
		map textures/hitechjumps/ecel_bounce_c02mtl.tga
		rgbgen identity
	}
	{
        	map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}

Sfx shader:
textures/hitechjumps/ecel_bounce_c02mtl_sfx
{
        surfaceparm trans
        surfaceparm nomarks
        surfaceparm nonsolid
        polygonOffset
	q3map_lightimage textures/hitechjumps/ecel_bounce.blend.tga
	q3map_surfacelight 400
	q3map_lightmapsampleoffset 32
        q3map_cloneShader textures/hitechjumps/jumppad_glow1
	{
		map $lightmap 
		blendfunc filter
		rgbGen identity
		tcGen lightmap 
	}
	{
		map textures/hitechjumps/ecel_bounce.blend.tga
		blendfunc add
		rgbGen wave sin 0.5 0.5 0 1.5 
	}
	{
		clampmap textures/hitechjumps/ecel_bouncesmall.tga
		blendfunc add
		rgbGen wave square 0.5 0.5 0.25 1.5 
		tcMod stretch sin 1.2 0.8 0 1.5 
	}
}


#4 User is offline   NulL Icon

  •   former FS member   
    Level Designer
  • Account: null
  • Country:
  • Joined: 28-April 09
  • Posts: 2,606

Posted 27 October 2011 - 07:29 AM

Why are you drawing the lightmap twice?

Also why is your sfx shader cloning in another shader? -- what is this shader?

#5 User is offline   ValkoVer Icon

  •   mapper   
  • Account: valkover
  • Country:
  • Joined: 28-February 10
  • Posts: 645

Posted 27 October 2011 - 03:20 PM

Hmm You mean i should remove first stage from sfx shader? I've also tried shader with nolightmap and w/o lightmap stage, but transperent areas were black. Shader im cloning is "fake glow" (3 layers of blurred sfx texture):

Spoiler


bullet_loaderAdvertisement

#6 User is offline   NulL Icon

  •   former FS member   
    Level Designer
  • Account: null
  • Country:
  • Joined: 28-April 09
  • Posts: 2,606

Posted 27 October 2011 - 05:54 PM

Yes remove the lightmap stage from the second shader, and just have the two additive stages.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

Sponsored link
https://www.urbanterror.info/members/donate/


Copyright © 1999-2024 Frozensand Games Limited  |  All rights reserved  |  Urban Terror™ and FrozenSand™ are trademarks of Frozensand Games Limited

Frozensand Games is a Limited company registered in England and Wales. Company Reg No: 10343942