wir machen grad ein rollenspiel in irrlicht und es muss fast mindestens bumpmapping oder parallaxmapping eingebaut sein
man kann mit irrlicht parallaxmapping verwenden. zumindest in C++ geht das reibungslos, ohne Shaderkenntnisse (wobei man die auch benutzen könnte.. evtl.. k.a.)
jedoch siehts bei Purebasic anders aus.
- 1. wenn ich DirectX9 verwende wird gar nichts angezeigt.
2. bei OpenGL [edit1] läuft normalmapping, der parallaxmapping-befehl wird gerade bearbeitet[/edit1]
unter C++ mit irrlicht 1.4 sieht die gleiche kugel so aus (leicht verzerrt, durch ulead gif animator)

ps: Code: (wenn möglich in purebasic\examples\irrlichtwrapper\" ordner verschieben, oder das imagegadget mit dem Logo vom irr3drequester einfach rauskommentierren.)
Code: Alles auswählen
#demo = 0
XIncludeFile #PB_Compiler_Home + "examples\irrlichtwrapper\Irr3DRequester.pb"
If Irr3DRequester()
IrrSetAmbientLight( 111,111,111)
IrrSetWindowCaption( "nice shader effekt - irrlicht - Max A. = Draufgeher " )
IrrSetTextureCreationFlag(#IRR_ETCF_ALWAYS_32_BIT, 1)
*font.l = IrrGetBuitInFont()
; ------------------------ licht ------------------------------
licht = IrrAddLight( 10, 210 , 10 , 233,23,23,2333)
*bill = IrrAddBillBoardToScene( 60,60,10,210,10)
IrrSetNodeMaterialTexture ( *bill , IrrGetTexture( #PB_Compiler_Home + "examples\irrlichtwrapper\media\fireball.jpg") , 0)
IrrSetNodeMaterialType ( *bill , #IRR_EMT_TRANSPARENT_ADD_COLOR)
IrrSetNodeMaterialFlag ( *bill , #IRR_EMF_LIGHTING , 0)
IrrSetNodeMaterialFlag ( *bill , #IRR_EMF_FOG_ENABLE , 0)
IrrAddChildToParent ( *bill , licht)
IrrAddFlyCircleAnimator ( licht , 10 , 210 , 10 , 2000 , 0.001 , 1 , 1 , 1)
; --------------------------- PARALLAX EARTH ------------------------------
CompilerIf #demo
text1.s = OpenFileRequester( "Lade die TEXTUR" , GetHomeDirectory() , "bilder|*.bmp;*.jpg;*.jpeg;*.png;*.tga;*.tiff|*.*|*.*" , 0 )
text2.s = OpenFileRequester( "Lade die RGB Normalmap" , GetHomeDirectory() , "bilder|*.bmp;*.jpg;*.jpeg;*.png;*.tga;*.tiff|*.*|*.*" , 0 )
CompilerElse
text1.s = #PB_Compiler_Home + "examples\irrlichtwrapper\Media\terrain-texture.jpg"
text2.s = #PB_Compiler_Home + "examples\irrlichtwrapper\Media\terrain-heightmap.bmp"
CompilerEndIf
*node.l = IrrAddSphereSceneNode( 110 , 100)
IrrSetNodePosition ( *node ,0,0,-10)
IrrSetNodeScale ( *node , 0.6 , 0.6 , 0.6)
*texture.l = IrrGetTexture ( text1 )
IrrSetNodeMaterialTexture ( *node ,*texture,0)
IrrSetNodeMaterialTexture ( *node , IrrGetTexture(text2),1)
IrrSetNodeMaterialFlag ( *node , #IRR_EMF_LIGHTING, 0);
IrrSetNodeMaterialType ( *node , #irr_emt_parallax_map_solid )
; IrrAddRotationAnimator ( *node , 0 , 0.1 , 0)
; ---------------------------Sky box ------------------------------------
*IrrSkyBox = IrrAddSkyBoxToScene( IrrGetTexture(#PB_Compiler_Home + "examples\irrlichtwrapper\media\irrlicht2_up.jpg"),IrrGetTexture(#PB_Compiler_Home + "examples\irrlichtwrapper\media\irrlicht2_dn.jpg"),IrrGetTexture(#PB_Compiler_Home + "examples\irrlichtwrapper\media\irrlicht2_lf.jpg"), IrrGetTexture(#PB_Compiler_Home + "examples\irrlichtwrapper\media\irrlicht2_rt.jpg"), IrrGetTexture(#PB_Compiler_Home + "examples\irrlichtwrapper\media\irrlicht2_ft.jpg"), IrrGetTexture(#PB_Compiler_Home + "examples\irrlichtwrapper\media\irrlicht2_bk.jpg"))
; --------------------------- Camera --------------------------------------
*OurCamera = IrrAddFPSCamera()
IrrSetNodePosition ( *OurCamera, -100,50,100)
IrrSetCameraTarget ( *OurCamera, 0,0,0 )
IrrHideMouse ( )
While IrrRunning()
IrrBeginScene( 240, 255, 255 )
IrrDrawScene()
IrrDrawGUI()
IrrEndScene()
If getasynckeystate_(#VK_ESCAPE )
IrrStop()
End
EndIf
Wend
IrrStop()
EndIf
End