It is currently Thu Sep 24, 2020 1:10 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: texture dont working ...
PostPosted: Sat Apr 23, 2016 1:34 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Dec 04, 2015 9:26 pm
Posts: 288
hi everyone ^^

someone know why texture dont working ?

link of my test > http://coldbasic.com.br/shared/texture_not_working.zip


Top
 Profile  
Reply with quote  
 Post subject: Re: texture dont working ...
PostPosted: Sat Apr 23, 2016 5:31 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2011 10:06 am
Posts: 864
Location: Denmark
Hey

It looks like your mesh might be missing UV texture coordinates.
The material and texture is just fine.

Here is a small test.

material script:
Code:
material mat
{
   technique
   {
      pass
      {
         scene_blend add
         depth_write off

         texture_unit
         {
            texture bg.png
         }
      }
   }
}


Code:

Code:
UsePNGImageDecoder()
InitEngine3D()
InitSprite()

If OpenWindow(1,0,0,600,600,"Testing mesh model",#PB_Window_SystemMenu)
 
  OpenWindowedScreen(WindowID(1),0,0,600,600,1,0,0)
 
  Add3DArchive(".", #PB_3DArchive_FileSystem)
 
  Parse3DScripts()
 
  CreateCamera(0, 0, 0, 100, 100)
  CreateLight(0, $FFFFFF, 20, 0, 25)
  LightLookAt(0, 0, 0, 0)
  MoveCamera(0, 0, 0, 140)
 
  CreateCube(0, 30) ;<--Create a cube to test with
  ;LoadMesh(0,"staca.mesh")  ;<--- I think the mesh is wrong. UV texture coordinates.
  ;LoadTexture(0, "bg.png")
  GetScriptMaterial(0, "mat")
  CreateEntity(0, MeshID(0), MaterialID(0))
 
  Repeat 
   
    event  = WindowEvent()
    RotateEntity(0, 0.2, 0.4, 0.6, #PB_Relative)
    RenderWorld()
    FlipBuffers()
   
  Until event = #PB_Event_CloseWindow
 
EndIf 

_________________
“Tell me and I forget. Teach me and I remember. Involve me and I learn.”
— Benjamin Franklin
Current configurations: Windows 10, Intel 6800K, GeForce Gtx 1060, 32 gb ram.


Top
 Profile  
Reply with quote  
 Post subject: Re: texture dont working ...
PostPosted: Sun Apr 24, 2016 7:04 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Dec 04, 2015 9:26 pm
Posts: 288
DK_PETER wrote:
Hey

It looks like your mesh might be missing UV texture coordinates.
The material and texture is just fine.

Here is a small test.

material script:
Code:
material mat
{
   technique
   {
      pass
      {
         scene_blend add
         depth_write off

         texture_unit
         {
            texture bg.png
         }
      }
   }
}


Code:

Code:
UsePNGImageDecoder()
InitEngine3D()
InitSprite()

If OpenWindow(1,0,0,600,600,"Testing mesh model",#PB_Window_SystemMenu)
 
  OpenWindowedScreen(WindowID(1),0,0,600,600,1,0,0)
 
  Add3DArchive(".", #PB_3DArchive_FileSystem)
 
  Parse3DScripts()
 
  CreateCamera(0, 0, 0, 100, 100)
  CreateLight(0, $FFFFFF, 20, 0, 25)
  LightLookAt(0, 0, 0, 0)
  MoveCamera(0, 0, 0, 140)
 
  CreateCube(0, 30) ;<--Create a cube to test with
  ;LoadMesh(0,"staca.mesh")  ;<--- I think the mesh is wrong. UV texture coordinates.
  ;LoadTexture(0, "bg.png")
  GetScriptMaterial(0, "mat")
  CreateEntity(0, MeshID(0), MaterialID(0))
 
  Repeat 
   
    event  = WindowEvent()
    RotateEntity(0, 0.2, 0.4, 0.6, #PB_Relative)
    RenderWorld()
    FlipBuffers()
   
  Until event = #PB_Event_CloseWindow
 
EndIf 


thanks by you answer DK_PETER ^^


let me do another ask !

how do i can add texture.png and material.material in same model with " PB CODE " ?

example >

Code:
 LoadMesh(0,"Body.mesh")  ;<--- My 3D model
  LoadTexture(1, "Body_.png") <--- My 3D model texture
  CreateMaterial(0,TextureID(1))  <--- create material with texture
  GetScriptMaterial(0, "mat") <--- here !! get some " Script .material"
  CreateEntity(0, MeshID(0), MaterialID(0)) <--- here add texture and .material in same model ..
 


how can i do this ?


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 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 © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye