Author |
Topic: 3D Gaming Project (Read 1757 times) |
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #35 on: May 19th, 2016, 5:13pm » |
|
Nice to see an old dog (that would be me) can be taught new tricks . Could you let me know how many frames per second it runs at on your corei7 please David. Could you run a test on shape 1 with 120 faces and a radius of 200. I have an old lap top and it runs about 27 fps. I am interested to see what can be produced on a modern spec machine.
Many thanks
Ric
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #36 on: May 19th, 2016, 5:20pm » |
|
Sorry I forgot to say,
The code runs for any configuration of sides as long as they all have four nodes, my next step is to design a package to enable the construction of such objects, my son would love to see a dinosaur! But more likely an inanimate object like a car.
may take a few weeks as I am limited to a few hours coding a week, but I am keeping the dream of a 3d game alive.
Ric
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
David Williams
Developer
member is offline

meh

Gender: 
Posts: 452
|
 |
Re: 3D Gaming Project
« Reply #37 on: May 19th, 2016, 7:56pm » |
|
on May 19th, 2016, 5:13pm, Ric wrote:Nice to see an old dog (that would be me) can be taught new tricks . Could you let me know how many frames per second it runs at on your corei7 please David. Could you run a test on shape 1 with 120 faces and a radius of 200. I have an old lap top and it runs about 27 fps. I am interested to see what can be produced on a modern spec machine. |
|
I get 72 fps.
I don't actually have very good graphics hardware (integrated graphics - Intel HD Graphics 4600, rather than separate graphics card). Of course, in the case of your program, it's the CPU that's doing the rendering anyway so a high-end graphics card is unlikely to make any difference to the frame rate. I'm using a Core i7-4790 @ 3.60 GHz.
David. --
|
|
Logged
|
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #38 on: May 19th, 2016, 9:29pm » |
|
Thanks David 72 is quite impressive.
The goal I set myself was to write a 3d game using BBC Basic (including Assembler) without using any libraries or add-ons. If I succeed and it runs at an acceptable frame speed I will then move on to the graphics card and openGL, but for now all is good.
Ric
ps. I might make the routines into their own library for others to use.
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #39 on: May 26th, 2016, 10:36pm » |
|
Evening,
I was going to start a design package to help develop 3D objects, but there was one thing missing from the current project. Interpolation. Here is he link to the improved routine.
https://my.pcloud.com/publink/show?code=XZKQvmZBr2Er3lU0wYDDMLo5twkzpU53LhX
Have a play with the number of "shadepolations" and see what you think. Try a low number of faces(20) and high interpolation (even 2 CALLs has a good result).
Could some one have a go at shape 1, 90 faces, 200 diameter and 2 then 3 shadepolation CALLs, and let me know the fps and the machine you are running on.
This new routine now shades the whole screen in anticipation of multiple objects so I am expecting it to be slower than last time.
Thanks Ric
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
sveinioslo
Developer
member is offline


Posts: 64
|
 |
Re: 3D Gaming Project
« Reply #40 on: Jun 3rd, 2016, 07:19am » |
|
Nice work !
shape 1, 90 faces, 200 diameter 2 shadepolation CALLs = 92 fps. shape 1, 90 faces, 200 diameter 3 shadepolation CALLs = 86 fps. Laptop, 64 bit windows 10, Core i7 4720 2.6 GHz.
Svein
|
|
Logged
|
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #41 on: Jun 4th, 2016, 12:53pm » |
|
Thanks Svein, I noticed in your thread, 256 thread png you have code that appears to run multiple threads at the same time. Have I read this correctly? If so I would be very interested in your opinions about moving my project on to encompass the technique.
Regards
Ric
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #42 on: Jun 8th, 2016, 9:13pm » |
|
Here is the latest update.
It is one for Michael , it has two objects and depth
https://my.pcloud.com/publink/show?code=XZgaqbZhR9P9v2qUByqkng2XcsCg7oSCIp7
Ric
PS I am now working on the design package to create complex shapes.
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
DDRM
Administrator
member is offline


Gender: 
Posts: 321
|
 |
Re: 3D Gaming Project
« Reply #43 on: Jun 9th, 2016, 08:44am » |
|
Hi Ric,
That's coming along well - I get 138 fps, which gives you quite a bit in hand for all the other scene elements and the game engine...
...you'll have a custom implementation of Direct3D soon...

