Forum Replies Created
- 
		AuthorPosts
 - 
		
			
				
Thank you, is sometimes difficult, I have learned with coding, so I think I speech like a robot.
“works but not” mean that the code is compiled but the result is not that it’s supposed to do. I say something like that in french (“ça marche mais pas”) but even in french, nobody understands me. In my mind, it’s like “x = not x”, but you shoudn’t take it formally. Except mistake I believe that it’s from Michael Abrash but I would not like credit him for a stupid thing. Otherwise, the french langage is too complicated, that rotting our head. The subjects and the adjectives is logic-inversed. But explain that to the french peoples…
I think that the problem is relied to my hardware. But it’s updated, restarted, monkey2 reinstalled. Like Mark says himself, a size-fixed gbuffer is not elegant, plus I works to much on markovian processes for to investigate more forward and not smart enough to understand the mark’s code in every detail, since I don’t write for opengl, originally. However I believe I understand why Mark have coded in that way. From this problem I have listened a lot, that’s very good for me.
By the way, pretty color scheme.
I uses a normal azerty keyboard, it’s a Corsair, then it’s not a bizarre problems I think so (not caused by a noname keyboard). What you say means that if I’ll copy/past a char, this should fixed the problem, in a short way…
From my last Ted2Go’s session, I have replaced all “ by a “ from mojo (maybe another utf8-code in my mind) but Ted2Go have crashed directly after the first random next key pressed. I would say, pure win32 crash.
So, re-run Ted2Go, some fingers movements. And… no crash. Because the bad utf8 isn’t in the undo-sequence anymore, I can add an new argument in my line exemple, well, from my point of view…
I presume that the problem it’s
fixedpatched from your suggestion.No need to say that’s the undo functionality is amazing.
It’s the same code that I posted as #5989
Namespace myapp
#Import “<std>”
#Import “<mojo>”
#Import “assets/Tile1.png”
#Import “assets/Tile2.png”
#Import “assets/Tile3.png”
#Import “assets/Tile4.png”
#Import “assets/Tile4_NORMALS.png”
#Import “assets/Tile4_SPECULAR.png”
#Import “assets/pointlight_light.png”
Using std..
Using mojo..Global WSX:Int = 1280
Global WSY:Int = 720Class MyWindow Extends Window
Field Tile1:Image
Field Tile2:Image
Field Tile3:Image
Field Tile4:Image
Field light:Image
Field pos:=New Vec2fMethod New()
Super.New(“Test”,WSX,WSY,WindowFlags.Resizable)
Mouse.PointerVisible = False
Style.BackgroundColor=Color.Black
Tile1=Image.Load(“asset::Tile1.png”)
Tile2=Image.Load(“asset::Tile2.png”)
Tile3=Image.Load(“asset::Tile3.png”)
Tile4=Image.LoadBump( “asset::Tile4.png”,”asset::Tile4_NORMALS.png”,”asset::Tile4_SPECULAR.png”,8.5,false )
light=Image.LoadLight( “asset::pointlight_light.png” )
light.Handle=New Vec2f( .5,.5 )
light.Scale=New Vec2f( 5,5 )
pos=New Vec2f(1,1)
EndMethod OnUpdate()
Local spd:int = 2
If Keyboard.KeyDown( Key.Right )
pos.x=(pos.x+spd)
end
If Keyboard.KeyDown( Key.Left )
pos.x=(pos.x-spd)
end
If Keyboard.KeyDown( Key.Down )
pos.y=(pos.y+spd)
End
If Keyboard.KeyDown( Key.Up )
pos.y=(pos.y-spd)
end
EndMethod OnRender( canvas:Canvas ) Override
App.RequestRender()
OnUpdate()
canvas.TextureFilteringEnabled = false
For Local y:= 1 Until (480) Step 64
For Local x:= 1 Until (640) Step 64
canvas.DrawImage( Tile1,x-(pos.x*1.1),y-(pos.y*1.1))
Next
Next
For Local y:= 1 Until (480) Step 64
For Local x:= 1 Until (640) Step 64
canvas.DrawImage( Tile2,x-pos.x*1.3,y-(pos.y*1.3))
Next
Next
For Local y:= 1 Until (480) Step 64
For Local x:= 1 Until (640) Step 64
canvas.DrawImage( Tile3,x-pos.x*1.5,y-(pos.y*1.5))
Next
Next
canvas.BeginLighting()
For Local y:= 1 Until (480) Step 64
For Local x:= 1 Until (512) Step 64
canvas.DrawImage( Tile4,x-pos.x*1.7,y-(pos.y*1.7))’,pos.x/10,pos.y/10)
Next
Next
canvas.AddLight(light,Mouse.X,Mouse.Y )
canvas.EndLighting()
canvas.Flush()
End
EndFunction Main()
New AppInstance
New MyWindow
App.Run()
EndWith :
Global WSX:Int = 1920
Global WSY:Int = 1080
Super.New(“Test”,WSX,WSY,WindowFlags.Fullscreen)It’s works.
If I change the buffer’s resolution in mojo and recompile all, that’s works but not.
Finded.
In Mojo.Canvas :
Method BeginLighting()
DebugAssert( Not _lighting,”Already lighting” )
If _lighting Return_lighting=True
If Not _gbuffers[0]
Local gbufferSize:=New Vec2i( 1920,1080 )
Local gbufferScale:=New Vec2f( 1 )/Cast<Vec2f>( gbufferSize )_gbuffers[0]=New Texture( gbufferSize.x,gbufferSize.y,PixelFormat.RGBA32,TextureFlags.Dynamic )
_gbuffers[1]=New Texture( gbufferSize.x,gbufferSize.y,PixelFormat.RGBA32,TextureFlags.Dynamic )_uniforms.SetVector( “mx2_GBufferScale”,gbufferScale )
_uniforms.SetTexture( “mx2_GBuffer0”,_gbuffers[0] )
_uniforms.SetTexture( “mx2_GBuffer1”,_gbuffers[1] )Endif
The problem is “Local gbufferSize:=New Vec2i( 1920,1080 )”
If I use 1920×1080 full screen, normal lighting is correctly rendered.
So, this thing need a hack.
Low resolution such 480×270 is really important to me. But I don’t understand why nobody haven’t reported this issue. Bizarre.
Mark should take a look at that.
Nothing in a empty project, but not in my project è_é
ASResolution seems to crash immediatly Ted2.
With :
Const GBA:= New ASRes(240,160,3,2,”GBA”)’:= HQVGA
Nothing is happening.
Edit : nevermind.
Thank you for your interest in regards to my strange problem…
None of the code/gfx is modified in SimpleLight banana. I prefere works on my exemple now, more elemental, without canvas transformations. See my code. It’s a large problem. Shadow caster tested on the the tile4, it works, no issue. I can continue to verify your code but without you, it can take very long time.
My driver is updated, I’m on 342.01. But maybe the problem concern DirectX11. According the release notes of 342.xx,
driver version 197.45 and Windows Vista (with available patch) support DirectX 11. But only NVIDIA graphics cards based on the Fermi architecture released in 2010 support DirectX 11. So your system must have one of these cards installed in order to take advantage of DirectX 11 performance.
So, I will continues some verifications.
I have done screenshoots of this problem. It’s a very big jpg, sorry, but you can see better. I give you my gfx too, Tile1/Tile2/Tile3 are other 64×64 png like Tile4.png, but they’re correct because : #1 I have a pro formation so I can match with the production imperatives #2 My issue concern all tests, all bananas who’s uses light functionnality, like Simplelight.
I’m SURE that the matrix of the light buffer is wrong regarding the canvas, by and large for my hardware. But the render operations works well. The buffers are just not overlapped. This seems to be the same problem I encountered on one of my works a long time ago. The vertex buffer is not adjusted with the canvas. This fact involve malfunctions with the window scale, no matter that the app is fullscreen or in the window mode.
For the next step, I will install the android’s sdk. Since I’m the only one who’s have this problem, I must continues the tests on the other targets.
I lurks the community from many years but I know nobodies. I still can not speak better in English since this days. Merry thingmas to all.
I have finded something interesting. When the window is resized, the buffer of diffuse+lightmap is resized. In my exemple, if I maximize the window, then the buffer is close to match, but not, because the top of the window. I use Windows7 with classic mode, but I don’t think this problem is of this fact.
This is a *simple* light version of my code, and for me, this works but not. When I draw directly or not in the canvas.
You must knows that the banana SimpleLight works but not too.
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990Namespace myapp#Import "<std>"#Import "<mojo>"#Import "assets/Tile1.png"#Import "assets/Tile2.png"#Import "assets/Tile3.png"#Import "assets/Tile4.png"#Import "assets/Tile4_NORMALS.png"#Import "assets/Tile4_SPECULAR.png"#Import "assets/pointlight_light.png"Using std..Using mojo..Global WSX:Int = 1280Global WSY:Int = 720Class MyWindow Extends WindowField Tile1:ImageField Tile2:ImageField Tile3:ImageField Tile4:ImageField light:ImageField pos:=New Vec2fMethod New()Super.New("Test",WSX,WSY,WindowFlags.Resizable)Mouse.PointerVisible = FalseStyle.BackgroundColor=Color.BlackTile1=Image.Load("asset::Tile1.png")Tile2=Image.Load("asset::Tile2.png")Tile3=Image.Load("asset::Tile3.png")Tile4=Image.LoadBump( "asset::Tile4.png","asset::Tile4_NORMALS.png","asset::Tile4_SPECULAR.png",8.5,false )light=Image.LoadLight( "asset::pointlight_light.png" )light.Handle=New Vec2f( .5,.5 )light.Scale=New Vec2f( 5,5 )pos=New Vec2f(1,1)EndMethod OnUpdate()Local spd:int = 2If Keyboard.KeyDown( Key.Right )pos.x=(pos.x+spd)endIf Keyboard.KeyDown( Key.Left )pos.x=(pos.x-spd)endIf Keyboard.KeyDown( Key.Down )pos.y=(pos.y+spd)EndIf Keyboard.KeyDown( Key.Up )pos.y=(pos.y-spd)endEndMethod OnRender( canvas:Canvas ) OverrideApp.RequestRender()OnUpdate()canvas.TextureFilteringEnabled = falseFor Local y:= 1 Until (480) Step 64For Local x:= 1 Until (640) Step 64canvas.DrawImage( Tile1,x-(pos.x*1.1),y-(pos.y*1.1))NextNextFor Local y:= 1 Until (480) Step 64For Local x:= 1 Until (640) Step 64canvas.DrawImage( Tile2,x-pos.x*1.3,y-(pos.y*1.3))NextNextFor Local y:= 1 Until (480) Step 64For Local x:= 1 Until (640) Step 64canvas.DrawImage( Tile3,x-pos.x*1.5,y-(pos.y*1.5))NextNextcanvas.BeginLighting()For Local y:= 1 Until (480) Step 64For Local x:= 1 Until (512) Step 64canvas.DrawImage( Tile4,x-pos.x*1.7,y-(pos.y*1.7))',pos.x/10,pos.y/10)NextNextcanvas.AddLight(light,Mouse.X,Mouse.Y )canvas.EndLighting()canvas.Flush()EndEndFunction Main()New AppInstanceNew MyWindowApp.Run()End - 
		AuthorPosts
 


