Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / problem with plain UV

Author
Message
mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 29th Jul 2011 13:27 Edited at: 29th Jul 2011 17:53
*** POST MOVED from "learn to write shaders" thread as it may be not shader problem ***

Hi, i need help with UV.

SOURCE CODE few posts below.

Attachments

Login to view attachments
Max P
14
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 29th Jul 2011 14:17
Quote: "problem blows my mind"

Mine too

It might be a slight accuracy problem with the floats in darkBasic...
mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 29th Jul 2011 16:23
You mean I can't manage with it?
Max P
14
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 29th Jul 2011 17:08
It might, but it can also be a problem with the shader or your db code. Can't do much without the full code or an example
mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 29th Jul 2011 17:27 Edited at: 29th Jul 2011 17:41
Texture is attached to post below.
mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 29th Jul 2011 17:40

Attachments

Login to view attachments
Max P
14
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 29th Jul 2011 18:44
Can't find the problem ether.. it realy blows my mind now too.
And looking at all those squares killed my brains
But I did figure out a way to get the result you want.
It won't win the price for best shader, but it works fine here

mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 29th Jul 2011 20:31 Edited at: 29th Jul 2011 20:32
OMG my head has EXPLODED!!!

It works! For any resolution! Thanks a lot!

But WHY it works!? It works fine as +0.1, +0.2, +0.3, +0.4 but not as +0.5 and further!
Max P
14
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 29th Jul 2011 22:38 Edited at: 29th Jul 2011 22:41
Quote: "But WHY it works!?"

It was clear the pixels just needed to move a bit, so I thought this would be a nice workaround.
Quote: "It works fine as +0.1, +0.2, +0.3, +0.4 but not as +0.5 and further"

I guess when using .5 and up the pixels are moved too much, resulting in the same problem again.

(But to be hounest, it was just a guess to do this )
Jeff032
16
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 30th Jul 2011 00:34
The fix is to shift all the vertices up and to the left by half a pixel.

http://msdn.microsoft.com/en-us/library/bb219690(v=vs.85).aspx

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Jul 2011 00:45
Who moved this from the "Learning to write shaders" thread? It seems to be a shader problem to me - and solved as such apparently.
mr Handy
16
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 30th Jul 2011 15:40
Quote: "The fix is to shift all the vertices up and to the left by half a pixel."

Thanks, man! Duh... How could I forget about this trick?! Shame on me!

Quote: "Who moved this from the "Learning to write shaders" thread? It seems to be a shader problem to me - and solved as such apparently. "

I did. Thought that it is something with the plain.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 30th Jul 2011 23:57
It's OK. I was "jumping the gun" - I hadn't seen your other post when I posted that.

Login to post a reply

Server time is: 2024-05-02 15:23:30
Your offset time is: 2024-05-02 15:23:30