Full Bright outside, lighting inside.


([Cerberus]) #1

Hello, Fellow mappers

I have a problem with when I compile its full bright outside but has lighting inside, I think is has to do with my shader for the texture i’m using outside, this is my first shader file, and therefore I have have little knowledge if its correct.

P.s. I am using the Radar sky.

Shader file:

textures/jivanta/master_grass_dirt3_mineable
{
surfaceparm landmine
{
map textures/jivanta/master_grass_dirt3_mineable.tga
}
}

Screenshot Inside:

Screenshot Outside:


(Q.) #2

Perfect! :blah:


([Cerberus]) #3

Code Correction

textures/jivanta/master_grass_dirt3_mineable
{
	surfaceparm landmine
	{
		map $lightmap
		rgbGen identity
	}
	{
		map textures/jivanta/master_grass_dirt3_mineable.tga
		blendFunc filter
		rgbGen identity
	}
}

(Shaderman) #4

The ground shader shouldn’t be the reason for this bright lighting outside. Are you sure you’re using the Radar and not the Oasis sky? Try another sky and compare the results. Are there any other light sources outside? Are you using a “clean ET mapping installation” or some self-made config?


(nUllSkillZ) #5

May be some worldspawn entries like “ambient” or “minlight”.


(CooperHawkes) #6

…which would also affect the indoor scenes. Therefore, this cannot be the reason IMO.


([Cerberus]) #7

Yes, i am using the radar sky, No there are not any outside lighting sources, And i just resintailed et and radiant the other day.

Okay, It definatly the shader, but I think I know what happened, The first shader, I think its transparent like Clip, and thus light shines right through it.


(Lanz) #8

Sure it would, look at the other shaders in that picture that has a lightmap stage and you see that they are a lot more darker.


(carnage) #9

ah was half way though a post and i think i worked it out

{
map textures/jivanta/master_grass_dirt3_mineable.tga
blendFunc filter
rgbGen identity
}

rgbGen identity means that all colours used in the filter stage are asumed to be white
blend funcs work as

[Source * <srcBlend>] + [Destination * <dstBlend>]

blendfunc filter
blendfunc gl_dst_color gl_zero

so for this filter you get

(source * gl_dst_COLOR) + (destination * 0)
or simplified
source * gl_dst_COLOUR

source if the image your applying (your texture) and the gl_dst_colour is the colour of the pixe that is already on the frame buffer
but since you have used rgbGen identiy gl_dst_colour will alywas be white

so in the other words you bleinging you terrain image with a pure white background. and since you have done this affter the lightmap stage it overwrites anything on the buffer that was put there by your lightmap stage

textures/jivanta/master_grass_dirt3_mineable
{
   surfaceparm landmine
   {
      map textures/jivanta/master_grass_dirt3_mineable.tga
      blendFunc filter
      rgbGen identity
   }
   {
      map $lightmap
      rgbGen identity
   }
}

try it in that order and might have better results. if not try remove the rgbGen identity from the dirt3 stage


([Cerberus]) #10

Well that Shader sure does give it an interesting feel.


(carnage) #11

well ok i might not have it 100% but im working on it

also you are missing a large part of your shader about phong shading and your terrain wont look right without it so id get searching. ill have a think about this terrain


(CooperHawkes) #12

you might download fate, create a dummy terrain and export it… then you can have a look at the generated shader script (search for terrain1_z, i think this will fit your needs).


([Cerberus]) #13

Can some one explain why the lighting looks so boxy?

This is the shader file i’m using. Thanks again guys.

textures/jivanta/master_grass_dirt3_mineable
{
   surfaceparm landmine
   {
      map $lightmap
      rgbGen identity
   }
   {
      map textures/jivanta/master_grass_dirt3_mineable.tga
      blendFunc filter
      rgbGen identity
   }
}

(Lanz) #14

It’s because you haven’t added phong shading to the shader. Add these for some smoother more consistent shadows:


	q3map_lightmapmergable
	q3map_nonplanar 
	q3map_shadeangle 120


(S14Y3R) #15

wtf is that last screeny? that’s not the shader messing it up, check your worldspawn and/or terrain func_group for keys that shouldn’t be there or are set wrong. It kinda looks like your _gridsize(lightgrid) is set to astronomical proportions, and bleeding all over the place?? :eek2:


([Cerberus]) #16

That is the shader. I made a shader that took out half of the textures in the main menu(only orange and black), if you want it pm me.

I’m still having trouble with my Shader I know i did something wrong, I hate to bug you guys some more but here it is.

textures/jivanta/master_grass_dirt3_mineable
{
	q3map_lightmapmergable
	q3map_nonplanar
	q3map_shadeangle 120 
	
        surfaceparm landmine
	{
		map $lightmap
		rgbGen identity
		q3map_lightmapmergable
		q3map_nonplanar
		q3map_shadeangle 120 
	}
	{
		map textures/jivanta/master_grass_dirt3_mineable.tga
		blendFunc filter
		rgbGen identity
	}
}

(CooperHawkes) #17

you didn’t even bother trying my suggestion, did you? anyway, i’ll give it a second try:


textures/jivanta/master_grass_dirt3_mineable
{
	qer_editorimage textures/jivanta/master_grass_dirt3_mineable.tga
	q3map_lightImage textures/jivanta/master_grass_dirt3_mineable.tga
	q3map_nonplanar
	q3map_shadeAngle 60
	q3map_tcGen ivector ( 512 0 0 ) ( 0 -512 0 )
	q3map_lightmapAxis z
	q3map_lightmapmergable
	surfaceparm grasssteps
	surfaceparm landmine
	{
		map textures/jivanta/master_grass_dirt3_mineable.tga
		rgbGen identity
	}
	{
		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		rgbGen identity
	}
}