PDA

View Full Version : TBGL_TextureRepeatMode



ReneMiner
29-03-2013, 16:01
As title says: I want to know how to enable the texture-repeat-mode so I can set mesh with tU/tV- values below 0.0 and above 1.0, so it works somewhat like shown below:




0,1-------------- 1,1 0,2------------- 2,2
| | | TEX TEX |
| T E X | | |
| | | TEX TEX |
0,0------------- 1,0 0,0------------- 2,0



TBGL-Help says, that would be enabled by default but it does not seem to work. Is there an OpenGL-crank to wind?

Petr Schreiber
29-03-2013, 19:16
Hi Rene,

why do you think it does not work by default, here little example:



Uses "TBGL" ' -- Module for 3D graphics
Uses "File"

Dim hWnd As DWord
Dim sTexture As String = APP_SourcePath+"Textures\Test.Bmp"

' -- Creates window and returns handle by which we can identify it
hWnd = TBGL_CreateWindowEx("Texturing example, press ESC to quite", 640, 480, 32, %TBGL_WS_WINDOWED)
TBGL_ShowWindow

' -- Loads texture to slot 1 with MIPMAP filtering
If FILE_Exists(sTexture) = FALSE Then
MsgBox hWnd, "Could not find the following texture:" + $CRLF + sTexture
TBGL_DestroyWindow
Stop
Else
TBGL_LoadTexture sTexture, 1, %TBGL_TEX_MIPMAP
End If

' -- Enables aplication of textures to objects
tbgl_UseTexturing %TRUE

' -- We will apply texture 1
tbgl_BindTexture 1

TBGL_ResetKeyState() ' -- Resets status of all keys

' -- Main loop
While TBGL_IsWindow(hWnd)

' -- Erases previous frame
tbgl_ClearFrame

' -- Sets camera to look from 0,0,5 to 0,0,0
tbgl_Camera 0, 0, 5, _
0, 0, 0

' -- Creates quads, shapes with 4 vertices
TBGL_BeginPoly %GL_QUADS
tbgl_TexCoord2D 0, 0 ' -- Texture coordinate, lower left corner
tbgl_Vertex -1, -1, 0

TBGL_TexCoord2D 2, 0 ' -- Texture coordinate, lower right corner
tbgl_Vertex 1, -1, 0

TBGL_TexCoord2D 2, 2 ' -- Texture coordinate, higher right corner
tbgl_Vertex 1, 1, 0

TBGL_TexCoord2D 0, 2 ' -- Texture coordinate, higher left corner
tbgl_Vertex -1, 1, 0
tbgl_EndPoly

' -- Finishes drawing
tbgl_DrawFrame

' -- If ESC key is pressed, it will jump out of loop
If TBGL_GetWindowKeyState( hWnd, %VK_ESCAPE) Then Exit While

Wend

' -- Destroys window
TBGL_DestroyWindow



Petr

ReneMiner
29-03-2013, 20:52
On my Entity it looks like this:
Half of the surface is empty - actually you see the whole texture until center (1.0) and blank from center to the right border. The TBGL_SetTextureRepeatMode(tried all swiches) does not change anything about that.

