How do I undo these tex env values?

BlitzMax Forums/OpenGL Module/How do I undo these tex env values?

JoshK(Posted 2005) [#1]
I use these values when doing texture splatting, but I don't know how to switch them back to their default setting when I am done:
glTexEnvf GL_TEXTURE_ENV,GL_SOURCE0_RGB,GL_PRIMARY_COLOR
glTexEnvf GL_TEXTURE_ENV,GL_OPERAND0_RGB,GL_SRC_COLOR
glTexEnvf GL_TEXTURE_ENV,GL_SOURCE1_RGB,GL_TEXTURE1
glTexEnvf GL_TEXTURE_ENV,GL_OPERAND1_RGB,GL_SRC_COLOR
glTexEnvi GL_TEXTURE_ENV,GL_SOURCE0_ALPHA,GL_TEXTURE0
glTexEnvi GL_TEXTURE_ENV,GL_OPERAND0_ALPHA,GL_SRC_ALPHA
glTexEnvi GL_TEXTURE_ENV,GL_SOURCE1_ALPHA,GL_TEXTURE0
glTexEnvi GL_TEXTURE_ENV,GL_OPERAND1_ALPHA,GL_SRC_ALPHA



ozak(Posted 2005) [#2]
Actually you have to set the defaults yourself. I've experienced a few cards where the defaults where different than on other cards (way back though but still)

Always set the defaults yourself :)


JoshK(Posted 2005) [#3]
So in other words, you don't know.


Warren(Posted 2005) [#4]
And you can't read. He spelled it out for you.


Tom(Posted 2005) [#5]
I believe these to be the defaults:

	Function Create:tUnit(unit:Int)
		Local t:tUnit = New tUnit
		
		t.constColor[0] = 1.0
		t.constColor[1] = 1.0
		t.constColor[2] = 1.0
		t.constColor[3] = 1.0
		
		t.combineRGB	= GL_MODULATE
		t.combineAlpha	= GL_MODULATE
		
		t.source0RGB 	= GL_TEXTURE0_ARB + unit
		t.source1RGB	= GL_PREVIOUS_ARB
		t.source2RGB	= GL_CONSTANT_ARB

		t.source0Alpha	= GL_TEXTURE0_ARB + unit
		t.source1Alpha	= GL_PREVIOUS_ARB
		t.source2Alpha	= GL_CONSTANT_ARB		

		t.operand0RGB	= GL_SRC_COLOR
		t.operand1RGB	= GL_SRC_COLOR
		t.operand2RGB	= GL_SRC_ALPHA

		t.operand0Alpha	= GL_SRC_ALPHA
		t.operand1Alpha	= GL_SRC_ALPHA
		t.operand2Alpha	= GL_SRC_ALPHA

		t.rgbScale	= 1.0
		t.alphaScale	= 1.0
		
		Return t
	End Function



My old write up
http://www.tomspeed.com/extended_texture_blending.txt