Forum Replies Created
-
AuthorPosts
-
Look up ‘modules/mojo3d/graphics/pbrmaterial.monkey2’ (Or hit F2 on PbrMaterial in Ted2Go)
You’ll get a clearer view of how it’s done.
You can extend that class, but change ‘Shader.Open’ from ‘material’ to ‘yourShaderWithTransparency’I guess you could also do something like this to the normal PbrMaterial
‘material.Shader=New Shader( name, LoadString( pathToShader ) )’
Or maybe just ‘Shader.Open’ there?
I haven’t tested, but should work.
But Mark might yell at you for doing something like that…I’ve had some progress, but the problem is that the data I get from ReadProcessMemory does not match with what other memory readers show.
For example, the memory address for me at the time of testing $0CC7E8E8 was how far I’ve scrolled in Ted2Go.
That value when read via this example remains unchanged no matter how much I scroll, but I can see the value change in other memory readers just fine.
And restarting the example below displays another value the next time, even though I have NOT scrolled.
So I’m not sure what kind of data I’m getting back…This may be hard for others to test since the address probably won’t be the same twice, and your Process ID for Ted2Go will be different…
But really, all you have to do is have Ted2Go running, find the PID for Ted2Go and enter that into the example and run it a few times without doing anything in Ted2Go, and you’ll see that the value is different each time.
If you have a memory reader, you can check the address 0CC7E8E8 for Ted2Go and you’ll see that it doesn’t match with what this example shows.I’m honestly not even sure if I’m wrapping the Win32 functions correctly…
At line 27 – OpenProcess https://msdn.microsoft.com/en-us/library/windows/desktop/ms684320(v=vs.85).aspx
At line 30 – CloseHandle https://msdn.microsoft.com/en-us/library/windows/desktop/ms724211(v=vs.85).aspx
At line 33 – ReadProcessMemory https://msdn.microsoft.com/en-us/library/windows/desktop/ms680553(v=vs.85).aspxMonkey12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182#Import "<std>"#Import "<mojo>"Using std..Using mojo..#Import "<windows.h>"'===IMPORTANT CHANGE THIS TO YOUR TED2 PROCESS ID/PID===Global Ted2Id:UInt=5392'Things like Process Explorer for Windows shows you your Ted2 PID'https://cdn.portableapps.com/ProcessExplorerPortable.png'Ideally you'd want to search for a window name and get the PID that way'But I haven't figured that outGlobal MemoryAddr:=$0CC7E8E8ExternStruct HANDLEEnd'Get a HANDLE via a process IDFunction OpenProcess:HANDLE( dwDesiredAccess:UInt, bInheritHandle:Bool, dwProcessId:UInt )'Close a HANDLEFunction CloseHandle:Bool( hObject:HANDLE )'Read memory from a HANDLEFunction ReadProcessMemory:Bool( hProcess:HANDLE, lpBaseAddress:UInt Ptr, lpBuffer:Byte Ptr, nSize:Int, lpNumberOfBytesRead:Int )PublicFunction ReadMemory:Byte[]( addr:UInt, bytes:Byte )'Prepare buffer to store our bytes inLocal buff:=New Byte[bytes]'Open the process to get HANDLE'Open with PROCESS_VM_READ rightsLocal process:=OpenProcess( $0010 , False, Ted2Id )'Use HANDLE to read memoryIf Not ReadProcessMemory( process, Varptr addr, Varptr buff[0], bytes, 0 ) ThenPrint "Unable to read memory!"Endif'Close the HANDLEIf Not CloseHandle( process ) Then Print "Unable to close handle"'Return memory readReturn buffEndClass MyWindow Extends WindowMethod New( title:String="Simple mojo app",width:Int=640,height:Int=480,flags:WindowFlags=Null )Super.New( title,width,height,flags )EndMethod OnRender( canvas:Canvas ) OverrideApp.RequestRender()'Display our memory stuffLocal x:Int=8Local v:=ReadMemory( MemoryAddr, 4 )For Local i:=0 Until v.Lengthcanvas.DrawText( v[i], x, 8 )x+=canvas.Font.TextWidth( v[i] )x+=canvas.Font.TextWidth( " " )NextEndEndFunction Main()New AppInstanceNew MyWindowApp.Run()EndSpace cats! \o/
You can get some transparency by using ‘discard’ in your own material shader.
if( texture2D( m_EmissiveTexture,v_TexCoord0 ).a < 0.5 ) discard;Seen here on the vines: http://monkeycoder.co.nz/forums/topic/quake-bsp-loading/page/2/#post-9288
What I did was to use ‘discard’ in my own material shader to get transparency.
if( texture2D( m_EmissiveTexture,v_TexCoord0 ).a < 0.5 ) discard;Seen here on the vines: http://monkeycoder.co.nz/forums/topic/quake-bsp-loading/page/2/#post-9288
Very nice!
What’s the Nomicron animated and modelled in?Ah well, “New option for disabling project view file icons” is also me haha.
I’m not in the ‘About Ted2Go’ dialog either
But I’m not doing it for the credits, just editing stuff I’d like to see myself and sharing with the main repo.I noticed Hezkore in the list for the big things he did. But there are other collaborative things.
I’m not sure I understand?
I’m on a 8 core 4.5GHz processor with 16Gb RAM, using 4 SSDs in Raid 0.
It takes 15-20 seconds to compile my largest project. :/
BlitzMax compiles roughly the same thing at a few seconds.Thanks Mark!
I wouldn’t mind if it worked like it does now..
One default scene created at start and then the option to create a new scene with myScene=New Scene
SetScene( myScene ) would enable your custom scene, while SetScene( Scene.GetDefault() ) would enable the default scene.Well haha, fair enough!
Yup, MSCV works now.
I’m not sure compile times improved though…
Is there anything else I can do to improve compile times?I’ve done another pull request.
peterigz noticed that the default TextField character limit was 80, which isn’t a whole lot when it comes to IRC.I think the next thing to fix in Ted2Go is the CodeMap.
Not only is it a bit wonky, it also takes too long to render (eats CPU)
Instead of actual text letters, which is too smal to read anyways, the CodeMap should just use blocks.
It would be easier to render and hopefully lower CPU usage a bit.
Perhaps draw it into a image too and only update it when you’re scrolling or editing text.I’d also like to separate ‘Source’ and ‘Debug’, so that you get a better overview of things.
The latest pull only adds a simple Hint (using existing code in Ted2Go) so it should be very safe hehe
@cocon
I wasn’t really following any tutorials, just experimenting a bit.
But I’m sure Google will find some tutorials for you!
I personally really like the NES style of graphics, so I’ve purposely selected few colours to try and simulate the NES.
Draw out the basic shape, draw rough parts of the shading, then do some pixel dithering.I’ve never cared about version numbers, I’ve only gone with the flow on all projects I’ve joined.
But why not just 1.6, 1.7 etc.?I’d love it if it were just the date though, so like todays (in Sweden) version would be 17.8.2 (year, month, day)
It’s a version number and you get an idea of how old it is.
I’m sure there are downsides to that though heh. -
AuthorPosts