Some problems with N3XTD
Posted: Fri Sep 10, 2010 7:53 pm
EDIT: Sorry for posting in the wrong topic. Plz move to "game programming" or "coding questions". Thanx
Hi there !!!
First of all thanx to Tmyke for his great work. I heard rumors that you are helping with the new ogre implementation. Anyway I hope you will make the N3XTD-Site online again in the meanwhile. But now to my topic...i've got some problems using N3XTD. I hope somebody can help me.
When i'm lightening an object it's seems to be rendered flatshaded. When i flag the materialnode to #EMF_GOURAUD_Shading the engine renders just a bunch of points, but no gouraudshading! Another thing i don't understand is when i'm using XShaders for e.g. Phong, the render resolution is not the same as without the xshader. All looks very pixellated. I hope somebody can help me a little bit. The last thing i would like to now if it is possible to use specularmaps for rendering entities. Do i need a shader for it?
Regards
Alexander
Here is the code i'm using:
I copied the XShader Folder into my working folder. Im not using the Media folder at the moment.
Hi there !!!
First of all thanx to Tmyke for his great work. I heard rumors that you are helping with the new ogre implementation. Anyway I hope you will make the N3XTD-Site online again in the meanwhile. But now to my topic...i've got some problems using N3XTD. I hope somebody can help me.
When i'm lightening an object it's seems to be rendered flatshaded. When i flag the materialnode to #EMF_GOURAUD_Shading the engine renders just a bunch of points, but no gouraudshading! Another thing i don't understand is when i'm using XShaders for e.g. Phong, the render resolution is not the same as without the xshader. All looks very pixellated. I hope somebody can help me a little bit. The last thing i would like to now if it is possible to use specularmaps for rendering entities. Do i need a shader for it?
Regards
Alexander
Here is the code i'm using:
Code: Select all
;PB-Version 4.41
;IncludePath #PB_Compiler_Home + "Includes\" : IncludeFile "n3xtD_PB.pbi"
IncludePath "includes" : IncludeFile "n3xtD_PB.pbi"
Global *nView.l, Quit.l
Global Fullscreen.l = 0
Global anglex.f, angley.f, flagXDown.w
Global mox.f, omx.f, moy.l, omy.l
;ilogfile(#True)
iSetAntiAlias(#True)
File.s = OpenFileRequester("3DS öffnen", "", "3ds | *.3ds", 0)
If Not Fullscreen
*nView = ICreateGraphics3D(1024,768, 32, #False, #True,#EDT_DIRECT3D9)
Else
ExamineDesktops()
*nView = ICreateGraphics3D(DesktopWidth(0),DesktopHeight(0),32, #True, #True, #EDT_direct3d9)
EndIf
If *nView = #Null : End : EndIf
;SetCurrentDirectory("media/")
*light.ILight = iCreateLight($FFFFFF, 1000)
iPositionNode(*light, 0,100,-50)
;iTypeLight(*light,2)
Global *Objekt.IObject = iLoad3DObject(File)
Global *Mesh.IMesh = iCreateMesh(*Objekt)
iPositionNode(*Mesh, 0,0,0)
;iMaterialFlagNode(*Mesh,#EMF_ANISOTROPIC_FILTER, #True)
iMaterialFlagNode(*Mesh,#EMF_GOURAUD_SHADING,#True)
;imaterialflagnode(*mesh,#EMF_ZWRITE_ENABLE , 1)
;imaterialflagnode(*mesh,#EMF_LIGHTING , #False)
;iScaleMeshBuffer( iMeshGeometry(*Mesh), 20,20,20)
Define *Cam.ICamera = iCreateCamera()
iPositionNode(*Cam, 0,10,-30)
;iAddToNodeXEffect(*mesh, #EET_PHONG)
;iAddToNodeXEffect(*mesh, #EET_MRWIGGLE)
;AddShadowLightXEffect( 150.0,0,150.0, 200,0,0 ,$FFFFFF, 1.0, 16000.0, 35.0 , 768, 0)
;iAmbientColorXEffect($ffffffff)
;iClearColorXEffect($ffffff00)
;iAddFilePostProcessingXEffect("Shaders/PP_DX_Bloom1.fx")
Repeat
If evt = #PB_Event_CloseWindow
quit = 1
EndIf
If iGetKeyDown(#KEY_ARROW_UP)
iMoveNode(*Cam, 0,0,0.5)
EndIf
If iGetKeyDown(#KEY_ARROW_DOWN)
iMoveNode(*Cam, 0,0,-0.5)
EndIf
If igetkeydown(#key_arrow_left)
imovenode(*cam , -0.5 , 0 , 0 )
EndIf
If igetkeydown(#key_arrow_right)
imovenode(*cam , 0.5 , 0 , 0)
EndIf
If iGetMouseEvent(#MOUSE_BUTTON_LEFT)
If flagXDown=0
omx = iGetMouseX()
omy = iGetMouseY()
flagXDown=11
Else
moy = iGetMouseY()-omy
angley=(moy/10.0)
omy= iGetMouseY()
mox = iGetMouseX()-omx
anglex=(mox/10.0)
omx= iGetMouseX()
iTurnNode(*Cam, angley, anglex,0)
EndIf
Else
flagXDown=0
EndIf
iTurnNode(*Mesh, 0,0.05,0)
If iGetKeyDown(#KEY_ESCAPE) : Quit=1 : EndIf
iBeginScene()
iDrawScene()
iEndScene()
Until Quit=1
iFreeEngine()
End