(my Entities are "wearing" TBGL_Material where the texture is a part of, so I don't use TBGL_BindTexture but TBGL_PushMaterial before creating displaylist)

Petr Schreiber
30-03-2013, 11:11
If there something strange, in your neighbourhood, who you gonna call? Well, Petr in this case - but he needs a minimal example for tests, because this behavior is not normal.


Petr

ReneMiner
30-03-2013, 13:58
Sorry, I won't upload here. Top-Secret :)

PM does not accept attachements any more?
So I'll be waiting until I meet you in chat to send you a "small" example for testing.
Maybe it's my "outdated" hardware's fault and it will work fine on your pc :unsure:

John Spikowski
30-03-2013, 18:03
Sorry, I won't upload here. Top-Secret

Another typical user. Begs everyone for help, blames the language and any extensions that might be used and then when they discover their errors, they are unwilling to share so others can learn from their mistakes.

Personally I think your rude and could care less about anything other than your issues.

Most good programmers first try to find working examples of what they are trying to do before using a tool they know nothing about. I don't feel sorry for you in the least and you deserve all the pain you inflect on yourself.

ReneMiner
30-03-2013, 21:13
So - this supposed to be a helpful post to my problem John?

I have not discovered the error yet- because -strange however it is - this morning I still was angry about my material and textures not applying correctly and I don't know what exactly I've changed now - but as you can see- now it works...

If I discover stuff in thinBasic that does not seem to work as I think it has to, then I ask questions like these. So found a lot of stuff that needed some make-over or fixing already - but also a lot of false alerts I gave because lack in flexibility of thinking :D - but how comes?
Because I'm actually using thinBasic 8 days a week and 30 hours per day and create something with thinBasic. I have lot's of more questions - theirs answers I find often on other places, so I don't ask them here. I've learned a lot about behaviours that are unique in thinBasic - but also it's possibilities - and not to mention the incredible speed of it while the files are so small...

And about willing to share: As soon as my program is finished you might have a look at it and I promise you'll stay and stare open-mouth and begging for pardon. The program consists of several units - quite very large - but still undone and I intend to continue writing it which will take at least 3 or 4 more months to be in a releaseble stage.

And I'm not willing to anyone make some profit from it - that's right! - when it's about the financials - so that's why I keep it "secret" until it comes to an official release. Otherwise, I fear someone will steal my intellectual property and will not just make profit but also protect it from free-use-for-all. That's why it will have to wait until it's done - and as said, Petr would be a person that could have a look at it right now because he's 100% on thinBasic's side and plays big parts behind the curtain, but not you.

John Spikowski
30-03-2013, 22:24
I promise you'll stay and stare open-mouth and begging for pardon.

That promise better be you landing on my front yard with a UFO and inviting me for a ride otherwise you will come up short.

zlatkoAB
31-03-2013, 02:33
This becomes funny...:D

John Spikowski
31-03-2013, 04:55
It's a toss up which is more entertaining, Rene's ego or his unrealistic expectations.

zlatkoAB
31-03-2013, 08:51
hey i made a song...

no more freeware little John
take your nerves and so on
no more open source
sharing code is such a sauce

ReneMiner
31-03-2013, 09:56
At least I found a possible cause for that behaviour because I remember what I did change in my script...and I think there are few people who won't like this...

The screenshots show almost the same but- the first is different: Texture-preview was shown on a sprite, in the second screenshot the texture preview is just 2 raw triangular faces and 4 vertices.
I changed it from sprite because I discovered that it's impossible mixing 2d-sprites and textured stuff in 3d. In the first place it works - but as soon as one has a texture on some mesh displayed in scene the sprites go crazy and ALL sprites show the SAME texture but not the one that they're supposed to show - they just show same texture as the last created object in 3d has applied. All of them.

No matter what I do- even load another sprite, destroy it or set another texture to it: that gets ignored - the sprites show what they want to but not what they're supposed to. So that's the reason why I took all the sprites out of my script.
And that's all I changed about that - and now TextureRepeatMode does what it should :)

Petr Schreiber
31-03-2013, 10:42
Hi Rene,

my apologies for late reply, I am still a bit ill so I avoid the PC to prevent my eyeballs from exploding.

I am happy you found the solution and look forward to the final version! It is true Sprites have a bit special handling, it didn't occur to me they were used in this case.


Petr

ReneMiner
31-03-2013, 12:16
Thanks for reply at all - I think it's great and unusually positive that developers actually care that much about their users - in many other cases one has to wait at least one week until one knows if one gets an answer at all.


It's a toss up which is more entertaining, Rene's ego or his unrealistic expectations.

I expect to create what I imagine. And I think I know what I can realize now. And I know that I'll discover more possibilities in thinBasic every day - so that will make my expectations grow as my imagination grows.

It does not help anybody if brown-nosed comments are made, neither will anybody learn something about TextureRepeatMode from your posts - so you might open a thread in the shoutbox-area to release your opinions. I think there's some reason why you're banned from so many forums - but I guess it's a challenge to tolerate some uncomfy opinions too, because it raises the bar. We like challenges - even though - does not mean that we like what we tolerate.

John Spikowski
31-03-2013, 21:43
Here is a replacement avatar for you. The hope is that more visitors to the forum will read your posts with the anticipation of some humor value.

http://files.allbasic.info/thinBASIC/rene.png

ErosOlmi
01-04-2013, 10:55
I think there's some reason why you're banned from so many forums - but I guess it's a challenge to tolerate some uncomfy opinions too, because it raises the bar. We like challenges - even though - does not mean that we like what we tolerate.

Correct: it is a challenge.

John Spikowski
01-04-2013, 16:20
Correct: it is a challenge.

Somebody has to stand up to user abuse. Rene's project isn't a gold standard all languages must conform to. He needs to find someone else to blame for all his self inflected problems. He should stick with commercial languages with his ego. At least their getting paid to put up with his crap.

Petr Schreiber
01-04-2013, 16:37
I would like to wish happy easter to the contributors and I am closing the thread, because the original issue is solved and we are getting way off topic. Feel free to open new thread for polite discussions.


Petr