GPWiki.org
GPWiki.org
It is currently Thu May 23, 2013 1:37 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Feb 21, 2012 10:35 pm 
Level 1 Cleric

Joined: Tue Feb 21, 2012 10:24 pm
Posts: 10
Microsoft DirectX 9.0 / C++ Question about Setting Sampler State / Clamp Texture Address Mode.

How can I get a SetSamplerState to effect a specific custom vertex and not the whole entire scene?

For instance, I created a scene with 3D objects and stuff completely surrounded by a Skybox cube.

I'm trying to get the following code to effect my skybox cube face textures only, and not the rest of the scene.
:(

// Clamp Texture Address Mode.
g_pD3DDevice->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP );
g_pD3DDevice->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP );


The code works great as far as getting rid of those noticeable seams in the skybox, but it also messes up the rest of the stuff. :rolleyes

Any help would be greatly appreciated.. Thanks! :thumbs


Top
 Profile  
 
PostPosted: Thu Feb 23, 2012 11:53 am 
Grossly Helpful

Joined: Wed Apr 12, 2006 6:22 pm
Posts: 154
Set the sampler state to
nder your skybox.
Code:
g_pD3DDevice->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP );
 g_pD3DDevice->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP );

just before you render your skybox then set it back to what it was before just after you render your skybox.


Top
 Profile  
 
PostPosted: Sun Feb 26, 2012 5:48 am 
Level 1 Cleric

Joined: Tue Feb 21, 2012 10:24 pm
Posts: 10
budinga wrote:
Set the sampler state to
nder your skybox.
Code:
g_pD3DDevice->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP );
 g_pD3DDevice->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP );

just before you render your skybox then set it back to what it was before just after you render your skybox.


Worked like a charm! Thanks! :rock


Top
 Profile  
 
PostPosted: Fri Mar 02, 2012 9:29 pm 
Grossly Helpful

Joined: Wed Apr 12, 2006 6:22 pm
Posts: 154
your welcome


Top
 Profile  
 
PostPosted: Sat Apr 07, 2012 1:14 pm 
Level 1 Cleric

Joined: Tue Feb 21, 2012 10:24 pm
Posts: 10
Hey,
if anyone's interested, here's a youtube video link to what I was working on. It's still WIP.
Let me know what you think.
Enjony! :rock

http://www.youtube.com/watch?v=aeRnzaGy ... XF_R8YYS-Q


Top
 Profile  
 
PostPosted: Thu Apr 19, 2012 6:28 pm 
Grossly Helpful

Joined: Wed Apr 12, 2006 6:22 pm
Posts: 154
nice i see your learning. i amyself am working on my planet renderer heres a link to my first proper video if your interested.

Code:
http://www.youtube.com/watch?v=-izVQtf2WB8


Top
 Profile  
 
PostPosted: Wed Apr 25, 2012 2:31 am 
Level 1 Cleric

Joined: Tue Feb 21, 2012 10:24 pm
Posts: 10
budinga wrote:
nice i see your learning. i amyself am working on my planet renderer heres a link to my first proper video if your interested.

Code:
http://www.youtube.com/watch?v=-izVQtf2WB8


Cool, great stuff. :) I like it.

So how long have you been programming?


Top
 Profile  
 
PostPosted: Wed Apr 25, 2012 6:41 pm 
Grossly Helpful

Joined: Wed Apr 12, 2006 6:22 pm
Posts: 154
TonyJack wrote:
budinga wrote:
nice i see your learning. i amyself am working on my planet renderer heres a link to my first proper video if your interested.

Code:
http://www.youtube.com/watch?v=-izVQtf2WB8


Cool, great stuff. :) I like it.

So how long have you been programming?



Thanx well i have been trying since i was about 8, but only the last 10 years i got good enough to do something nice, i tought myself thats why my coding is not entirely great, but life i sall about learning and remember google is your best friend :).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group