Blitz Hardwired - DX9 and DX11 Userlib (Part VI)

Community Forums/Showcase/Blitz Hardwired - DX9 and DX11 Userlib (Part VI)

Ploppy(Posted 2014) [#1]
New directx 11 release out, I have been uniquely working on dx11 for the past week and have got to a stable enough state to be able to release my first dx11 version.

PLEASE NOTE: I have renamed the dll to Hardwired.dll and the decls file to Hardwired.decls. If you still have BlitzDX9.dll and it's decls file, you WILL have to delete these old versions manually from your userlib folder. If you do not you will have a conflict between the two files and they will not function. If you just have the hardwired dll in your userlib folder, things will be fine. Don't worry, I will not rename this file anymore. But I couldn't call it blitzdx9 any more - now that it has some dx11 capabilities.

This first demo, dx11_test.bb is very basic, and will just demonstrate my first version of the dx11 renderer. Please check out and see if it works. It should, but it is a very boring demo. You should see a load of spinning cubes, that's all.

My dx11 renderer for the moment only renders primitives without lighting, shading or textures. You cannot load meshes neither. However, cameras are fully functional and so are mesh creation and manipulation functions. A new column has been added to the command list to show which functions are currently usable in the directx 11 mode. A excel version of this command list is now available below too. There are currently about 100 commands compatible with the dx11 mode, and I will be working on the others in the following weeks. The development of the dx11 side of Hardwired should on the whole be faster than the dx9 for I build the dx11 onto the dx9 existing code. Where my routines would usually call directx9 api calls, it will call the dx11 equivalent taking into account certain conversions if need be. I will obviously be including directx 11 exclusive commands little by little. These commands will be preceded by dx11 and not simply dx to differentiate them.

To enable directx11 in hardwired use the dxUseDirectX11 True before a dxGraphics3d command. dxUseDirectX11 False will of course reset it to directx 9 mode, which is the default mode when running hardwired. If the host pc does not have dx11, a dxUseDirectX11 True command will be ignored and a subsequent dxGraphics3d command will be created in dx9. Alternatively, to help a program detect dx11, the function dxDx11Present() will return true if the host system is equipped with dx11.

NEW COMMANDS
dxGetPlayRate#(video%) - New video command, retrieve the current video playback speed realtive the video's original playback speed. 1=original speed, 0.5=half speed, 2=double...
dxSetPlayRate(video%,rate#) - Set a video's speed realtive to it's original playback rate.
dxDx11Present%() - Returns true if directx11 is present on host system
dxBeginScene() - New dx9 command for a manaul rendering system, use this to begin rendering entities instead of using dxrenderworld
dxEndScene() - Use this at the end of rendering entities with dxRenderEntity
dxRenderEntity(entity%,camera%) - Manually render entities with this command
dxRenderCls(camera%) - Clear screen - use after a dxBeginScene()
dx11GetMaxFeatureLevel$() - Will return a string descibing the maximum feature level of the host machine. Although you can use dx11, you may not be able to use all of it's feature depending on your machine and gfx adapter. Directx11 will adapt to the host machine and 'emulate' a previous version of directx, limiting rendering abilities to the emulated versions capabilites.

Possible strings returned are...
Directx 11 not installed
Directx 11.0 features
Directx 10.1 features
Directx 10.0 features
Directx 9.3 features
Directx 9.2 features
Directx 9.1 features


dx11SoftwareEmulation - Set the next dxGraphics3d command to software emulation mode. This mode is very slow, but if enabled will use the processor of the host pc to emulate any directx11 feature that is unusable by the graphics card.
dx11NoSoftwareEmulation - (default setting), use this to use the default hardware setting


Four new debug modes are now available...
dxDebugSilent() - Default debug mode, if set the program will ignore errors. Can be non fatal, but also can crash the program depending on the error.
dxDebugLoud() - Will show a dialog box if hardwired encounters an error in the code. Once okay clicked by the user, the program will continue.
dxDebugHarsh() - If hardwired encounters an error, it will automatically quit the host program immediately.
dxDebugLoudAndHarsh() - If hardwired encounters an error, it will bring up a dialog box explaining the error, and the quit the host program after okay has been clicked on by user.

Please note that if you use a command/function in dx11 mode that has not be converted (see command list for dx11 ready commands) you are likely to crash the program. The dx11 command list is limited for the moment
Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here

I would very much like to know if any xp users or non-dx11 users have any problems with this new release. If I have programmed this correctly, all should still work, even the dx11 demo will run. If you do not have directx11, hardwired will switch automatically to dx9.

Personal note, my wife is likely to give birth to my son in the next few weeks, she is eight months pregnant, so it'll be soon. If things go quiet on the forum for a while that is why ;D


Ploppy(Posted 2014) [#2]
Have managed to test it on an XP machine this morning and works fine, dx11 demo automatically diverts to dx9 as expected. Good stuff...


GaryV(Posted 2014) [#3]
Congrats on the little one who is almost here.


Buff Jigsaw(Posted 2014) [#4]
"Personal note, my wife is likely to give birth to my son in the next few weeks, she is eight months pregnant, so it'll be soon. If things go quiet on the forum for a while that is why ;D "

congratulations


xlsior(Posted 2014) [#5]
If things go quiet on the forum for a while that is why ;D


See you in 2020! ;-)


Ploppy(Posted 2014) [#6]
yep that way I'll be able to work on directx 12 being a few years behind schedule as normal...


thanks for the congrats guys. I'll probably post a little announcement when it happens.


Guy Fawkes(Posted 2014) [#7]
Congratulations, Ploppy! Keep up the EXCELLENT work! :) Might I ask to render a webcam feed in real time to a texture as well as some microphone commands for live streaming via a 3D program?

Thanks once again!


Ploppy(Posted 2014) [#8]
Hi GF, webcam support is already planned. Mic support not so sure, but I like your streaming idea so I'll think on it. I have already thought of that one for chipmunk but didn't yet implement it (dx7 wasn't giving me what I needed). Streaming in 3d with funky windows would be a very good compettitor to Skype.


Guy Fawkes(Posted 2014) [#9]
I agree. However, a webcam support is not a webcam support without sound, right? NO game is good without sound / music, am I right? :P


Ploppy(Posted 2014) [#10]
Yes, but don't forget that blitz already has sound/music support. I don't know if I need to add to this...


Guy Fawkes(Posted 2014) [#11]
Yea, but also don't forget that Blitz doesn't transfer that sound / music via a stream. It only plays on the client side. It doesn't send from the server TO the client in real time in order to hear the webcam video. Same thing with the webcam video, it must be sent in real time through a server so that the other user connected to the same video via external IP can see it.


Ploppy(Posted 2014) [#12]
True enough


Guy Fawkes(Posted 2014) [#13]
So have I convinced you for the next small update? =)


Ploppy(Posted 2014) [#14]
My next update will not be that, at the moment I am woking on dx11 stuff and I plan to continue with that for a while. After that, I will go where my needs and feelings take me, but I will do webcam stuff at one moment or other.

New update out...

dxLoadtexture, dxEntityTexture (kind of) now works with dx11, I haven't completely finished the code (+ shader code this time- now programming in 2 languges, interweaving all this is big fun with a capital 'F'), but the dx11test will give you an idea of where I am tonight...

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


Hotshot2005(Posted 2014) [#15]
plugin? How do I check the samples?


Ploppy(Posted 2014) [#16]
Sorry, I don't know what you mean. To install the userlib copy the hardwired.dll and .decls files to your userlibs folder. You can then use the userlib in blitz and run the samples in the release folder.


Hotshot2005(Posted 2014) [#17]
OK I have done that and I checked Dx11_test.bb but i get the error saying

function 'dxdebugloudandharsh' not found


Guy Fawkes(Posted 2014) [#18]
Comment that out, @Hotshot. That's a debug function that's most likely no longer in the DLL itself.


Hotshot2005(Posted 2014) [#19]
It is alright now as I got DX_11 test working :-D

Average FPS 1492 Whoa!


10,000 Cubes = 19 FPS
5,000 Cubes = 64FPS


Ploppy(Posted 2014) [#20]
dxdebugloudandharsh is still in the dll and it should work. Have you copied both files?


Hotshot2005(Posted 2014) [#21]
yeah it does work and well done


Rick Nasher(Posted 2014) [#22]
Those are whooping figures. Makes me wonder what GPU's are giving such results. Me on my laptop with a simple NVIDIA Geforce 8400M GS from 2007 giving me 144FPS on the default 100 cubes. Which is fine by me given the specs.

Of course also congratulations from me Ploppy, looks like you are giving birth to 2 babies at once. ;-)


Hotshot2005(Posted 2014) [#23]
Mine is

ATI 5870 (Laptop) :)

I will be upgrading 64bit Windows soon :)


JBR(Posted 2014) [#24]
Problem here.

I'm getting an MAV when creating the 7th cube. (debug a=7).

removing (dxUseDirectX11 True) and it works fine.

dxUseDirectX11 False works fine.

Jim

Should say Windows 8, dx11, Laptop, GTX 765M.
FPS = 2548


JBR(Posted 2014) [#25]
If I only have 6 cubes then it works, but fails to print the fps.


Panno(Posted 2014) [#26]
i am speechless.


LittleDave(Posted 2014) [#27]
Hi ploppy
In your dx11 test you have dxTrisRendered(),is it meant to display something because i do not see anything.

Congrats on the buby.Get in as much time with your project,once baby`s born you won`t have time for anything.:)


Ploppy(Posted 2014) [#28]
No for the moment it doesn't do anything. At one moment the end window showed the trisrendered stored variable but I took that out.

Jbr, where does the demo bug out? On the dxCreateCube command or later on in the code??


Taron(Posted 2014) [#29]
Uh, Ploppy becomes a daddy?! Congrats! Programming and permanent distractions...I hope you can consider the programming a distraction for a while! ;o)


Ploppy(Posted 2014) [#30]
This'll be my third child(and final), first son though - so I know the drill quite well by now. Been a few years now since last changed nappies (youngest daughter now 5yrs old); so will have to get back into the old routine.

I will find time for hardwired, it's turning out to be a worthwhile project.


JBR(Posted 2014) [#31]
Ploppy, yes on the dxCreateCube.


Ploppy(Posted 2014) [#32]
New update, I have improved the dx11 side of things with the following features...

Entity colours will now render
Alphas too, transparency now possible
Blend mode now render too
DxMeshload will work for b3d and 3ds (bit buggy for the moment though, see test10_dx11.bb)

Probably about half of the hardwired command list now works with dx11

Command list has also been updated to indicate present dx11 compatible commands, updated dx11_test.bb

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


Ploppy(Posted 2014) [#33]
New update - some bug fixes made. DxMeshLoad should be nice and stable now (no .x mesh loading for the moment though).

Maze demo and test10.bb now work in dx11 mode (yay!).

Still no lighting for the moment, so all triangles will be rendered in full bright mode in dx11. Am working on the pixel shader to bring in all the functions (and eventually more) that dx9 possesses.

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here

Jbr I think that the dxCreateCube bug should be gone, or at least I hope so. Please let me know... cheers...


JBR(Posted 2014) [#34]
Ploppy

dx11_test
-----------
works perfectly with (dxUseDirectX11 False)
works perfectly with (dxUseDirectX11 True) but no fps at the end

maze
------
dx9 works perfectly
dx11 does not display fps during or fps average at end

test10
-------
dx9 works perfectly, displaying fps & lights
dx11 works perfectly but does not display fps & lights
when you press Escape BOTH say (blitzcc.exe has stopped working)

------------
Seems your 3d stuff is working but maybe a problem with dxText or buffers somewhere.

Keep going, Jim.


Panno(Posted 2014) [#35]
works great , also on vista


Ploppy(Posted 2014) [#36]
Ok, there was a little snag with the autoclose routine - corrected, and new version here... Should work fine with test10 demo now...

dxTest hasn't yet been implemented into dx11 version, lighting neither - but it'll come... ;D

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


Hotshot2005(Posted 2014) [#37]
how do you Bump mapping? it is for Dx11 only or it is you can do both?

It work great by the way!


Ploppy(Posted 2014) [#38]
Bump mapping and normal mapping are calulated using vertex and pixel shaders that take a normal map and light information as thier input. I haven't quite got that far, but probably close...

Working on multitexturing now. Not finished yet, but gives you an idea (see dx11_test.bb)...

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


JBR(Posted 2014) [#39]
Ploppy

dx11_test
-----------
works perfectly with (dxUseDirectX11 False)
works perfectly with (dxUseDirectX11 True) but no fps at the end

SAME

maze
------
dx9 works perfectly
dx11 does not display fps during or fps average at end

NOW dx11 does not display anything

test10
-------
dx9 works perfectly, displaying fps & lights
dx11 works perfectly but does not display fps & lights
when you press Escape BOTH say (blitzcc.exe has stopped working)

NOW dx11 does not display anything but both exit correctly.


Ploppy(Posted 2014) [#40]
Hi Jbr, the dx11 side of things will not display any text at the moment, for I haven't yet written the text routines. So any dxText command will be ignored by my userlib for the moment.


JBR(Posted 2014) [#41]
Yes, I understand. maze and test10 just have black screens now and they were working under dx11.


Ploppy(Posted 2014) [#42]
Oh yes, I see what you mean. Thanks, I'll get that corrected tomorrow - for the time being, I'll revert to the previous version - should work (no multitextures though)...

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


Ploppy(Posted 2014) [#43]
I found the time to get this problem sorted out - multitexturing is now back on - all should display like before. Thanks for your help JBR, much appreciated...

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


JBR(Posted 2014) [#44]
Hi Ploppy, working again.

The only thing which is strange is that when using dx11 the code below does not print the average frames per second at the end of your code.

dxEndGraphics
Print
Print "Fps average:"+fpsav

Bit strange as we're back to the normal blitz code.
Works in dx9 mode.


Iamhere(Posted 2014) [#45]
Works in both modes for me
DX9 mode is around 20% faster.


Ploppy(Posted 2014) [#46]
this is because my shaders are not yet optimised and the texture samplers have a higher setting in dx11 mode. It will all come together though...


Ploppy(Posted 2014) [#47]
New dx11 update, shaders have been bug fixed (samplers were working a bit too much!!), so working faster now. dxScale/Rotate/PositionTexture now works with renderer.

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


Iamhere(Posted 2014) [#48]
In Maze the texture on floor and ceiling now is visible. The Maze Map in DX11 mode is not visible.
Speed is now nearly the same, sometimes DX9 sometimes DX11 faster.


Hotshot2005(Posted 2014) [#49]
DX11 should be faster than DX9!

DX11 had more effect than DX 9 from what I know :)


Buff Jigsaw(Posted 2014) [#50]
Geforce GTX 670 1920x1080

maze demo dx9 2580 average fps

Everything looks good. Player map icon sphere is not visible.Video card making a sound I havent heard before. Mouse inputs seems choppy, maybe due to huge fps? (if I recall quake 2 had a control issue that surfaced when your fps were much too high)

maze demo dx11 790 average fps

Everything is full bright, there is no dynamic lighting and the in game fps counter is not showing. Map not visible but player map icon sphere is visible.

edit: tested it a few more times. Mouse input definitely breaks down when the fps is above 2000 fps (this happens in dx9. dx11 doesn't reach those frame rates so I am not sure if it would happen under dx11). In any case this may be irrelevant but I will report it nonetheless.


Yue(Posted 2014) [#51]
Hello, I'm trying to run maze.exe, and I die that lib not found. I'm working on a laptop, with directX 11 and Windows 7.

Greetings.


Ploppy(Posted 2014) [#52]
hi yue, this is quite simply because I didn't recompile this exe since I changed the dll filename. simply recompile the bb code and it should work fine....


Rick Nasher(Posted 2014) [#53]
-Maze test on NVIDIA GeForce 8400M GS-
DX 9: ~120 FPS
DX11: ~ 70 FPS
(sampled multiple times)

But.. don't know if that's actually supposed to be like that, cos it does have quite a bit more stuff in the engine right?
Should DX11 be faster or are the new features really what's making it better?
Also: perhaps depending on the videocard?


MadJack(Posted 2014) [#54]
Fixed pipeline (DX9) vs fixed pipeline replicated via shaders (DX11)?


Ploppy(Posted 2014) [#55]
This is of course completely done by shaders, replacing the ffp present in dx9. My shaders are not yet optimised, I'm playing with code quite a lot, but I do not expect to get the same kind of results as with dx9. 'What's the use of dx11 if I can't get better results?', you may ask. Dx11 has certain abilities nonetheless that older version do not have, such as HLSL version 5 and tesselation/hull shaders. Give me some time with dx11, there is quite a lot to do research wize and I have some optimization to perform on my code.


MadJack(Posted 2014) [#56]
Ploppy

Your little project is getting more and more interesting.

Are there any plans for the extra internal things a 3d engine typically does, such as batching, occlusion, automatic LOD?


Ploppy(Posted 2014) [#57]
Possibly, it depends on how far I get with the rest of it. There's still a lot of hard evil maths and bug hunting to come. Still, I'm up for the challenge, just hope it's worth it in the long run. Cross fingers...


Rick Nasher(Posted 2014) [#58]
Hopes are high as the Everest, fingers are glued tightly together with superglue.. ;-) Can imagine you don't have too much time though given the family expansion. I myself am on and off the horsey too due to work, health, family stuff and multiple projects. Time is a costly commodity.

BTW: don't forget to let us know when the new life enters this odd foreign world so we can congratulate you and your family.


Ploppy(Posted 2014) [#59]
Hi there, been a while. Have let the dx11 side go for a while, will get back to it later.

I have since the last week been working on mesh skinning routines, and have my first raw version out. Try out test10b.bb to see progress made, which will show and animate a walking mesh. For the moment, only .x animated meshes wil load, and there is no animation control as such, this I will shortly work in, along with b3d anim mesh loading. So this release is mainly just to show I'm going in the right direction, but the routines are not yet exploitable. Watch this space... Animated .x mesh borrowed from the directx sdk, by the way....

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here

Oh yeah, lighting works in dx11 mode now, and so does the second texture coordinate set in the renderer.


JBR(Posted 2014) [#60]
Man walking about 2000fps on 765M.


Ploppy(Posted 2014) [#61]
New update, animation update now been move to dxUpdateWorld function, where it belongs. Anim speed is now constant and smooth on all machines.

New commands...
dxAnimate(entity%,mode%,speed#,sequence%,transition#) - control an animated entity's characteristics
dxSetAnimTime(entity%,time#,anim_sequence%) - set an entity's animation time
dxAnimTime#(entity%) - get an entity's animation time
dxAnimating%(entity%) - returns true if entity is currently animating

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


Rick Nasher(Posted 2014) [#62]
Nice. ~325fps on my system. Really getting it all together.


Ploppy(Posted 2014) [#63]
New release out this morning. Bit of a special one this for it doesn't compile with blitz and may have bugs - yet to be seen. Yes, son of ploppy Jason Pierre (is half french) is released to the world. All is well with baby and mother. One happy daddy.

Will still work on other creation - but I'll take a little break from Hardwired. But no way I am giving up on HW for I see great potential.

later....


feeble1(Posted 2014) [#64]
That's great news. I look forward to seeing Ploppy Jr working on Hardwired for Dx 16!

Enjoy your progeny, blitz will still be here when you look for it.


Rick Nasher(Posted 2014) [#65]
My congratulations with the newly born baby to Ploppy and fam! May your lives be long, happy, wonderful and prosperous.

(oops, just sounding bit too Spock-like there)

[edit: next pic didn't work apparently, so cut it]

We'll be waiting patiently for your return Ploppy, enjoy the good times.(and of course no more sleep for you Papa) ;-)


Why0Why(Posted 2014) [#66]
Congrats!


K(Posted 2014) [#67]
May their lives be long, happy, wonderful and phosphorus.


I hope their lives are calcium and potassium.
Hee-hee.
Congrats Ploppy.


Rick Nasher(Posted 2014) [#68]
LOL don't you just hate auto spelling fixes.. :-) Thanks K.


OldNESJunkie(Posted 2014) [#69]
Congratulations Ploppy!!!

Best wishes to you and yours, hope this finds you well.


Buff Jigsaw(Posted 2014) [#70]
Congratulations !


col(Posted 2014) [#71]
Congratulations!


Steve Elliott(Posted 2014) [#72]
Congrats on young ploppy :)


Panno(Posted 2014) [#73]
congratulation !


Ploppy(Posted 2014) [#74]
Thanks everyone. Little one is back home and all is well. Nice and quiet child too at least for the moment - hope that continues but we'll see.

Should get some time for hardwired as of next week...


Hardcoal(Posted 2014) [#75]
Congrads ploppy.


rickychus(Posted 2014) [#76]
Hi,
So long time Ploppy!
Congratulations on the arrival of your son. Bonaventure everything you come!
As always great job!, I visit them from time to time to see how everything goes!
Keep it up friend.
See you later. -


Panno(Posted 2014) [#77]
ähm.. Mark release the source from blitz+ .......

I smell a blitz+hardwired thingy !!..


Ploppy(Posted 2014) [#78]
Hi everyone, just to let you know that hardwired is not dead at all. Although nothing has been released for a good few weeks (almost a month I believe), I have been working on it. It's just I didn't have anything worth releasing.

Over these past few weeks, when I have had the chance I have yet again been bringing together dx9 and dx11 by creating my own fixed function pipeline in my c++ code. A lot of work and code arrangement but will be rewarding for me in the long run (am naming my fake function pipeline - this will be very useful if I ever release an sdk for this dll, for you will effectivly be able to use dx11 using the dx9 syntax - an emulation so to speak).

Much bug hunting done too, cube mapping should work better now (test6.bb).

Here are some new commands...

dxCountBones%(entity%) Will return the number of bones in an animated mesh (see test10b.bb for an example)
dxGetBoneName$(entity%,bone%) Returns a bone's name
dxGetBoneX#(entity%,bone%,global%) Returns a bone's x position in space
dxGetBoneY#(entity%,bone%,global%) Returns a bone's y position in space
dxGetBoneZ#(entity%,bone%,global%) Returns a bone's z position in space
dxGetBonePitch#(entity%,bone%,global%) Returns a bone's pitch
dxGetBoneYaw#(entity%,bone%,global%) Returns a bone's yaw
dxGetBoneRoll#(entity%,bone%,global%) Returns a bone's roll
dxMoveBone(entity%,bone%,x#,y#,z#) Moves a bone by x,y,z

Will go into more detail about bones later. These commands are just the tip of the iceberg, for I am planning on FULL bone manipulation, so you have full control of character animation and will even have the ability to add/delete bones to/from meshes. I am still working on skinned meshes. As you can see in test10c.bb I haven't quite got it right yet with .b3d files, but I'm not far. Funny result nonetheless but temporary of course...

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


RemiD(Posted 2014) [#79]
Hello Ploppy,

Good work so far :)

The possibility to create joints (bones) and to set the influences of some joints over some vertices (so that it is a skinned mesh) would be really useful.

Also the possibility to retrieve the exact position of a vertex after it has been repositionned after a joint influencing it has been turned/moved would be really useful to make shadow volumes and then stencil shadows.

If you need a rigged skinned animated mesh to do some tests, let me know, i can make a basic one for you (with influences 1.0 and 0.5)

Good luck for the next steps !


Ploppy(Posted 2014) [#80]
Hi RemiD,
yes, that could be useful thanks. i have pretty much sorted out in my head how I'm going to attack the vertex weights commands, and will include some commands to return the vertices' new position/rotation. However, for the moment, I'm still a little blurry about hierarchy. I think my routines are correct, but I need to verify. So if you can give me a little info on the mesh's hierarchy, that would be very helpful too.

Cheers


RemiD(Posted 2014) [#81]
I don't know exactly what you mean by "mesh hierarchy".

For rigged skinned animated meshes :
The "skeleton" is made of several joints (=bones), usually a root joint positioned at the origine of the mesh. This is the parent of all others joints.
Each joint is usually a child of another joint, so that when creating an animation, if a parent joint is turned/moved, the childs joints are turned/moved too.
Each joint can have influences over some vertices.
The influence can be between 0.0 and 1.0 (=between 0% and 100%)
Several joints can influence the same vertex.
Usually most of the vertices will be influenced by only one joint (100%) and some of the vertices around joints will be influenced by 2 joints (50% and 50%) so that when the joint is turned, the vertices move progressively and it looks like a skin (instead of a sharp angle)

I will make a low tris mesh in the evening so that you can do some tests.


RemiD(Posted 2014) [#82]
Here is a simple rigged skinned animated mesh (.ugh + .b3d) and a .bb file to see it.
https://onedrive.live.com/redir?resid=DBA15DD711CC8F22!134&authkey=!ACXlPag8MCl_Z_s&ithint=file%2c.7z

You can use Fragmotion to open the .ugh file if you want to take a look at the joints, the vertices, the influences of some joints over some vertices, the animation frames

On this mesh, you can see 2 types of skinning :
->one skinning where each vertex is influenced only by one joint (at 100%)
->one skinning where each vertex is influenced by one or two joints (at 100% or 50%)
The second method is what allows a progressive deformation of a body part near a joint without looking ugly. (or at least less ugly)


Ploppy(Posted 2014) [#83]
Thanks for that RemiD, it will come in handy.

Just a little update today, as for the last few days I have been reinstalling my pc after windows went all whacky...

Still working of skinned meshes for the moment. Have added the following...

dxTurnBone(entity%,bone%,pitch#,yaw#,roll#) - Will turn a given bone by pitch/yaw/roll
dxGetBoneParent%(entity%,bone%) - Returns the index of a bone's parent, 0 if bone has no parent
dxGetRootBone%(entity%,bone%) - Returns the index of a bone's root bone in mesh's family tree
dxCountBoneChildren%(entity%,bone%) - Return's number of a bone's immediate children
dxGetBoneChild%(entity%,bone%,child%) - Return index of a bone's child
dxCountBoneSiblings%(entity%,bone%) - Return number (not including given bone) of a bone's siblings
dxGetBoneSibling%(entity%,bone%,sibling_index%) - Return bone number to a bone's sibling

Check out test10b.bb to see example

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


Kryzon(Posted 2014) [#84]
My suggestion would be for you to expose the bones as entities (corresponding to pivots), so instead of dxTurnBone and these new commands, you can use dxTurnEntity, dxEntityParent, dxCountChildren, dxGetChild etc.
In the case of dxGetRootBone, you could make it as dxGetRootEntity so it can be used not only with bones but any hierarchy of entities to return the only entity in the hierarchy that does not have a parent (the root entity).

It's less commands to memorise. I imagine that bones in your engine inherit from the 'entity' class, so naturally all the entity commands should work on them.


Ploppy(Posted 2014) [#85]
Good idea, I will see if it is doable, as to make it work I will have to effectivly assign a handle to each bone. For the moment with my existing commands, you can access bones using their index number, accessing the raw data directly rather than referencing the data. But I do like the idea of keeping it simple. For the moment, whilst constructing my command list, I will however keep them apart so as to differenciate bones from their parent entities/surfaces (makes it easier for me).

New commands available...
dxScaleBone(entity%,bone%,scale_x#,scale_y#,scale_z#,global%) - Will scale a bone to x,y,z
dxScaleX#(entity%,bone%,global%) - Return bone's x position
dxScaleY#(entity%,bone%,global%) - Return bone's y position
dxScaleZ#(entity%,bone%,global%) - Return bone's z position
dxCountBoneInfluences%(entity%,bone%) - Return the number of influeces for a bone
dxGetBoneInfluenceVertex%(entity%,bone%,influence%) - Return the vertex number for a bone influence
dxGetBoneInfluenceSurface%(entity%,bone%,influence%) - Return the surface number for a bone influence
dxGetBoneInfluenceWeight#(entity%,bone%,influence%) - Return the vertex weight for a bone influence
dxFindBone%(entity%,name$) - Return the bone number of a given name or 0 if not found
dxRenameBone%(entity%,bone%,name$) - Rename a bone to given name, will return true if successful or false if not. Will not accept a name that is already in use by another bone in the entity.

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


RemiD(Posted 2014) [#86]
[not important]
I wonder why everyone call the "joints" the "bones"...
[/not important]


Ploppy(Posted 2014) [#87]
true enough. i guess it's easier to associate oneself with bones than with joints. but you're right - joints, being points should be the correct term really.


Rick Nasher(Posted 2014) [#88]
Found a few spare minutes and how did I spend them? Yep: on testing the latest update of Hardwired.. LOL. Interesting as ever of course, but I am afraid to say that examples 10b and 10c do not run anymore with the latest update.


Ploppy(Posted 2014) [#89]
just those two? any error messages?


Rick Nasher(Posted 2014) [#90]
Yup, well only checked the latest to be honest:

Example 10: all fine.
Example 10b: Function 'dxrenamebone' not found
Example 10c: Function 'dxgetbonename' not found

Reverted to previous version and examples: all fine.


Ploppy(Posted 2014) [#91]
ok, sorry about that. must have 4gotten a little somthing. will release again tomorrow...


Rick Nasher(Posted 2014) [#92]
no problem ;-)


Ploppy(Posted 2014) [#93]
Ok, done - should be fine now...

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


Rick Nasher(Posted 2014) [#94]
Hehehe all good now. Love the effects, kinda reminds me of creature from "The Thing" by John Carpenter :-)

Can you hear it hissing?


Ploppy(Posted 2014) [#95]
New stuff....

dxCountVertexInfluences%(surface%,vertex%) - Will return the number of bones that influence the given vertex
dxGetVertexInfluenceBone%(surface%,vertex%,influence_index%) - Returns the bone inflencing a given vertex
dxGetVertexInfluenceWeight#(surface%,vertex%,influence_index%) - Returns the 'weight' of a bone's influence on given vertex
dxSetBoneInfluenceWeight(entity%,bone%,influence_index%,weight#) - Sets the infulence weight on a bone's index
dxFreeBoneInfluence(entity%,bone%,influence_index%) - Does what it describes
dxBoneParent(entity%,bone%,parent_bone%) - Change a bone's parent bone - 0 for no parent....

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


Guy Fawkes(Posted 2014) [#96]
OMG! I LOVE HARDWIRED! :D GREAT JOB, PLOPPY! =D Is there a way you can add 3 things: Send / receive web cam / microphone data. Render video to texture, & live webstream to an HTML page? I would bow down to you if you did that for me in the next update! :) Thanks alot, and keep up this WONDERFUL plugin! :D


Ploppy(Posted 2014) [#97]
In the next update?? All that?? You're not asking much!

This all takes time, I am planning a lot of what you are suggesting, but don't expect it to come right away....

Glad you like it anyway, but I've still got a hell of a way to go....


RemiD(Posted 2014) [#98]
I can't try your last demo because my anti malwares app detect a malware in your .dll.

See :
https://onedrive.live.com/redir?resid=DBA15DD711CC8F22!135&authkey=!ALtVssqIG_jf1vA&v=3&ithint=photo%2c.jpg


Ploppy(Posted 2014) [#99]
Hi RemiD,
I have avast installed on my system and it reads clean for me. May I suggest it's your malwares app that confused hardwired with malware....


RemiD(Posted 2014) [#100]
I had no problem with the previous releases...
I will send the .dll to Malware bytes and ask them to take a look.


Rick Nasher(Posted 2014) [#101]
Avast here too: it's not even blinking..


Ploppy(Posted 2014) [#102]
I do see what you mean though Remi...

https://www.virustotal.com/en/file/bbc686d1ca414d8cfa4822cd7a992e94b3e20c87da8618a5d6c5f589d1bbbc9a/analysis/1400693187/

It does indeed light up on malware bytes. It does make me a little afraid that something got through. But on the other hand, malwarebytes was the only one out of 53 to detect anything. It may be that mwb is confusing my dll with a malware. In the doubt I will tell avast to give my hard drive a complete scan when I go to bed, just in case... you never know.


RemiD(Posted 2014) [#103]
Ploppy>>I have contacted Malware Bytes support, i will keep you informed about what they say.


Banshee(Posted 2014) [#104]
I had a play with this last night and the performance is blistering, seriously well done.

I'm not overly fond of B3D because of the lack of OO and absence of things like class reflection but an engine such as this would be enough to bring me back to it!

But I note the way the shaders are constructed, it does not appear possible to edit the full shader: Only fragment or vertice shaders. Is it possible to modify the technique too? (I am looking for a new engine for my project and it uses a lot of shell shaders).


Ploppy(Posted 2014) [#105]
Hi Banshee,
Really glad you like what I have done so far with this. Of course, I still have a lot left to do. As for shaders, like with many parts of hardwired, I have only just begun with the coverage. I kind of work a little part of it, and if I get too stuck or frustrated with it I leave it alone, work on another part, and then come back to it later. So I have a lot of loose ends in my code, but I will tie them up eventually. Working on quite a few modules at the same time helps me too somtimes to bind it all together - I have to of course assure compatibility between modules. If I get the dx11 part sorted out too, I will work on hull and tesselation shaders too.

My dll is equally compatible with blitzplus, and I imagine blitzmax - although I wouldn't know how to adapt it.


Ploppy(Posted 2014) [#106]
Some new stuff..

dxCountCaptureDevices%() - Returns the number of capture devices (i.e webcam) connected to host system
dxCaptureName$(capture_device_number%) - Returns the name of given device number
dxOpenCaptureDevice%(capture_device_number%) - Opens a device preparing it for streaming
dxCaptureWidth%(capture_device_number%) - Returns width of image returned by capture device
dxCaptureHeight%(capture_device_number%) - Returns height of image returned by capture device
dxUpnpSearch() - Start system search for any upnp hosts connected to host system's network
dxUpnpSearchDone%() - Returns true if system has finished seaching for upnp hosts
dxUpnpCount%() - Return present number of upnp hosts found, can be called during or after a search
dxUpnpName$(device_index%) - Return name of a given upnp host...

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here

See capture.bb and upnp_test.bb for example...


Guy Fawkes(Posted 2014) [#107]
Ploppy, I love you! =D Is that what I think it is?! WEBCAM STREAMING?! :D


Ploppy(Posted 2014) [#108]
Not yet, but it's going that way. I have only started on the basics for the moment, the easiest part....


Guy Fawkes(Posted 2014) [#109]
:D Can't WAIT to try your next update! Keep up the great work, Ploppy! =D


BlitzSupport(Posted 2014) [#110]
I've done a quick BlitzMax include-file creator (that is, a .bb program that outputs a .bmx include file) -- download below, along with a quick conversion of dxEntityBlend (the only example I could get to run properly in the original .bb version!):

http://www.hi-toro.com/blitz/hwbmx.zip [Place the contents into the main HW folder.]

@Ploppy: If you want to, you can run bmxer.bb in your release folder prior to uploading each new version, and it'll add an updated hardwiredlib.bmx automatically -- it just reads the .decls file and spits out a .bmx include file. If not, people can just download it from here anyway.

To use it with BlitzMax, you just add Include "hardwiredlib.bmx" at the top of your BMX code.

It did spot some apparent errors, too -- in Debug mode the BMX include file will list any functions that weren't found in the DLL:


Missing functions:

dxPixelShaderVersion
dxVertexShaderVersion
dxWindowHeight
dSetAudioTrack
dGetSubtitleDescription
dSetSubtitle
dGetPlayRate
dSetPlayRate
dxScaleBone
dScaleX
dScaleY
dScaleZ



(Those are the in-DLL names it's listing, BTW.)

Some seem to be missing, while others are defined incorrectly in the .decls. Here are two examples -- haven't looked through them all!

dxPixelShaderVersion%():"dxPixelShaderVersion"
dxVertexShaderVersion%():"dxVertexShaderVersion"


After the colon, "dxPixelShaderVersion" should be "dPixelShaderVersion". As far as dVertexShaderVersion/dxVertexShaderVersion goes, it doesn't seem to exist on quickly looking through the DLL in the Dependency Walker tool.

Lastly, does dPrint work? I tried using it and it crashes in both BB and BMX. (There's a commented-out attempt to use it just before dxFlip in my conversion, in the zip file.)

Anyway, here are the .bb and .bmx versions running together!


Guy Fawkes(Posted 2014) [#111]
SWEEEEEEEEEEEEEEEEEEEEEEEET! (Not spamming, just SO excited!) :D


Prime_8(Posted 2014) [#112]
very cool , enough to make me think about using Blitz again .

testing with Blitz Plus I hit a couple samples that say too many or not enough parameters , depending on the sample.
but looking at BlitzSupport's post could just be a decls issue .

would be cool if i could link to the dll from a MinGW c++ app.


~ NM the not enough parameters , seems Print required to be Print "" , then seems ok , im re testing now .

all work now , any that complain of toomany parameters were fixed by :
;dxGraphics3D 1024,768,32,1,1 ; change to .
dxGraphics3D 1024,768,32,1 ;,1


Xilvan(Posted 2014) [#113]
Hi everyone,

I'll try it soon... Just finishing
my current project in Blitz3D
DirectX 7.1.

And Congratulation Ploppy!

Friendly,
Alex,
Xilvan Design


Ploppy(Posted 2014) [#114]
Blitzsupport, thanks very much for your Blitz Support. Great stuff - indeed there were a few declaration errors in the decls file. I have now corrected them....

dxPixelShaderVersion - corrected
dxVertexShaderVersion - corrected
dxWindowHeight - corrected
dSetAudioTrack - should be dxVidSetAudioTrack
dGetSubtitleDescription - should be dxVidGetSubtitleDescription
dSetSubtitle - should be dxVidSetSubtitle
dGetPlayRate - should be dxVidGetPlayRate
dSetPlayRate - should be dxVidSetPlayRate
dxScaleBone - corrected
dScaleX - should be dxBoneScaleX
dScaleY - should be dxBoneScaleY
dScaleZ - should be dxBoneScaleZ

I have a bit of trouble perfecting my render to front buffer routines. It's a tricky business with dx9, as it it will not permit you to access it directly. This is why for the moment dxPrint is buggy. I will sort that out. For the moment, to be safe I have disabled it.

I have included your blitzmax conversion utility, I have placed these files in a folder 'blitzmax'

Again, thanks :)


Steve Elliott(Posted 2014) [#115]

very cool , enough to make me think about using Blitz again.



Prime 8 from Nuclear?


Rick Nasher(Posted 2014) [#116]
Looks like this will be the unifying engine for all the Blitz versions out there(except of course Monkey) which is tremendous.


Guy Fawkes(Posted 2014) [#117]
Yup! =D Any status updates for us, @Ploppy?


RifRaf(Posted 2014) [#118]
WOW Ploppy. Nice work! thanks for sharing this with everyone. What B3D wrapped commands are lacking.. looked pretty full to me


Ploppy(Posted 2014) [#119]
Hi Rifraf,
This part is probably about 80-90% complete. I still have skinned animated meshes to finish off, collision commands too. I also have my front buffer routines to perfect and some image manip stuff along with a few lighting perfections to be done on the renderer (specular and bump mapping don't correctly work for the moment). I may include the bsp and md2 routines too if it's not too time consuming, along with the plane and mirror entites. Other than that, I think b3d's command set will be pretty much covered...

I am of course extending upon this command set with many new features such as full shader coverage, video, webcam, instancing, shadows, uPnp, bone manipulation, particle systems, progressive meshes and some net stuff too. Bind this with the fact that I'm in the process of creating routines for dx11 usage as well as dx9, and that if I get my hands on a 64-bit machine I'll release a 64-bit version too. I am also checking out Physx, so I may integrate that too. So all in all, I feel I am still quite far from finished. Bit daunting really.... bitten off more than I can chew??? Perhaps... If anyone wishes to give me a virtual hug for moral support I could sure use it...

Just a thought for anyone out there, since Mark Sibly has recently released blitzplus's source code recently, has anyone thought of doing a 64-bit conversion?? That'd be pretty a good thing to do for this day and age, would all help to give blitz the good face-lift it deserves. I still think blitzplus as much as b3d are still both very solid today and to enable them to make the most of memory requirements of today would be greatly beneficial to thier longevity and power.


RifRaf(Posted 2014) [#120]
very very nice.. I think once you get those in you have bb3d v2 that everyone wanted.. FANTASTIC! got a donation site up yet? ill send you an 85.00 donation (what i paid for b3d i think)

Have you tried direct converting any of the B3D samples to see if they have 1/1 result. I remember starting with xors and while many commands were there they just didnt behave right.


Guy Fawkes(Posted 2014) [#121]
Hi Ploppy! :) Any news on the webcam commands? Thanks alot! :D


Ploppy(Posted 2014) [#122]
@RifRaf - Wow that is faith indeed. Thanks very much for the offer of a donation, it is very flattering to think you have faith in my abilities. I do not have a donate button, but I will perhaps install one on my site. I can't hurt, on the contrary, it is a very nice motivation. I guess I haven't put in a donation button up to now because I never thought I would get THIS far. Thing is now that I have already come so far that with each new progression it is harder to give up. I cannot let go a project I have already invested so much time in. And the feedback I'm getting on the forum is on the whole very positive; which was unexpected at first as my original goal was to create this dll to further another project I was working on which wasn't giving me what I wanted using dx7.

@Guy Fawkes - I'm not working on the webcam commands for the moment, I like to jump between modules and for the moment I'm back on skinned meshes, b3d animated meshes in particular. Almost done that bit too, got animation working now, just have to correct a few matrix calcs and it should be clean. I'll get back to the webcam stuff, I haven't abandoned it at all.


Ploppy(Posted 2014) [#123]
In fact, if you like have a look for yourself for my progress with skinned meshes, I have uploaded this work in progress to show the way my code is progressing. As you can see in test10c.bb I am almost there. Animations are working but I have a little scaling problem. So, almost done there. Still, I find this new render much less intimidating than the original dwarf...! I mean it's quite understandable he's so grumpy, watch out for your ankles though, that axe could do some serious damage ;D

I am almost tempted to keep it this way because it makes me laugh - but no, the calcs are not quite there yet so I will correct.



A few new commands as well, dxSetAnimKey and dxAddAnimSeq. See simple_animation.bb for an example....

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


Guy Fawkes(Posted 2014) [#124]
OMG! AHAHAHAHAHAHAHAHA! XD


Rick Nasher(Posted 2014) [#125]
Now that's what I call a dwarf. :-)
Put up the donate button right next to the download button.
Even though I'm pretty poor I would still donate a few bucks to support the good cause and I believe most of us here would gladly do so too, cos you are making the dream come through. Please allow us to buy you a beer or something, or for your kid, wife or anything.

Btw: haven't given up on the bit of simplanetary coding.. but I've seen one that was sooo much better(intimidating) and so am trying to extend it into that(in Hardwired). And I'm of course running too many 'projects' at same time also, but still a trusty follower here.


Guy Fawkes(Posted 2014) [#126]
^ What he said :)


Guy Fawkes(Posted 2014) [#127]
How you getting on with Hardwired, Ploppy? :)


Ploppy(Posted 2014) [#128]
To be honest, not great for the moment. I am still stuck on perfecting the skinned animated meshes. It's taking me some time, but if I don't get it perfect there's no point in doing it. This is all I'm conentrating on for the moment, as it very frustrating to know that this little bone scaling problem is all that's holding me back; I'd like to get that done and then move on. Once these foundation routines are solid and running the rest should follow much easier. I think that, up until now, skinned meshes have been my hardest challenge. There's a lot that goes into them, bones, offsets, transformations, anim keys, frames and heirarchy. It's all got to gel together a certain way, the problem is that the microsoft docs are so brief at times that you just have to find out how to use dx yourself sometimes by trial and error. This all takes time. Patience! I'll get there with a bit of perseverence...


Guy Fawkes(Posted 2014) [#129]
You go, Ploppy! =D


TFT (der Falke)(Posted 2014) [#130]
nice work ......


Guy Fawkes(Posted 2014) [#131]
Hi Ploppy! :) Any updates?

Thank You!


Ploppy(Posted 2014) [#132]
If there were you'd see 'em


Wolf1870(Posted 2014) [#133]
A little note from me: Ploppy, maybe you should edit first the general basic commands of Blitz3D to Hardwired, and begin not everything that leads to confusion.
And if the program is running then, you can still insert shadows, video, webcam and other. Take the time that you need!
I'm afraid if you keep this up, it will be the same chaos as another language that I've tested... As I said, this is my opinion!

Wish you every success in your work and all the best for your family!


Ploppy(Posted 2014) [#134]
Hi Wolf, I do know what you are saying and I kind of agree. I do not want this to become a tangle I cannot get out of either. I like to keep my programming as structured as I can the whole time as a self-help. This is that I build on it quite a lot in a way that one module has a ripple-effect on other modules - so I have to sometimes modify code in other modules to make way for new/improved tecniches. Much like most programmers, I would guess.

I am not confused in all this code, I am just bringing it together, and this takes time. If you don't hear from me, it doesn't mean for a second that I'm not working. For the moment, for example I am working anew on hardwired's core - which is the renderer. I am trying to bring together and optimise the fixed function pipeline which is resident in dx9 with my shader code which is used in dx11 mode(ffp does not exist in dx11), and at the same time with the possibility of using these same shaders in dx9. My wish is that all three render methods use the same code. It'll become much clearer later where I'm heading with this when I release more updates and release much many more shader related commands.

My aim in being able to let the blitz user choose between the fixed function pipeline, the resident hardwired shaders, and their own custom shaders in dx9 mode is to give them a maximum amount of freedom. They will equally be able to choose between the resident hw shaders and their own custom shaders in dx11 mode. For users that do not wish to create their own shaders, they will have the option of using the shaders resident in hardwired which will contain more functions/effects than the direct x's ffp. I have a cartoonify effect in the works for example that will become part of the hw resident shader code, and others will follow (perhaps blur too)....

I have of course many goals, and a lot of ambition for this project. Many people in the blitz community have been waiting more than ten years for Blitz Research to bring out a direct follow-up to blitz3d. And they are still waiting. Hardwired is probably the closest thing to a faithful follow up, and this I only started in october from nothing. I have since learnt an enormous amount about c++ programming (and still learning new stuff all the time), HLSL code, matrices, vectors, normals, recsources and of course directx and windows programming. It has taken a lot of reading and nit-picking at the same time, not to mention much trial and error. This all takes time. One is not born with this knowledge and one has to know where and how to find it.


Even though hardwired may be beyond my capabilities - and for this I have never said the contrary; it will take me a considerable time to get it all together. I have however the main aim of getting my code as solid and a bug free as possible at the end. Please do not forget any of you that this is still presently very much a work in progress and is not a release version. Although a lot of the functions are complete, there are still many corrections/additions/suppressions to be made as time goes on...


Rick Nasher(Posted 2014) [#135]
Pretty impressive as is. And appears your share of followers is ever increasing. :-)


virtlands(Posted 2014) [#136]
..there are still many corrections/additions/suppressions to be made as time goes on...

Hi Ploppy, I misplaced that program that updates the Blitz3D help file with your DX.. commands.
Can someone show me a link to it?


Ploppy(Posted 2014) [#137]
Hello Virtlands, I haven't updated these help files for a long time, and I don't think I will again until hardwired is complete. However, for what it is worth there is still an old version of hardwired that has these help files, which on my site at http://chipmunkplayer.free.fr/setup.exe. It is about six months old, so any commands that I have added since then will of course not be on the help files. Just install this, and then replace the old dll with the up to date one. Remember, the old version of the dll had another name, so be sure to delete it, or else you will get a conflict with the .decls file.

Later...


Ploppy(Posted 2014) [#138]
Yay, have just successfully corrected my lighting problems with my dx11 shader. It may not seem much, but this has taken me a while and the shaders are essential at the end if I want hardwired to be worth its salt. I am almost at a level where I can have the option of using the same shaders in dx9 mode. A very important step for me, after that I will have much more freedom available than dx9 basic capabilities. Instancing, particles and effects should follow much easier afterwards. No promises, but I feel a long-overdue update coming on this weekend. Watch this space, and thanks for being patient - sometimes this work is sometimes very much needle-in-haystack ish...


Rick Nasher(Posted 2014) [#139]
The say goes: "don't hold your breath" - but I'm exited and still holding it, even if my face has to turn blue! ;-)


Ploppy(Posted 2014) [#140]
You shouldn't hold your breath either, the code is good, but the next update will not have many new functions. This will be a renderer update - however you may well notice some speed up and less bugs in some areas, not to mention the great and sexy shader fix. Once I get the my resident shaders down though you can expect quite a few new commands in the next weeks (especially user-created shader support functions for both dx9 and 11).


Rick Nasher(Posted 2014) [#141]
Alrighty, I'll ex- and inhale again..


Ploppy(Posted 2014) [#142]
New update out. Like I said, not a lot in the way on new commands for today. On the other hand, there is a lot of improvement on the renderer side. Now we have the possibility to use the same shaders in dx9 as in the directx 11 mode. This is a huge leap in the developement of hardwired as I have now sufficiently grasped the basics of shader manipultation in both dx9 and dx11. Shaders play a very important role in the whole of the rendering technique, and are vital to a modern-day engine. Without this capability the limits are just not competetive with today's expectations. Much can be performed at a very good speed (naturally depending on the programmer as always) with vertex and pixel shaders using relatively little code. That is their beauty. With dx11, I will eventually extend on this to include hull and tesselation shader support. Hull and tesselation shaders are not available using directx 9.

Much more in the way of shader control should follow much faster now, now that the basis of this process has now been established. Watch this space...

New commands
dxEntityHWShaders(entity%,enable%) (enable default=false) - Use hardwired shaders to render entity instead of default directx 9 shader, please note- does not make any difference in dx11 mode as dx11 only uses shaders
dxHWShaders(entity%) - Use hardwired shaders for ALL entities
dxSurfaceHWShaders%(surface%,enable%) (enable default=false)- Use hardwired shaders to render surface instead of default directx 9 shader, please note- does not make any difference in dx11 mode as dx11 only uses shaders

dxEntityNegative%(entity%,enable%)(enable default=false) - This command I included is ONLY to prove that hardwired is indeed using it's own shaders when called for. This is like a demostration function, if you like. But I will keep it in hardwired, for it takes up very very little memory (see HLSL code below) and does not at all kill performance. This routine will simply invert the RGB of any entity, and since this capability is not present in the directx 9 functions, this command will automatically render the said entity with the HW shader. In dx11 mode, the shader will of course perform the same task of inverting the RGB. Hope this all make sense. Please check out maze.bb to see an example, dwarves are rendered in negative mode.


Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


I have included a copy of the current version of these hardwired shaders written in HLSL that are part of the hardwired dll, for anyone that is interested. I however make no excuse for sloppiness, but here we are in all it's glory anyway...


VERTEX SHADER


PIXEL SHADER


Please note: I am aware that the execution of the hardwired shader in dx9 is slower than within directx 11. In am in the process of optimisation (you should have seen it a couple of days ago, it was much slower ;D). The shader in dx9 mode is now very much usable, so this is why I'm releasing. No point in releasing shabby stuff...


BlitzSupport(Posted 2014) [#143]
Sounds cool! The only shader coding I've done was in Mark's Max3D engine however many years ago, basically just pixel shaders in GLSL, and what really made it interesting for me was being able to access the depth buffer within the pixel shader to experiment with DOF... also made a shader to convert each frame into a realistic emulation of Sinclair Spectrum output! Hope this sort of thing will be do-able!

Also, most of the way through wrapping HW for Monkey (derived from the BMX wrapper), but it requires C++ access to the DLL -- simple test is working anyway! Just need to do some awkward stuff to handle strings between C++ and Monkey...


Ploppy(Posted 2014) [#144]
That's really good stuff, I never thought HW would be compatible with Monkey what with it being multi-platform. Shows how much I know ;D Keep up the good work, sounds very interesting indeed.


Rick Nasher(Posted 2014) [#145]
Nice one. Are the scaling issues when animating the B3D dwarf resolved, so he can safeguard the maze swinging his mighty battle-axe against any unwanted visitors?


Ploppy(Posted 2014) [#146]
Nope, not yet unfortunately, but I'll get back to that when I'm inspired. I will get there though. At the moment, I'm working on the HW shaders and almost done with texture boundaries. Should release more by the end of the day, allowing user to apply multiple textures to a terrain for example and the shader will choose the texture to draw depending on terrain height. Gonna look great!


Rick Nasher(Posted 2014) [#147]
Now that really does sound interesting indeed.


BlitzSupport(Posted 2014) [#148]
Ploppy, it'll only work on the Windows target in Monkey, but it'll be cool to have another 3D engine to play with anyway.


Pharmhaus(Posted 2014) [#149]
@Blitzsupport
have you read this?
See my post #10 which shows how to hack things so everything works without wrappers. It's missing the UTF8 wrapper functions but you can just do the same for UTF8 what I did for CString by copying the function from MonkeyPro/modules/os/native/os.cpp and renaming it.


Ploppy, it'll only work on the Windows target in Monkey, but it'll be cool to have another 3D engine to play with anyway.



That would be AWESOME indeed.


Ploppy(Posted 2014) [#150]
Little release out...

dxEntityTextureBoundary(entity%,texture_index%,min_x#,min_y#,min_z#,max_x#,max_y#,max_z#) - Set a limit within an entity's texture. The renderer will only use a sample of the texture index given IF the pixel resides within the assigned boundary limits. See test8b.bb for an example.

This function is for the moment very crude, but gives an example of the road I'm taking with it....


Please note that for this effect at the moment the limit is only 4 textures per entity - but I'm working on the rest...

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here


BlitzSupport(Posted 2014) [#151]

@Blitzsupport
have you read this?



Hi Pharmhaus -- that was my thread! I was actually a little uncomfortable using that method, though, mainly because I don't understand how it works! Thing is, I only need wrappers for the functions that involve strings, most of which wouldn't be used in realtime stuff anyway, so I'm happy with what I have now -- but I definitely wouldn't have got there without your help!

Hoping I'll finish the converter tonight...


Ploppy(Posted 2014) [#152]
For any maths enthusiasts, here are a few qauternion and matrix manipulation functions

dxCreateQuat%() - Returns handle to a newly created quaternion variable
dxFreeQuat(handle%) - Free up quaternion
dxQuatFromEntity(handle%,entity%) - Aquire rotation from an entity and save it in quaternion
dxQuatFromPYR(handle%,pitch#,yaw#,roll#) - Set quaternion manually from pitch, yaw & roll (in degrees)
dxQuatFromXYZW(handle%,x#,y#,z#,w#) - Set quaternion manually from x,y,z and w values
dxGetQuatX#(handle%) - Does what it says
dxGetQuatY#(handle%)
dxGetQuatZ#(handle%)
dxGetQuatW#(handle%)
dxGetQuatPitch#(handle%)
dxGetQuatYaw#(handle%)
dxGetQuatRoll#(handle%)
dxQuatFromMatrix(quaternion_handle%,matrix_handle%) - Get rotation element from matrix
dxQuatInverse(handle%) - Invert quaternion
dxQuatNormalize(handle%)
dxQuatMultiply(handle%,operand_1%,operand_2%,result%)
dxCreateMatrix%() - Returns handle to a newly created matrix variable
dxFreeMatrix(handle%)
dxMatrixMultiply(operand_1%,operand_2%,result%)
dxMatrixInverse(handle%)


Pharmhaus(Posted 2014) [#153]
Moved to the Monkey Forum


Rick Nasher(Posted 2014) [#154]
@Ploppy: I've just downloaded the new version, but test8.bb is looking the same as before so I guess the adaptation didn't make it into the new download? Which would be be a pitty cos the screenshot is great.


Ploppy(Posted 2014) [#155]
Hi guys, it's about time I added this donate button after all, a few of you have asked and I have nothing to lose by doing so. Any donation whatsoever will be greatly appreciated if you wish to show your support you're more than welcome. Hope this paypal donate button works; first time I tried... I will include this button in my new posts. The choice to donate will remain, of course, optional. And textual support support is always welcome (so is critism if it is constructive) if financial support is not possible.

Right, I'm off to bed... g'night...




Ploppy(Posted 2014) [#156]
Hi Rick, sorry I meant to say test8b.bb. I have now modified the previous post. Ooops....


Kryzon(Posted 2014) [#157]
Ploppy, can Hardwired be used in commercial projects? What is the license?

EDIT: Can you add the MeshCullBox command to the list?


BlitzSupport(Posted 2014) [#158]
@Pharmhaus: I just replied on the Monkey thread (don't want to hijack Ploppy's thread too much!) -- there's a version you can test, but wonder if you might be able to look at the string queries I mention there?

@Ploppy: it works!<-- Screenshot. (Just some Monkey-specific problems with strings to iron out.)


Guy Fawkes(Posted 2014) [#159]
OMG! I LOVE THIS, PLOPPY!


Pharmhaus(Posted 2014) [#160]
Ok i think i figured the string stuff for Monkey X out.
It uses your HardWired.dll now, but it looks like the Strings returned from your functions (like dxEntityName / dxTextureName) are not null-terminated (I put "Hello World!" in and get "Hello World!top\" or other random strings back).
It would be nice if you could take a look to verify if this is true or if my Monkey X code still has some bugs....

EDIT: How do i check if the graphics window has been closed by the user?

Thanks


Ploppy(Posted 2014) [#161]
forum error - this post was copy of post below - so have deleted this one


Ploppy(Posted 2014) [#162]
forum error - this post was copy of post below - so have deleted this one


Ploppy(Posted 2014) [#163]
Ok hi Pharmhaus, I have just added this function - hope it caters for your needs. If not let me know and I'll see if it is doable...

dxHWWinStatus%() - Returns information on current status of hardwired window...

1 = Hardwired window has been created
2 = Hardwired window is in fullscreen mode
4 = Hardwired window is in directx 11 mode
8 = Hardwired window is minimised
16 = Hardwired window is currently in the foreground

All these results can be OR'ed naturally depending on the individual status of each flag.

As for the string problem, I have reviewed both dxEntityName and dxTextureName and have changed them a bit. It should be okay now....


Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here



Thanks very much Pharmhaus for the donation by the way, very kind of you ;D

@BlitzSupport, don't worry about hijacking the thread - I'm not. If it is Hardwired related this is where it belongs. Besides, if the thread gets too big I'll just start a new one (already thinking about that for this one - I think once we get around 200 posts we'll be moving on again...)


Ploppy(Posted 2014) [#164]
Hurrah! Instancing now works! I hope it does on your machine too!!! Celebratory cream teas for all...



For info, there are 400 dwarves being rendered in the above image using a shader technique known as instancing. On my machine, I'm getting about 150 frames per second. That's huge!! Please see test10.bb for the same example....


NEW COMMANDS

dxCreateInstancer%(position_element%,colour_element%,normal_element%,texcoord1_element%,texcoord2_element%) - Will initialise an instancer, this object will take care of any instancing and is the first step to using this technique - the handle of instancer is returned by the function.

Parameters are:
position_element% - Set this to true to instruct the instancer to create all its elements with a position,rotation & scale changer. With this enabled the position,rotation & scale of an attached entity will change with every element recorded
colour_element% - Set this to true to instruct the instancer to create all its elements with a colour changer. With this enabled the colour of an attached entity will change with every element recorded
normal_element% - Set this to true to instruct the instancer to create all its elements with a normal changer. With this enabled the normal of an attached entity will change with every element recorded
texcoord1_element% - Set this to true to instruct the instancer to create all its elements with a texcoordinate (set 1) changer, With this enabled the texcoordinate of an attached entity will change with every element recorded
texcoord2_element% - Set this to true to instruct the instancer to create all its elements with a texcoordinate (set 2) changer, With this enabled the texcoordinate of an attached entity will change with every element recorded

Please note - for the moment, only position changes will work

dxFreeInstancer(instancer%) - Will free up the said instancer
dxInstancerCountElements%(instancer%) - Will return the current number of elements in a instancer
dxInstancerAddElements(instancer%,count%) - Will add a given number of elements to an instancer, this will not replace the already existing elements, but create new ones at the end of the element list
dxInstancerFreeElement(instancer%,element%) - [not yet implemented] - Frees up a element given in parameter
dxInstancerHookEntity(instancer%,entity%) - In order to render an object using instancing, hooks an instancer to an entity. The renderer will recognise this assignment made and render this same entity many times, the amount of times being equal to the amount of elements that are in the instancer that has been assigned to it. With each new copy of the entity drawn, a modification will be made to it's position, recorded using the commands/functions below. Instancers are NOT exclusive to entites so can be hooked to any amount of entites. The renderer will follow the same rules for each entity assigned with the instancer.
dxInstancerUnhookEntity(entity%) - Unassignes an instancer from an entity so it will render just once as normal

The following commands/functions provide the way to record how each copy of an entity will be changed in either position and/or rotation and/or scale

dxInstancerPositionElement(instancer%,element%,x#,y#,z#) - Set an instancer's element to position x,y and z
dxInstancerElementX#(instancer%,element%) - Retrieve the x position from an instancer's element
dxInstancerElementY#(instancer%,element%) - Retrieve the y position from an instancer's element
dxInstancerElementZ#(instancer%,element%) - Retrieve the z position from an instancer's element
dxInstancerMoveElement(instancer%,element%,move_x#,move_y#,move_z#) - Move an instancer's element by x,y,z
dxInstancerRotateElement(instancer%,element%,pitch#,yaw#,roll#) - Rotate an instancer's element to pitch,yaw and roll
dxInstancerTurnElement(instancer%,element%,pitch#,yaw#,roll#) - Turn an instancer's element by pitch, yaw and roll
dxInstancerElementPitch#(instancer%,element%) - Retrieve the pitch of an instancer's element
dxInstancerElementYaw#(instancer%,element%) - Retrieve the yaw of an instancer's element
dxInstancerElementRoll#(instancer%,element%) - Retrieve the roll of an instancer's element
dxInstancerScaleElement(instancer%,element%,scale_x#,scale_y#,scale_z#) - Set an instancer's element to scale factor x,y and z of your choosing
dxInstancerElementScaleX#(instancer%,element%) - Retrieve the x scale factor of an instancer's element
dxInstancerElementScaleY#(instancer%,element%) - Retrieve the y scale factor of an instancer's element
dxInstancerElementScaleZ#(instancer%,element%) - Retrieve the z scale factor of an instancer's element

Please note, instancers will not be automatically freed with a dxEndGraphics command This is deliberate, so you can re-use them if you so wish after a graphics mode change.

This is not a complete set of commands for instancing, but it's a good start...

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here




Guy Fawkes(Posted 2014) [#165]
@Ploppy: Can you activate the amount of objects in a matrix or instance (w/e you want to call it) with a keyhit() ?

Thank You!


Pharmhaus(Posted 2014) [#166]
@Ploppy
I checked the new version but the bug still seems to exist.
I made you a small test program, just download it, open a CMD, drop the exe and press return.
*Click*
It will then show you if there are still strings that change between set/get.
It uses the dxNameEntity/dxEntityName function but I'm afraid the same is also true for some of the other functions.
The program writes 1024 times to ensure that there is no misjudgment due to random memory content.


dxHWWinStatus%() - Returns information on current status of hardwired window...


I tested a bit and found out that

dxWindowWidth() = 0


is true when the user pressed the [X] of the window
but it would be cool if you could introduce a flag/function which changes state
if the window was closed this way because otherwise the application continues to run in the background.

I also have a question which is maybe a bit stupid but I never used B3D ...
Is it currently possible to draw a sprite (always facing the camera thingy?) like a
menu/border/.. ? I looked at the command list but all the meshes and surfaces don't tell me a thing.

Thanks for your help :)


Ploppy(Posted 2014) [#167]
Ok, I'll look into that tomorrow, thanks for feedback. It's getting late here now and at work at 6 in the morning....

PLEASE NOTE I have just released a new update in the past few minutes, the dwarves not turn and can be scaled. I have added to the list in my previous post, along with some descriptions.

@GuyFawkes use the dxInstancerUnhookEntity command if you wish to 'turn off' instancing for an entity. dxInstancerHookEntity, to turn it back on. I'll leave you to do the work... ;D


BlitzSupport(Posted 2014) [#168]
Just tried test10.bb in Blitz3D but I just get an untextured ground mesh and the FPS text, nothing more -- I DebugLog'd the model/texture loading results and they do seem to be loading. I'm using a Geforce GTX 750 TI on Windows 7 64-bit if that means anything...


Rick Nasher(Posted 2014) [#169]
Hi Ploppy,
Some screenshots..

Test8b.bb and Test10.bb


Maze.bb DX9 and DX11


I've notice the problem(s) since in the previous update Test8b.bb didn't give me multitextured terrain and DX9 version of Maze.bb was like as in the screenshot above.

Now I don't now if this is only on my system, so hope someone can test bit further.

---Specs---
GPU: NVIDIA GeForce 8400M GS, DX11
OS: Win7 Ultimate X64 SP1
Blitz3D V1.106 , FastExtension V1.17


*P.S.: Bought you a beer.. (the button works)


{EDIT: Aaargh Blitzsupport beat me to it! ;-)


Ploppy(Posted 2014) [#170]
@BlitzSupport Thanks for info, I'll see about that on the 'morrow - I just knew it was too good to be true. It works fine on my machine, but I guess I messed up somewhere.

Oh well, thinking cap back on.... < :D

@Rick, what was the text displayed in the little window? It looks like one of my debug things, but I can't read it (too small to read). It may help me to know... cheers...

And cheers yet again donation wize this time, having so much faith in me for something that presently is a bit buggy...


Rick Nasher(Posted 2014) [#171]
Text= "Cannot create shader layout".

Hehehe, I encourage everyone to do the same (donate), cos let's face it: you deserve it, you did a staggering amount of work, even though not finished (yet)and a bit buggy; It's a long hard road to travel..

Btw: yesterday the DX11 version of Maze.bb was still working, managed to see the inverted dwarfs OK.


virtlands(Posted 2014) [#172]
For any maths enthusiasts, here are a few qauternion and matrix manipulation functions...

Thanks for the Quat routines; I heard that quaternions are a superior method for doing rotations,
though I'm not experienced with it.

other various quat sources ::

Quaternions by Wavey (2002) -- http://pastebin.com/73zH79FT
Maths3D by Mark Sibly (2008) -- http://www.blitzbasic.com/Community/posts.php?topic=75979#866631

Quaternion from Wikipedia -- https://en.wikipedia.org/wiki/Quaternion
Maths Quaternions -- http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/
3D Game Engine Programming -- http://3dgep.com/?p=1815
Wolfram Math Quaternions -- http://mathworld.wolfram.com/Quaternion.html


Ploppy(Posted 2014) [#173]
@Rick, thanks for bug report - I think I have just fixed half of it. Please check. I have just uploaded a new version.

Dx11 stuff should now be back on line, it seems that dx11 is more touchy than dx9 when it comes down to declaring vertices. Well now, as dx gets older, it just becomes more and more difficult. ....happens to the best of us, I guess... :)

Thanks for your great support Rick, you've been holding on for a long time now since the birth of Hardwired. I really do appreciate your loyalty to my cause. You and Yue have been the biggest followers of hardwired's progress, and haven't given up on it, in spite of it taking a while to be made. I however haven't heared much from Yue recently. Hope all is okay...

@all

I think that tomorrow I will add debug windows to lots of things, and then rerelease it. If there is a directx problem that way, a window should come up and give details. Even if HW doesn't work, I will be able to pinpoint why this way, thanks to a little help (that is if you don't mind).

As always, your feedback is imperative to achieve a bug-free release...

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here




Ploppy(Posted 2014) [#174]
@Rick/Blitzspport - Okay, no promises, it may work - I have just made another update - this POSSIBLY will solve all the present problems you are both suffering. It's just a theory I have, give it a shot; hope we're lucky...

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here



Um... wasn't I meant to go to bed?? Uhhh... yep, still up at 5am (it's almost 11pm in this part of the world). Better go, I guess - I'm really gonna be out of service tomorrow morning...


Rick Nasher(Posted 2014) [#175]
After your latest update( last 2 updates):

Test8b.bb: (still) no multiple textures.
Test10.bb: all flat with 2FPS.
Maze.bb DX9 version: distorted objects, but something must have changed cos now I see more flat
Maze.bb DX11 version now working again(very cool!):


Don´t neglect your sleep. You're in Europe too right? cos here's 23:00 too, well now 23:13 :-)


Ploppy(Posted 2014) [#176]
@Virtlands

Hi, glad someone found these functions useful. I know I do.

Quaternions are a way of depicting a rotation of an object. The following what I have understood about them, but this is to be confirmed....

Quaternions are groups of four floating-point values - x,y,z and w (or w,x,y,z - depends which way one looks at things - big diff!!).

x,y,z decribes the direction that an object is pointing. The x,y and z elements are all relative to each other and relate to relational positional shifts along the x,y and z axis from 0,0,0.

A valid xyz value of a quaternion has the same qualities as a 'normal' - that is to say that the absolute sum of all three equal 1. A normal descibes a movement in any direction that can be multiplied by any distance to achieve the amount that an object would have to move on the x,y and z axis.

Whereas the xyz values of a quaternion are best when they are 'normalised', they can be used with values that sum up (absolute values) to more than 1 or less than 0. These types of xyz values are generally not adopted by sturdy calculations because they can give unexpected truncated results.

Take for example the normal/quat xyz...
quat.x=0.5
quat.y=0.3
quat.z=0.2

total of all three elements=1.0 - this is considered 'normalised'

assume you were trying to calculate the final position of an object that was moving in a direction which was essientially 50% to the right, 30% higher and 20% in front and was for a distance of, lets say 10.

distance moved along x axis=distance moved in straight line*quat.x
distance moved along y axis=distance moved in straight line*quat.y
distance moved along z axis=distance moved in straight line*quat.z

the result of this calculation would give you a correct quantity in all three axii. This is because the quaternion xyz values are normalised.

The w value of the quaternion array relates quite simply to the rotational spin-value of the object in question. Although I feel I have given quite a verbose exmplaination of the xyz values, I will freely and without shame admit I do not know how this w value is depecited. I know what it represents, but do not know how exactly it is described. I'm guessing the value is from 0 to 1 like for the xyz values, 0 representing 0° and 1 representing a 360° roll. This value, of course could be quite simply from 0 to 360 (or it's radian equivalent). I haven't had to discover this yet, so this is why I have no clue.


Guy Fawkes(Posted 2014) [#177]
@Ploppy: Can you activate the amount of objects in a matrix or instance (w/e you want to call it) with a keyhit() ?

Thanks alot buddy, and keep up the good work!


virtlands(Posted 2014) [#178]
I took some of Ploppy's files for a test drive...
dxEntityBlend.bb works very well.
vidtest.bb works very well

The dx11_test.bb doesn't work well for me;
The items are very flickery and hard to see.
I'm convinced my machine just isn't meant for Directx 11.

dxMeshesIntersect.bb has a minor error, but otherwise seems to work

The maze.bb fails to perform properly; Neither the Dx9 option nor dx11 option displays anything.


BlitzSupport(Posted 2014) [#179]
test10.bb still gives the same result for me, sorry, Ploppy! Basically got the same results as Rick for the other demos he lists.

BTW I noticed a little typo in your includes\gfx_generic.bb earlier:

maxwh=0
maxw=0
mawh=0 ; SHOULD BE maxh, not mawh
max=0


And, yes, go to bed! :P


LineOf7s(Posted 2014) [#180]
@Guy Fawkes
@Ploppy: Can you activate the amount of objects in a matrix or instance (w/e you want to call it) with a keyhit() ?

Four hours earlier, and one hour after you last asked:
@GuyFawkes use the dxInstancerUnhookEntity command if you wish to 'turn off' instancing for an entity. dxInstancerHookEntity, to turn it back on. I'll leave you to do the work... ;D



Guy Fawkes(Posted 2014) [#181]
You're not getting any reaction out of me. Infact, I'm no longer talking to you & no matter what you say after this sentence, I am ignoring.

NO FEED 2 THE TROLLZ! =D


Ploppy(Posted 2014) [#182]
Thanks for the input everyone, I'll get that all sorted out. Hope it's not too difficult....

Looks to me as though my shader initialisation routines lack a little compatibility with some hardware configurations, at a guess. I'm at work for the moment, so not working on HW (though my mind is already working on HW, more interesting than my job :D )


Ploppy(Posted 2014) [#183]
I have just uploaded a new update. I hope this will solve a few things. No garanties, so if things don't go as expected I need to know. Thanks in advance for any feedback on this. Positive feedback would be good, but we'll see if I've cracked it or not....

Firstly @Pharmhaus, thanks for your test exe, it did demonstrate very well that dxEntityName/dxNameEntity had a few problems. I have now corrected both commands, and have run it through your test program with the new hardwired.dll. I have a 'congats! there are no string error :D' output, so I've officially cracked it. I had forgot to null terminate my strings as you suspected. I however could not find what was wrong with dxWindowWidth(). Can you give me a bit of example code. I tested this function and it gave me the result I expected.

@Virtlands I'm not as convinced as you quite yet that your machine isn't dx11 compatible, it's more like HW has bugs in my opinion. You're getting amazing results by the way for the vidtest. That's some gfx adapter!! This gives me more reason to believe your gfx adapter is indeed compatible with dx11.

@Rick/BlitzSupport, I have created many more debug windows in my shader initialisation routines. If it comes across a problem, it should say. Please let me know if you get one of these windows...

@GuyFawkes - I think I may understand what you mean by...
@Ploppy: Can you activate the amount of objects in a matrix or instance (w/e you want to call it) with a keyhit() ?


...do you mean you would like to be able to individually activate/deactivate elements of an instancer? I think I will have to work on that. For me, the natural follow-on to instancing will be particle systems, for particle systems use instancing to display many sprites/objects together. So I will require some kind of similar functionality so that elements in a living breathing emitter can 'die' or 'be born'.

I wish you all lots of luck with this new update, hope all goes fine, especially for the new test10.bb. About this, I have changed the bb code, so now you can easily change the number of dwarves displayed by the instancer. Just change array_size,x_size and z_size value to suit the performances of your gfx adapter.

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here




Guy Fawkes(Posted 2014) [#184]
Hi Ploppy. What I mean is, can you use this to create a "matrix" of objects, 1 matrix above the other? For instance, I have a 5x5 matrix of 25 models lined up in rows & columns basically like "connect four".



Thanks, Ploppy! :)


Ploppy(Posted 2014) [#185]
For anyone (if anyone) is interested, here's an update to my resident hlsl shaders that I have recently modified...

VERTEX SHADER



PIXEL SHADER



Ploppy(Posted 2014) [#186]
@GuyFawkes - Instancers are basically lists of changes made to an entity for a given number of renders. Instancing is fast, and is similar in theory to good old blitz's CopyEntity for example. CopyEntity will just make a new entity, but referencing to the original's vertex and triangle buffer. CopyMesh will make a copy of everything. Instancing work similarly to CopyEntity/dxCopyEntity but will tell the graphics adapter to do all the work. With copied entites, the graphics adapter will be 'called' x number of times for the amount of entities displayed. With instancing however, the graphics adapter is 'called' just once, since it processes not just the vertices and triangles but also a list of changes to be made to the entity a given amount of times. Instancing is a much faster and powerful way of rendering multiple objects.

I have created the instancer this way because it corresponds with the way directx and shaders work with instancing. If you wish to use these lists in a 'matrix' form, it's up to you to do so in the bb code. You can interpret an instancer's element as a part of a 'matrix' if you so desire. Using the position/rotation and scale element commands you are free to position and orient each copy of an entity by any way you wish.

My test10.bb shows a matrix of dwarves using instancing for example.

I hope this was what you meant.


Ploppy(Posted 2014) [#187]
900 Dwarves, with an average fps of 50 - I love instancing....



Pharmhaus(Posted 2014) [#188]

I have now corrected both commands, and have run it through your test program with the new hardwired.dll. I have a 'congats! there are no string error :D' output, so I've officially cracked it. I had forgot to null terminate my strings as you suspected.


Great!


I however could not find what was wrong with dxWindowWidth(). Can you give me a bit of example code. I tested this function and it gave me the result I expected.


dxWindowWidth() works fine!
I used it to check if the window is closed (Workaround).
but it would be better if there was a function / flag to check if the user pressed the [X]



ILSANTO(Posted 2014) [#189]



ILSANTO(Posted 2014) [#190]



Ploppy(Posted 2014) [#191]
@Pharmhaus - I think you're looking for this...

@Ilsanto- looks like a texture problem to me - very strange. Is anyone else suffering the same symptoms??


Rick Nasher(Posted 2014) [#192]
No such luck as above. Perhaps my ancient(2008) GPU:

dxMeshesIntersect.bb
dxGraphics3D 640,480,32,2 ;,0 <<< this fixes the too many parameters error.

maze.bb
DX9 mode still a flat (2d?) surface..

test10.bb
a flat surface..

test10b.bb
7;Dx9 FREAK SHOW!!!! <<< remove the '7'

test10d.bb a black & white surface..
Never got to witness the annual crazy dwarf jumping yet.(and I'm pretty curious to see it too)
BTW: 2FPS! and at one time I briefly had the black on white dwarfs, while exiting the program


Pharmhaus(Posted 2014) [#193]

dxWinClose%() - If autoclose has been set to false, this function will return true if the user has requested quit, either using the window close button or alt+f4.


Ahh i see my mistake.
dxWinClose only works when autoclose is set, was just wondering what is going on.

Is the program closed in B3D if autoclose = true?

dxSetWindowDefaults(0, 1, 1, 1, 1)


In Monkey X the window is closed but the program still runs.

Is this also true for Blitz3D ?
If so, could please change the default to autoclose=false or close the program?


Ploppy(Posted 2014) [#194]
@Rick OMG. Not cool.

I'll look into it...

@PharmHaus - I'll look into it too, I can't remember how I coded this function - I did it a few months ago...


Guy Fawkes(Posted 2014) [#195]
@Ploppy: I just found out there's not a "dxCreatePlane()". Can you please add this function since I just upgraded my entire project to hard wired, please & thank u?

Thanks alot buddy! :)

~GF

EDIT: There's also not a "dxCaptureWorld()" command which I need in order to keep my program running on all computers at 60 FPS.


BlitzSupport(Posted 2014) [#196]
My test8b.bb and test10.bb both look still look as in this post, unfortunately! I don't get any debug output either, as far as I can tell.


Ploppy(Posted 2014) [#197]
Hello, a little update, not much new for the moment, but here we go...

@GuyFawkes, I have added dxCreatePlane(sub_divs,parent) as you asked. Please see demo dxcreateplane.bb for an example. Hope you like...

I have also made a little change to the shaders, this may solve the problems a lot of you are having - but only perhaps...

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here




Ploppy(Posted 2014) [#198]
It seems I did something to the code yesterday that has made things worse. I'm gonna backtrack my code a bit tonight and try again tomorrow. No more updates today I'm afraid. I need to see what I've done to upset the renderer...


Steve Elliott(Posted 2014) [#199]
It happens...Don't apologize. A graphics engine is a wild beast...I'm sure the guys will understand :)


Rick Nasher(Posted 2014) [#200]
No changes I'm afraid.
But "dxCreatePlane()" <-- hilarious! :-D

@GF: Perhaps you can "bribe" (@) Ploppy to do the command(s) you want? ;-)
Just kidding, however.. perhaps you can offer him a few bucks per command?


Ploppy(Posted 2014) [#201]
But "dxCreatePlane()" <-- hilarious! :-D


Sorry mate, couldn't resist it...


Rick Nasher(Posted 2014) [#202]
The force is strong with this one.. ;-)


Guy Fawkes(Posted 2014) [#203]
With what money, @RN? -.- I'm finishing my program so I CAN do that for people like ploppy in the near future.


Steve Elliott(Posted 2014) [#204]

I'm finishing my program so I CAN do that for people like ploppy in the near future.



No, you can't...Just let Ploppy do his thing and you write some games. Engine writing requires a certain set of skills...Just let the engine guys do their thing and produce some cool stuff :)


Guy Fawkes(Posted 2014) [#205]
I already have all the commands I need to finish my program except for the CreatePlane() which I'm going to try in a few minutes & CaptureWorld() (which is still missing, @Ploppy). Other than that, it seems complete to me. :)

Thanks alot for adding the Plane code, @Ploppy! :)

Also, in Blitzplus, I can't use "KeyHit(1)" to escape both my program and the blitzcc.exe process at the same time like it should in order to "kill" the program. It also detects the escape key hit even in other programs because blitzcc.exe still exists in memory for some reason even though the program is closed or the keyhit escape activates the closing of the program.

~GF


Hotshot2005(Posted 2014) [#206]
Writing own Game Engine isn't easy task but like what Steve say, let the ploppy do the engine and you make game for it :)


Ploppy(Posted 2014) [#207]
@GuyFawkes
Also, in Blitzplus, I can't use "KeyHit(1)" to escape both my program and the blitzcc.exe process at the same time like it should in order to "kill" the program. It also detects the escape key hit even in other programs because blitzcc.exe still exists in memory for some reason even though the program is closed or the keyhit escape activates the closing of the program.



If you open a window in dx9/dx11 using hardwired any blitzplus/blitz3d input commands, be it for keyboard or mouse, will NOT work. The original blitz commands do not recognise the existence of the hardwired windows so ignores all input and events that happen on them. You have to use the hardwired equivalent. There is an equivalent for all input commands/functions except for all joystick functions. Just preceed your needed command/function with dx and the hardwired version will act with the same behaviour.


Rick Nasher(Posted 2014) [#208]
Btw: the dxCreateplane command might be a good idea to code, if is really the only command missing/standing between GF and the finish of his code conversion, cos it might be a good testcase to see how Hardwired holds up in the world.

That is if not to difficult to realize right now, given that you're already very busy with the current issues.


Ploppy(Posted 2014) [#209]
What do you mean? Didn't I create that earlier today ?? ;D


Guy Fawkes(Posted 2014) [#210]
Ok, is there anyway to make it stop saying "Output Window" as the window title, and is there a hardwired equivalent of the command "SystemProperty$("AppHWND")", so I can grab the main window's ID?

Thanks @Ploppy. And anyone who mocks me will just be ignored. So CONGRATULATIONS, Rick Nasher. Not that you or I both care at all.

Anyways, thanks once again Ploppy for your help! :)


Ploppy(Posted 2014) [#211]
Do you mean 'Guy Fawkes yourself' ??


Ploppy(Posted 2014) [#212]
deleted - due to forum error was copy of previous


Guy Fawkes(Posted 2014) [#213]
I will ask once again. Is there any way to make it stop saying "Output Window" as the window title, and is there a hardwired equivalent of the command "SystemProperty$("AppHWND")", so I can grab the main window's ID?

Thank You, Ploppy.


Rick Nasher(Posted 2014) [#214]
Sorry GF, I like a joke/laugh every now and then, but nothing personal/no disrespect.

I actually was serious when requesting the command for you, not mocking, cos as you stated: it's the one thing holding you back from completion of your project conversion then I think this should be welcomed and stimulated. But Ploppy probably has his hands full at the moment.


LineOf7s(Posted 2014) [#215]
it's the one thing holding you back from completion of your project conversion

Uh huh.


Guy Fawkes(Posted 2014) [#216]
^ Not feeding the trollz :D

@Rick, it's ok. I've had a crap day... I just found out a close friend of mine has a rare form of cancer, so I am not in the mood to be mocked.


LittleDave(Posted 2014) [#217]
Just use AppTitle or is it AppInfo in HardWired Guy Fawkes.
You only really need it if you want window mode anyway.Which a lot of games don`t.

Have a nice day.


Guy Fawkes(Posted 2014) [#218]
Thanks, @LittleDave. But for some reason in BlitzPlus, dxAppTitle() Still didn't change "Output Window" for some reason.


Guy Fawkes(Posted 2014) [#219]
It's not a game, it's a program. :)


LittleDave(Posted 2014) [#220]
Yep just looked at Ploppy command list which is in his sig .

dxApptitle("This is my window").


Guy Fawkes(Posted 2014) [#221]
Tried it. Still says "Output Window" :/


LittleDave(Posted 2014) [#222]
I don`t use BlitzPlus bud,cannot help then im afraid. :(


Guy Fawkes(Posted 2014) [#223]
That's ok, LittleDave. :)

Perhaps someone else can explain why dxapptitle() is not changing the window's title name in BlitzPlus?

Thank You!


Ploppy(Posted 2014) [#224]
Have you tried AppTitle? The general rule goes: blitz commands for blitz windows, and hw commands for hw windows.

we are talking about the first window that comes up after compiling, right?


Ploppy(Posted 2014) [#225]
Like I said yesterday, I have backtracked my code a bit. Once a week I archive my whole project (about 5GB of code all in all, includes, libs, docs, sdk's, data, images the whole kit and kaboodle) and copy it all to a second hard drive. That way, if ever a have a hard-drive corruption or an evil virus or whatever, I should have a way of getting my project back. At the same time archiving it all gives me precisely a way of backtracking if I do code myself into a hole.

I feel that things haven't been going too well compatibility wise in the last few days. It has been working well on my machine, but not well on others. So I have put my recent code to the side for the moment have gone back in time a little to hardwire's state on saturday. Instancing therefore, has been taken off for the moment. The bb code is there, ready for use, but won't work as the functions are not in the dll.

I will be re-inserting my code slowly to see how the machines react to it. Please be patient, but I find this method of reintroducing code bit by bit more helpful to me for debug purposes.

So please download this 'earlier version' and test. Should be okay, all works like last week up until the negative command. Like I said, instancing does not work and GuyFawkes I'm afraid I had to take out dxCreatePlane - sorry. But I will bring it back of course.

I think that a good demo to test would be the maze.bb in both dx9 and dx11 modes. If they give positive results, and I think and hope they shoud, we can go on.

Hardwired userlib / Command list here / List in Excel format / Libvlc dll's here




BlitzSupport(Posted 2014) [#226]
For maze.bb, I get:

DX9: Average FPS - 1810
DX11: Average FPS - 722

Both have completely different textures (I guess that's intended?) and the warrior guys have a washed out white look, almost look untextured, but from some angles their textures become visible, though they appear to be in negative colours.


Ploppy(Posted 2014) [#227]
New thread - this one was getting a bit too big! See you there....


Rick Nasher(Posted 2014) [#228]
@GF: Very sorry to hear that man, that really sucks. Hang in there.


Guy Fawkes(Posted 2014) [#229]
Thanks, Rick... it does suck.. She has a high probability of living, but no one knows for sure. :/


Rick Nasher(Posted 2014) [#230]
It's one of the evils scientist trying to beat. I truly hope things go for the best.


Guy Fawkes(Posted 2014) [#231]
oh scientists have already beat it, but do you think the rich people will let us have it? No. -.-


Rick Nasher(Posted 2014) [#232]
You may be right indeed. Recently heard they've created something like an antivirus style antidote to some cancer form, with the potential to beat a whole lot of different forms, but still in testing faze. Sounds very promising for the future, better pray we make it that far though.

A brother of an uncle of mine was diagnosed with 3years left max, but he went to Germany and still lives on 20 years after. He finally went to live there..

But I'm off topic in this abandoned thread.


AKNightHawk(Posted 2015) [#233]
Deleted I found my answer. Sorry.