D
|
|
Logged
|
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #44 on: Jun 9th, 2016, 3:47pm » |
|
Ha Ha, Cheers D, Should be easier to use
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #45 on: Jun 19th, 2016, 10:35pm » |
|
Here is the latest incarnation.
The two objects are now truly independent and any number can now be produced, laborious to set up and a design package will be the next stop. I have said that before, but this time I think I mean it?
When running the program the keys
Z rotates anticlockwise from above X rotates clockwise from above ' rotates up / rotates down
and spacebar exits to BASIC control
https://my.pcloud.com/publink/show?code=XZEp9hZYDnEkKPF3MRtLkVFo6uyI5b4pbky
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
michael
Senior Member
member is offline


Posts: 335
|
 |
Re: 3D Gaming Project
« Reply #46 on: Jun 20th, 2016, 01:38am » |
|
That's pretty impressive. Now you got me determined to get my example done.. ( some people may say its cheating, but I really think that the first DOOM game was made the same way as I am doing my 3D.. Especially since the technology for imaging has been around since the 80s.)
And probably everyone will agree with my strategy and then we can make a game and link it on Richards forum in executable form and when he runs it he will be fooled into thinking that we cracked the 3D world. But then he probably has a way of figuring out that it was done with 3D image trickery.
Of course if he remembers email concerning my plans, he may just figure it out and respond.. But I will not say what it was unless he figures it out.
Also a mention I didn't post my advancement in ASM after Richard had helped with the memory allocation, but I did advance. Here is where I landed with ASM so far. ( controlling graphics would be the end game, but the next task would be to do multiple variable compares and multiple condition jumps.)
Code:
PRINT "Please wait for increment to 2 million"
PROCassemble
bcd%=2000000
bin%=0
REM REPEAT
CALL bin2bcd
REM UNTIL bin%=2000000
PRINT bin%
PRINT "DONE"
END
DEF PROCassemble
LOCAL P%, L%, gap%
DIM gap% &7FF, P% &7FF, L% &7FF
[OPT 10
.bin2bcd
mov eax,[^bin%]
mov ebx,[^bcd%]
.loop
inc eax
cmp eax,ebx
jle loop
mov [^bin%],eax
ret
]
ENDPROC
|
| « Last Edit: Jun 20th, 2016, 02:40am by michael » |
Logged
|
I like making program generators and like reinventing the wheel
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #47 on: Jun 20th, 2016, 07:05am » |
|
Morning Michael, You will have to help me a little, I have had no contact with computer games for 30 years, What is Doom? I have seen some posters, but know no more. Your loop does what it says it counts to 2000001 and stops. What do you need help with? If you want it to stop at 2000000 change the jle loop to jne loop. This will keep looping while bin% and bcd% are not equal. The variables you have used imply you want to turn binary in to binary coded decimal?
Try this code
Code: DIM code% 200 : REM always reserve too much
DIM test 100 : REM reserve memory for variables (the assembler routine used here only needs 12 bytes, memory is cheap, reserve too much)
!test=0 : REM make memory location (32bit dword startimg at test) equal 0
!(test+4)=2000000 : REM make memory location (32bit dword startimg at test+4) equal 2000000 (The +4 is in bytes ie 32bits displacement)
FOR I% = 0 TO 3 STEP 3
P% = code%
[
opt I%
.start
mov eax, [test] ; REM moves the number stored in memory location test to eax
mov ebx, [test+4] ; REM moves the number stored in memory location test+4 to eax
.loop
inc eax
cmp eax, ebx
jne loop ; REM repeats until they are equal
mov [test+8], eax ; REM stores eax in memory location test+8
ret
]
NEXT I%
CALL start
PRINT "Done ";!(test+8)
There is really elegant way using the ecx register if all you want to do is create a loop.
Ric
|
| « Last Edit: Jun 20th, 2016, 07:29am by Ric » |
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
michael
Senior Member
member is offline


Posts: 335
|
 |
Re: 3D Gaming Project
« Reply #48 on: Jun 20th, 2016, 1:44pm » |
|
Here is a vid of the version of DOOM I am speaking of
https://www.youtube.com/watch?v=PEbLOnvCckA
|
|
Logged
|
I like making program generators and like reinventing the wheel
|
|
|
Ric
Full Member
member is offline


Gender: 
Posts: 136
|
 |
Re: 3D Gaming Project
« Reply #49 on: Jun 20th, 2016, 4:25pm » |
|
Can't see a reason why that's not achievable. The routines I am developing are to display true colour sprites in HD. So even if we can't get the initial speed, to replicate the graphics in that demo we could simply change the density to increase speed.
Did the code help or are you further on by now?
Ric
|
|
Logged
|
It's always possible, but not necessarily how you first thought. Chin up and try again.
|
|
|
|