Hopefully this isnt the case, and according to this http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dx8_c/direc... i have luck for this time i think. :) Comments?
Okay, i think i got one step further: on gamedev.net i found the suggestion to use glTexParameteri(GL_TEXTURE_2D, TEXTURE_WRAP_U/V/W, wrapParm). Besides, could this also be an 3D Texture? I think I worked it out and im going to try it out now, but theres one thing bothering me: as mentioned earlier in d3d there exists the d3dwrapcoord_3 flag which wraps textures through the 4th dimension (that should be time). However, i was unable to find _anything_ going into that direction in opengl so i stubbed it out for now. Does anybody know how to proceed with this?
BTW, is there a way to figure out what an undocumented function does? (namely d3drs 172 and 173)
Cheers Nikolas
On Thursday 21 October 2004 21:43, N. Dahn wrote:
Hopefully this isnt the case, and according to this http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dx8_c/dire ctx_cpp/graphics_using_9bn7.asp i have luck for this time i think. :) Comments?
Well it seems only an activation flag, so no specific code So, i this it should a code like that:
case D3DRS_WRAP0: TRACE("Wrap Activation Flag for TextureStage 0 to %04x (QRST)\n", (DWORD) Value); break;
and in TSS wraping mngt (IDirect3DDevice8Impl_SetTextureStageState):
switch (Type) { case D3DTSS_ADDRESSU: if (D3DTADDRESS_WRAP != Value || (This->UpdateStateBlock->renderstate[D3DRS_WRAP0 + Stage] & D3DWRAPCOORD_0)) { TRACE("Setting WRAP_S to %d for %x\n", wrapParm, This->StateBlock->textureDimensions[Stage]); glTexParameteri(This->StateBlock->textureDimensions[Stage], GL_TEXTURE_WRAP_S, wrapParm); checkGLcall("glTexParameteri(..., GL_TEXTURE_WRAP_S, wrapParm)"); } break; case D3DTSS_ADDRESSV: if (D3DTADDRESS_WRAP != Value || (This->UpdateStateBlock->renderstate[D3DRS_WRAP0 + Stage] & D3DWRAPCOORD_1)) { TRACE("Setting WRAP_T to %d for %x\n", wrapParm, This->StateBlock->textureDimensions[Stage]); glTexParameteri(This->StateBlock->textureDimensions[Stage], GL_TEXTURE_WRAP_T, wrapParm); checkGLcall("glTexParameteri(..., GL_TEXTURE_WRAP_T, wrapParm)"); } break; case D3DTSS_ADDRESSW: if (D3DTADDRESS_WRAP != Value || (This->UpdateStateBlock->renderstate[D3DRS_WRAP0 + Stage] & D3DWRAPCOORD_2)) { TRACE("Setting WRAP_R to %d for %x\n", wrapParm, This->StateBlock->textureDimensions[Stage]); glTexParameteri(This->StateBlock->textureDimensions[Stage], GL_TEXTURE_WRAP_R, wrapParm); checkGLcall("glTexParameteri(..., GL_TEXTURE_WRAP_R, wrapParm)"); } break; default: /* nop */ break; /** stupic compilator */ }
But i don't know if its valid to call SetTextureStageState(...D3DTADDRESS_WRAP) before SetRenderState(...D3DWRAP_U...) (you should test) If you look at http://if.dynsite.net/t-pot/program/28_bump/bg_cpp_ps.html they do it
Okay, i think i got one step further: on gamedev.net i found the suggestion to use glTexParameteri(GL_TEXTURE_2D, TEXTURE_WRAP_U/V/W, wrapParm). Besides, could this also be an 3D Texture?
Yes: 3 param U/V/W
I think I worked it out and im going to try it out now, but theres one thing bothering me: as mentioned earlier in d3d there exists the d3dwrapcoord_3 flag which wraps textures through the 4th dimension (that should be time). However, i was unable to find _anything_ going into that direction in opengl so i stubbed it out for now. Does anybody know how to proceed with this?
I think its used for cube texture (need face selection) but don't worry for now
BTW, is there a way to figure out what an undocumented function does? (namely d3drs 172 and 173)
They seems deprecated since DX8.1 (maybe never implemented) D3DRS_POSITIONORDER = 172, D3DRS_NORMALORDER = 173,
Cheers Nikolas
Regards, Raphael
Well it seems only an activation flag, so no specific code So, i this it should a code like that:
case D3DRS_WRAP0: TRACE("Wrap Activation Flag for TextureStage 0 to %04x (QRST)\n", (DWORD) Value); break;
and in TSS wraping mngt (IDirect3DDevice8Impl_SetTextureStageState):
switch (Type) { case D3DTSS_ADDRESSU: if (D3DTADDRESS_WRAP != Value || (This->UpdateStateBlock->renderstate[D3DRS_WRAP0 + Stage] & D3DWRAPCOORD_0)) { TRACE("Setting WRAP_S to %d for %x\n", wrapParm, This->StateBlock->textureDimensions[Stage]); glTexParameteri(This->StateBlock->textureDimensions[Stage], GL_TEXTURE_WRAP_S, wrapParm); checkGLcall("glTexParameteri(..., GL_TEXTURE_WRAP_S, wrapParm)"); } break; case D3DTSS_ADDRESSV: if (D3DTADDRESS_WRAP != Value || (This->UpdateStateBlock->renderstate[D3DRS_WRAP0 + Stage] & D3DWRAPCOORD_1)) { TRACE("Setting WRAP_T to %d for %x\n", wrapParm, This->StateBlock->textureDimensions[Stage]); glTexParameteri(This->StateBlock->textureDimensions[Stage], GL_TEXTURE_WRAP_T, wrapParm); checkGLcall("glTexParameteri(..., GL_TEXTURE_WRAP_T, wrapParm)"); } break; case D3DTSS_ADDRESSW: if (D3DTADDRESS_WRAP != Value || (This->UpdateStateBlock->renderstate[D3DRS_WRAP0 + Stage] & D3DWRAPCOORD_2)) { TRACE("Setting WRAP_R to %d for %x\n", wrapParm, This->StateBlock->textureDimensions[Stage]); glTexParameteri(This->StateBlock->textureDimensions[Stage], GL_TEXTURE_WRAP_R, wrapParm); checkGLcall("glTexParameteri(..., GL_TEXTURE_WRAP_R, wrapParm)"); } break; default: /* nop */ break; /** stupic compilator */ }
But i don't know if its valid to call SetTextureStageState(...D3DTADDRESS_WRAP) before SetRenderState(...D3DWRAP_U...) (you should test) If you look at http://if.dynsite.net/t-pot/program/28_bump/bg_cpp_ps.html they do it
Well... im really a noob (learning c since 3 days i think oO ) could you please explain your code? Im not getting totally through it...
case D3DRS_WRAP0: TRACE("Wrap Activation Flag for TextureStage 0 to %04x (QRST)\n", (DWORD) Value); break;
I dont understand what this is good for... and ive no idea what is done in the different d3dtss calls... i really do what i can, but i think i lack experience...
Okay, i think i got one step further: on gamedev.net i found the suggestion to use glTexParameteri(GL_TEXTURE_2D, TEXTURE_WRAP_U/V/W, wrapParm). Besides, could this also be an 3D Texture?
Yes: 3 param U/V/W
*Dou* my fault...
I think I worked it out and im going to try it out now, but theres one thing bothering me: as mentioned earlier in d3d there exists the d3dwrapcoord_3 flag which wraps textures through the 4th dimension (that should be time). However, i was unable to find _anything_ going into that direction in opengl so i stubbed it out for now. Does anybody know how to proceed with this?
I think its used for cube texture (need face selection) but don't worry for now
Alright.
They seems deprecated since DX8.1 (maybe never implemented) D3DRS_POSITIONORDER = 172, D3DRS_NORMALORDER = 173,
Okay, they dont seem to break anything and i guess its quite painfull to figure out what they do, so ill leave them for now.
Regards, Nikolas
On Thu, Oct 21, 2004 at 09:43:34PM +0200, N. Dahn wrote:
Hopefully this isnt the case, and according to this http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dx8_c/direc... i have luck for this time i think. :) Comments?
Okay, i think i got one step further: on gamedev.net i found the suggestion to use glTexParameteri(GL_TEXTURE_2D, TEXTURE_WRAP_U/V/W, wrapParm). Besides, could this also be an 3D Texture? I think I worked it out and im going to try it out now, but theres one thing bothering me: as mentioned earlier in d3d there exists the d3dwrapcoord_3 flag which wraps textures through the 4th dimension (that should be time). However, i was unable to find _anything_ going into that direction in opengl so i stubbed it out for now. Does anybody know how to proceed with this?
What you're suggesting won't work. Texture addressing (D3DTSS_ADDRESS[U,V,S]) and texture coordinate wrapping (D3DRS_WRAP[0-7]) apply at different stages in the 3d pipeline and have different effects.
Texture addressing affects what happens when a texture lookup is done with coordinates outside the range 0 to 1 - D3DTADDRESS_REPEAT ignores the integer part of the coordinate, D3DTADDRESS_CLAMP samples on the edge of the texture, etc.
Texture coordinate wrapping affects interpolation of texture coordinates across a triangle. When wrapping is enabled for a component of a texture coordinate set then interpolation takes the shortest route across the triangle (considering 0 to be next to 1). So if we have a triangle with one vertex with texture coordinate (0.7, 0) and another vertex with texture coordinate (0.1, 0) and wrapping is enabled then pixels between the two vertices will get coordinates starting at (0.7, 0) and going up to (1, 0) then from (0, 0) up to (0.1, 0). With wrapping disabled the coordinates will start at 0.7 and go down to 0.1.