Author Topic: your source here!  (Read 4566 times)

0 Members and 1 Guest are viewing this topic.

Offline saulotmalo

  • Jr. Member
  • **
  • Posts: 75
your source here!
« on: August 18, 2006, 05:45:27 AM »
hello, i've got an idea in order to inprove the next compo. First if i can't do this please remove the thread.

Well my idea is the next we can give a small amount of code in order any one can see an improve for him or for every one, this is the open source model.

first i want to be my :)

I'll give the comunity a set of 5 libraries made for use in pspgl

one for vectors
one for texture loading supporting tga and pcx
one for md2 model loading, suporting texturing and enable culling and glcommands
one for the use of fonts
one for the use of mp3 sound

you can download here

http://www.megaupload.com/?d=8SJVQSM6

i have add a little example and compiled it so any one can understant the library.

i have to give thanks to SG57 from pspupdates who has helped me a lot making the library he almost did all the font library :)




« Last Edit: August 18, 2006, 08:54:14 AM by saulotmalo »

Offline Payk

  • Full Member
  • ***
  • Posts: 197
    • NDSDEV.DE
Re: your source here!
« Reply #1 on: September 01, 2006, 04:44:03 PM »
Nice...but does the mp3 decode in arm7?
I also got a md2 loader...with one vertex-light calculations and reflection functions...it currently runs with 60 fps because of many precalculations :)

Offline saulotmalo

  • Jr. Member
  • **
  • Posts: 75
Re: your source here!
« Reply #2 on: September 02, 2006, 03:28:23 AM »
there is no use to precalculate a md2 model because you have to use interpolation so by precalculating it loses a lot of smoth movement....

at least this is only to help people i know this is not end here... i will support toon shading and i'll add normals to the model but after exams :)

Offline Payk

  • Full Member
  • ***
  • Posts: 197
    • NDSDEV.DE
Re: your source here!
« Reply #3 on: September 02, 2006, 03:32:27 AM »
damn....i made a big space between the discription of md2 and the word precalculations...no i didnt precalced the keyframes...it would cost to much space in ram..... 32bit * vertex* frames= way to much

Offline Payk

  • Full Member
  • ***
  • Posts: 197
    • NDSDEV.DE
Re: your source here!
« Reply #4 on: September 02, 2006, 03:35:20 AM »
Hey try out : payk.drunkencoders.com
then u may see what i could mean with precalc....static lights , mapheights, coolision datas, and stuff like that....that dynamic lights (fireflys in first room) and models arent precalced

Offline saulotmalo

  • Jr. Member
  • **
  • Posts: 75
Re: your source here!
« Reply #5 on: September 02, 2006, 09:29:19 AM »
that was what i mean... models can't be precalked... but i've already don't add light and when i'll add the normals i'll use a precalkeds ones ( my first version used recalculed every time the normals.. )

Offline Payk

  • Full Member
  • ***
  • Posts: 197
    • NDSDEV.DE
Re: your source here!
« Reply #6 on: September 02, 2006, 08:50:19 PM »
The Md2 have an index in each vertex-structure...it goes from 0-161.
There is a file aviable..it is called anorms.h. Those are float.
u can simply:

vec3_t anorms_table[162] = {
#include "anorms.h"
};

add them like this and then using floattov16 convert them when launching game. Then you have what u need. in renderscene use that index to overgive right normals...Runs fine and fast ;)

But i dont use glNormal3v16 or something...i dont use hardwarelights at all.


Offline saulotmalo

  • Jr. Member
  • **
  • Posts: 75
Re: your source here!
« Reply #7 on: September 02, 2006, 11:05:45 PM »
i know that already, is quite easy but i have no time, after exams i'll do it, but as i'm going to use my own shadder to render i think there is no use to set the normals but i don't know, i'll have to study a litle

thanks for de help! also how did you do the tonshading in your game? i don't have a ds and i can't try it but it looks prety good

Offline Payk

  • Full Member
  • ***
  • Posts: 197
    • NDSDEV.DE
Re: your source here!
« Reply #8 on: September 03, 2006, 01:44:58 AM »
Why do all think a border arround the model has somtihng to do with shading? No i use regular shading with own lightsystem.
Toonshading doesnt allow colored light and forces to use one or two hardwarelights. If u use them u cant use vertextcolor...for my lightsystem i use vertexcolor...so no toonshading....that border is quite simple. in polyfmt u need to seed a poly_id. 0 means no border...and other numbers are for the ds to know if those polys are same object. if not it draws a border...so dog may have id 1. and mushroom maybe 2....

Offline saulotmalo

  • Jr. Member
  • **
  • Posts: 75
Re: your source here!
« Reply #9 on: September 03, 2006, 09:26:23 PM »
amazing, i was thinking that it was toon shading, also your ligh system doens't overhead a lot the ds? i mean i would be faster to do toon shading in order to improve the speed?

Offline Payk

  • Full Member
  • ***
  • Posts: 197
    • NDSDEV.DE
Re: your source here!
« Reply #10 on: September 03, 2006, 09:38:16 PM »
Yes it would be faster, shure. But my engine already has 55-60 frames per second. There would be no reason to turn of smoothshading.

You know the 4 hardwarelights?
They are dirrectional loghts. That means they have a dirrection but not a position. So they are good for sun/moon lights but u cant place lights on the map. Its impossible.

Therefore i coded my own lights. They are somekind like dotlights. They dont have any dirrection. But they have positions. And i can place as much as i want. But how to do that? You know glColor3b? It allows u to give that vertices which folow a certain color. Based on that i made commands which check the lightcolor on current possition. It was hard to optimize that code.
And those lights arent mathematically correct. But they look awesome and have a great future. I try to make a hole light&shadow-engine.
Will be very cool for battles. Especially for casting spells.

I'm not pretty shure how much will be possible but if all things work with more then 30fps i am saticfied.
If u need help for optimizing codes...send me a pm.

Offline saulotmalo

  • Jr. Member
  • **
  • Posts: 75
Re: your source here!
« Reply #11 on: September 03, 2006, 11:04:49 PM »
it was a great idea, to do lights without doing it matematically correct but to do it a good look, i'll continue codding in a few weeks ( after the exams ) when i need help i'll tell you, also when i improve my library i'll tell you too

Offline Payk

  • Full Member
  • ***
  • Posts: 197
    • NDSDEV.DE
Re: your source here!
« Reply #12 on: September 03, 2006, 11:22:12 PM »
Yes thanx. Maybe i can help to improve that lib with some functions.
For creating terrains for example. Or ogg player...lets see when u finished your exams and good look with them. See yaa