PDA

View Full Version : Final3D SDL Engine 2007



andygfx
19-08-2007, 11:19 AM
It's true. I'm back, i have one unpublished 3D game engine under Win32 (with a lot of problems under Vista x64) I go ( again :) ) rewrite it but now with JEDI-SDL. Because I have not experincies with SDL ...

My questions are:

1) dglOpenGL or JEDI-SDL OpenGL units
2) class TString exist in SDL?
3) DXInput or SDL Input
4) DevIL lib or SDL_image
5) ODE or Newton (actualy i used Newton)
6) GLSL or Cg

technomage
19-08-2007, 11:35 AM
Hi

Welcome back :)

in answer to your questions, I would say

1) JEDI-SDL units - if you are using SDL these units have been modifed to work with SDL. They also support Opengl 2.0 (tested under windows and linux) I think the dlgOpengl units only support Opengl 1.5
2) TString exists in both Delphi and Free Pascal , so you can use TStrings OK.
3) SDL has it's own input system which under the hood under windows probably used dXInput, so I would stick with that. JEDI-SDL comes with an excellent input manager already SDLInput.pas
4) SDL_Image is good, but it depends on what image formats you want to support, I use SDL_Image in my engines.
5) I would abstract your physics interface in such a way that it doesn't matter, but newton has more support.
6) GLSL is supported by ATI and Nvidia so I would stick with that. I'm not sure if ATI supports Cg.

Hope this helps :)

I look foward to seeing you new engine is action, A3Dngine was great. BTW the SDL conversion of that engine is still available in the jedi-sdl cvs. So it you want to have a look at how I converted stuff to work with SDL feel free :)

Dean

andygfx
19-08-2007, 11:45 AM
Thx. OK i look on A3D conversion to SDL. Final3D 2006 isn't A3D - F3D is more next-gen engine ;).

andygfx
19-08-2007, 01:19 PM
So here is ZERO release:

http://final3d.intelligentdevelopment.sk/files/Final3D_0.0.zip

If you have any comments about conception, write me.

P.S: Final3D homepage comming latter ... now i must study SDL :))

andygfx
20-08-2007, 12:00 PM
Final3D® web page is here:

http://final3D.intelligentdevelopment.sk

... under construction ...

andygfx
21-08-2007, 10:09 PM
Final3D® SDL Engine ver 0.08.

Actual status of porting to SDL:

- WinXP x86/ Vista x64 / Linux (not tested)
- OpenGL 2.0
- SDL lib
- pascal language
- Viewport class
- HUD class
- Texture Factory class (currently is used DevIL lib)
- Font class
- Font Manager class (accept Nitrogen Font Studio 4 file - tga/composit)
- Image Manager class (will be used for GUI)
- SDL Input control class
- Movement control class
- Camera class
- Primitive Draw helper class

Sample code for:

- Font Manager
- Image/HUD manager
- Camera/Input control (FreeLook work with RightMouse Button)

ToDo:

- Skined GUI
- GUI Manager
- Scene loader
- VBO class
- Sprite3D Manager
- Billboard Manager
- Material manager
- Material Event Manager
- Surface Manager
- GLSL
- Shader Manager

Demo v 0.08 with source is possible download from my page http://final3d.intelligentdevelopment.sk

P.S.: I have problem with calc Mouse Delta X/Y, because i used in previous F3D, DXInput this values are returned from DXInput every time. Now i have created little fake for delta x.y with SDLInput, but isn't so good. I looking for a better solution or Your ideas

I waiting comment ... :)

technomage
22-08-2007, 07:23 AM
There is a function call is SDL to get the delta position since the last call.


SDL_GetRelativeMouseState


Dom - The Input manager needs to be updated to include this, I'll mail you the code. :) (my cvs still isn't working)

andygfx
22-08-2007, 07:29 AM
There is a function call is SDL to get the delta position since the last call.


SDL_GetRelativeMouseState


Dom - The Input manager needs to be updated to include this, I'll mail you the code. :) (my cvs still isn't working)

OK. THX. Work cool.

P.S.: I tried download A3D SDL from your CVS, but i can't find any working CVS client unde Vista x64. :(

WILL
22-08-2007, 02:34 PM
Well if you can't download from the CVS thats no problem at all. Dom has setup JEDI-SDL nightly snapshots from the CVS. You can get them at the JEDI-SDL homepage at http://jedi-sdl.pascalgamedevelopment.com/

andygfx
22-08-2007, 04:07 PM
1) About SDL_GetRelativeMouseState. If i now control scene on slow PC, work good, but on my C2D 2.6, mouse FreeLook sometimes jump about big delta :(

2) I have good eues, but link to nightly snapshot i can't find :( I have instaled this release -> http://jedi-sdl.pascalgamedevelopment.com/files/JEDI-SDLFullSetup.exe

savage
22-08-2007, 04:36 PM
1) About SDL_GetRelativeMouseState. If i now control scene on slow PC, work good, but on my C2D 2.6, mouse FreeLook sometimes jump about big delta :(

2) I have good eues, but ]http://jedi-sdl.pascalgamedevelopment.com/files/JEDI-SDLFullSetup.exe[/url]

1. What is a C2D 2.6?

2. That link is where the latest build is kept. So what you installed should be fine.

andygfx
22-08-2007, 04:54 PM
Core 2 Duo x6700 2.6MHz :) sorry it was bad shortcut ;)

Yes latest JEDI work fine

Now i try fix problem with mouse delta for freelook, because if VSync is ON the is speed OK, but if is OFF is slow. I think that i must calc Delta Tick Count for correct calc on different FPS. I any tutorial about TickCount and movement?

Currently i have my timer helper class writed so:


unit F3D_Timer;
{************************************************* *****************************}
{ F3D_TIMER:
{************************************************* *****************************}
interface

uses gl,sdl;

type TProcedureEvent = procedure of object;
{ The type of event that is called by the timer. }
Type TF3D_TimerEvent = procedure(Sender: TObject; FrameTime: Single) of object;


Type TF3D_Timer = class

private
m_lastTick : integer;
m_fpsDuration : single;
m_fpsFrames : integer;
m_fps : integer;
ElapsedTime:single;
public

constructor Create();
destructor Destroy;
function GetElapsedTime: Single;
function GetTickCount: Integer;
function GetFPS: Integer;
procedure Update();

end;



implementation

uses F3Dlib;

{************************************************* *****************************}
{ F3D_TIMER:
{************************************************* *****************************}

constructor TF3D_Timer.Create();
begin
inherited Create;
m_lastTick := 0;
end;

{************************************************* *****************************}
{ F3D_TIMER:
{************************************************* *****************************}

destructor TF3D_Timer.Destroy;
begin

inherited destroy;
end;

{************************************************* *****************************}
{ F3D_TIMER:
{************************************************* *****************************}
function TF3D_Timer.GetFPS: Integer;
begin
result:=self.m_fps;
end;


{************************************************* *****************************}
{ F3D_TIMER:
{************************************************* *****************************}
function TF3D_Timer.GetTickCount: Integer;
begin
result:=m_lastTick;
end;


{************************************************* *****************************}
{ F3D_TIMER:
{************************************************* *****************************}
function TF3D_Timer.GetElapsedTime: Single;
begin
result:=ElapsedTime*100;
end;

{************************************************* *****************************}
{ F3D_TIMER:
{************************************************* *****************************}
procedure TF3D_Timer.Update;
var
tick : integer;
begin
// get the current tick value
tick := SDL_GetTicks;
// calculate the amount of elapsed seconds
ElapsedTime := ( tick - m_lastTick ) / 1000.0;
if ElapsedTime = 0 then
exit;
// adjust fps counter
m_fpsDuration := m_fpsDuration + ElapsedTime;
if ( m_fpsDuration >= 1.0 ) then
begin
m_fps := round( m_fpsFrames / m_fpsDuration );
m_fpsDuration := 0.0;
m_fpsFrames := 0;
end;
m_lastTick := tick;
inc( m_fpsFrames );
glFlush();
end;


end.

savage
22-08-2007, 04:58 PM
Dom - The Input manager needs to be updated to include this, I'll mail you the code. :) (my cvs still isn't working)

I'm sure I had implemented this at some point. But maybe I over wrote it. I'll try and check it in tonight after I compare what I currently have.

andygfx
22-08-2007, 05:19 PM
OK. THX. I will continue on F3D in tonight too (>22:00 CET ) :) If i don't forget, I switch my ICQ ON.

Now i must go play with my little daughter (she has 7 month) ....

savage
22-08-2007, 09:38 PM
It's all checked in Dean.

andygfx
22-08-2007, 09:42 PM
Just now i one hour find which extension i need for ARB vertex/fragment shader :(

for this now i have:

// reset
if (ProgramObject <> 0) then glDeleteObjectARB(ProgramObject);
if (VertexShaderObject <> 0) then glDeleteObjectARB(VertexShaderObject);
if (FragmentShaderObject <> 0) then glDeleteObjectARB(FragmentShaderObject);

for this i can't find neede extension:

// create
ProgramObject := glCreateProgramObjectARB();
VertexShaderObject := glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
FragmentShaderObject := glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);

andygfx
22-08-2007, 09:45 PM
hehe. I have now all needed.

'GL_ARB_vertex_program',
'GL_ARB_vertex_shader',
'GL_ARB_fragment_shader',
'GL_ARB_shader_objects',
'GL_ARB_shading_language_100',

andygfx
22-08-2007, 10:15 PM
New release ver. 0.09 with billboard sample / GLSL shader

Features:

WinXP x86/ Vista x64 / Linux (not tested)
OpenGL 2.0
SDL lib
pascal language
Viewport class
HUD class
Texture Factory class (currently is used DevIL lib)
Font class
Font Manager class (accept Nitrogen Font Studio 4 file - tga/composit)
Image Manager class (will be used for GUI)
SDL Input control class
Movement control class
Camera class
Billboard Manager (new)
Material manager (new)
Material Event Manager (new)
Surface Manager (new)
GLSL (new)
Shader Manager (new)

ToDo:

Skined GUI
GUI Manager
Scene loader
VBO class
LUA wrapper for all classes
Sprite2D/3D Manager
Documentation

SRC/BIN from http://final3d.intelligentdevelopment.sk/

savage
22-08-2007, 10:36 PM
I see you've written your own control class. Are you aware that JEDI-SDL ships with it's own SDL Input Manager that should handle Keyboard, Mouse and Joysticks. Have a look at sdlinput.pas. It may save you some time.

andygfx
23-08-2007, 02:15 PM
[1]


It's not fully true, because my Input class is only simple extension on existinng SDLInput.


type TF3D_Input = class

private
delta &#58; TF3D_Vector2f;
old_pos &#58; TPoint;
Manager &#58; TSDLInputManager;
public
constructor create;
destructor destroy;
procedure Update&#40;&#41;;
function IsKeyDown&#40;key&#58;integer&#41;&#58;boolean;
function IsButtonDown&#40;btn&#58;integer&#41;&#58;boolean;
function IsKeyUp&#40;key&#58;integer&#41;&#58;boolean;
procedure ShowInfo&#40;sx&#58; integer; sy&#58; integer&#41;;
function GetMouseDelta&#58;TF3D_Vector2f;



end;

implementation

uses F3Dlib;

&#123;************************************************* *****************************&#125;
&#123; F3D INPUT CONTROL&#58;
&#123;************************************************* *****************************&#125;
constructor TF3D_Input.create;
begin
inherited create;
Manager &#58;= TSDLInputManager.Create&#40;&#91;itKeyBoard, itMouse, itJoystick&#93;&#41;;
end;

&#123;************************************************* *****************************&#125;
&#123; F3D INPUT CONTROL&#58;
&#123;************************************************* *****************************&#125;
destructor TF3D_Input.destroy;
begin
inherited destroy;
end;

&#123;************************************************* *****************************&#125;
&#123; F3D INPUT CONTROL&#58;
&#123;************************************************* *****************************&#125;
procedure TF3D_Input.Update&#40;&#41;;
var dx,dy&#58;integer;
begin

SDL_GetRelativeMouseState&#40;dx,dy&#41;;
delta.x &#58;= dx;
delta.y &#58;= dy;

self.Manager.UpdateInputs&#40;F3D.SDL.event&#41;;

end;

&#123;************************************************* *****************************&#125;
&#123; F3D INPUT CONTROL&#58; KEY DOWN
&#123;************************************************* *****************************&#125;
function TF3D_Input.IsKeyDown&#40;key&#58;integer&#41;&#58;boolean;
begin

if self.Manager.KeyBoard.IsKeyDown&#40;key&#41; then result&#58;=true
else result&#58;=false;

end;


&#123;************************************************* *****************************&#125;
&#123; F3D INPUT CONTROL&#58; MOUSE BUTTON DOWN
&#123;************************************************* *****************************&#125;
function TF3D_Input.IsButtonDown&#40;btn&#58;integer&#41;&#58;boolean;
begin

if self.Manager.Mouse.MouseIsDown&#40;btn&#41; then result&#58;=false
else result&#58;=true;

end;

&#123;************************************************* *****************************&#125;
&#123; F3D INPUT CONTROL&#58; KEY UP
&#123;************************************************* *****************************&#125;
function TF3D_Input.IsKeyUp&#40;key&#58;integer&#41;&#58;boolean;
begin

if self.Manager.KeyBoard.IsKeyDown&#40;key&#41; then result&#58;=true
else result&#58;=false;



end;

&#123;************************************************* *****************************&#125;
&#123; F3D INPUT CONTROL&#58; Get Delta mouse move
&#123;************************************************* *****************************&#125;
function TF3D_Input.GetMouseDelta&#58;TF3D_Vector2f;
begin
result&#58;=self.delta;
end;


&#123;************************************************* *****************************&#125;
&#123; F3D INPUT CONTROL&#58; DrawINFO
&#123;************************************************* *****************************&#125;
procedure TF3D_Input.ShowInfo&#40;sx&#58; integer; sy&#58; integer&#41;;
var BTN_0, BTN_1, BTN_2&#58; integer;
WHEEL_UP,WHEEL_DOWN&#58;integer;
begin
if &#40;not F3D.Config.use_infoscreen&#41; then exit;

glDisable&#40;GL_TEXTURE_2D&#41;;
glEnable&#40;GL_BLEND&#41;;
glBlendFunc&#40;GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA&#41;;
glColor4f&#40;0, 0, 0, 0.5&#41;;
F3D.Draw.Rectangle&#40;sx - 8, sy - 4, sx + 256 + 16, sy + 84&#41;;

glDisable&#40;GL_BLEND&#41;;

BTN_0 &#58;= 0;
if self.Manager.Mouse.MouseIsUp&#40;SDL_BUTTON_LEFT&#41; then BTN_0 &#58;= 1;
BTN_1 &#58;= 0;
if self.Manager.Mouse.MouseIsUp&#40;SDL_BUTTON_MIDDLE&#41; then BTN_1 &#58;= 1;
BTN_2 &#58;= 0;
if self.Manager.Mouse.MouseIsUp&#40;SDL_BUTTON_RIGHT&#41; then BTN_2 &#58;= 1;
WHEEL_UP&#58;=0;
WHEEL_DOWN&#58;=0;
if self.Manager.Mouse.MouseIsDown&#40;SDL_BUTTON_WHEELUP&#41; then WHEEL_UP &#58;= 1; // ??????????
if self.Manager.Mouse.MouseIsDown&#40;SDL_BUTTON_WHEELDOW N&#41; then WHEEL_DOWN &#58;= 1; // ??????????

glDisable&#40;GL_BLEND&#41;;
F3D.Hud.SetFontColor&#40;'CourierNew', SetColor4f&#40;1, 0.5, 0, 1&#41;&#41;;
F3D.Hud.Print&#40;'CourierNew', sx, sy + 13 * 0, 'MOUSE CONTROL&#58;'&#41;;
F3D.Hud.SetFontColor&#40;'CourierNew', SetColor4f&#40;1, 1, 1, 1&#41;&#41;;
F3D.Hud.Print&#40;'CourierNew', sx, sy + 13 * 1, format&#40;'MOUSE DELTA &#58; %8.4f %8.4f ', &#91;self.delta.x,self.delta.y&#93;&#41;&#41;;
F3D.Hud.Print&#40;'CourierNew', sx, sy + 13 * 2, format&#40;'MOUSE POS &#58; %4d %4d ', &#91;self.Manager.Mouse.MousePosition.X, self.Manager.Mouse.MousePosition.Y&#93;&#41;&#41;;
F3D.Hud.Print&#40;'CourierNew', sx, sy + 13 * 3, format&#40;'MOUSE BTN &#58; &#91;%1d&#93;&#91;%1d&#93;&#91;%1d&#93; ', &#91;BTN_0, BTN_1, BTN_2&#93;&#41;&#41;;
F3D.Hud.Print&#40;'CourierNew', sx, sy + 13 * 4, format&#40;'MOUSE WHEEL UP &#58; &#91;%1d&#93; ', &#91;WHEEL_UP&#93;&#41;&#41;;
F3D.Hud.Print&#40;'CourierNew', sx, sy + 13 * 5, format&#40;'MOUSE WHEEL DW &#58; &#91;%1d&#93; ', &#91;WHEEL_DOWN&#93;&#41;&#41;;
end;
end.


[2]

I found problem with mouse delta and LAG values :) answer i found in vry good document which help me. Here is part:

Timers
Timers are not something every game uses so you might be wondering why I’m covering them in this article. Trying to get SDL timers to work caused me a lot of aggravation and I spent hours trying to figure out what the problem was. I’m writing about SDL timers to save you the aggravation I went through.
A timer is a function the operating system calls periodically. You get to specify how often the timer fires, which is how often the operating system calls the timer. Use a timer when you want to do something repeatedly in your program at regular time intervals.


... now i have implemented USER TIMER and all is OK. Tonight will be released as ver 0.10 ;)

part of code:


function SDLLoop&#40;interval&#58; Uint32; param&#58; Pointer &#41;&#58; Integer;
var event&#58;TSDL_Event;
begin
event.type_ &#58;= SDL_USEREVENT;
event.user.code &#58;= RUN_FINAL3D_LOOP;
event.user.data1 &#58;=0;
event.user.data2 &#58;=0;

SDL_PushEvent&#40;@event&#41;;

result &#58;= interval;
end;

....


// initialize timer
SDL_Init&#40;SDL_INIT_TIMER&#41;;
self.Timer &#58;= SDL_AddTimer&#40;20,@SDLLoop,nil&#41;;


....

begin

F3D &#58;= TF3D.Create&#40;&#41;;
F3D.Initialize&#40;&#41;;

APP_DO_INIT&#40;&#41;;

Done &#58;= False;

while &#40; not Done &#41; do
begin
while &#40; SDL_PollEvent&#40; @F3D.SDL.event &#41; = 1 &#41; do
begin
case F3D.SDL.event.type_ of
SDL_QUITEV &#58; Done &#58;= true;
SDL_USEREVENT &#58;
begin
APP_DO_LOOP&#40; F3D.SDL.event.user.code&#41;;
end;

end;

end;
end;
SDL_QUIT;
Halt&#40;0&#41;;
end.


....



procedure APP_DO_LOOP&#40; code &#58; integer &#41;;
begin
case code of
RUN_FINAL3D_LOOP &#58; APP_DO_RENDER&#40;&#41;;
end;
end;



[3]

WHEEL_UP and WHEEL_DOWN return always 1 :(((

WILL
23-08-2007, 03:50 PM
Hey Andy, I've been worked with ll of the keyboard, joystick and mouse controls under SDL myself so if you don't understand something feel free to ask, I should know the answer. ;)

I've created my own library to extend the usage of the existing SDL functions allowing for user-defined controls and such.

One of the tricky parts was figuring out a way to detect mouse wheel scrolling. I did this by creating a record/class that simply turned on a flag for the appropriate direction once the MWB event was found in the event queue. I also made a 'ResetMouse' function that would take down the flag as there was no other was to detect that the user has stopped scrolling. Doesn't exist as far as JEDI-SDL BETA 1 is concerned.

If you run your own reset code after you are done your player controls functionality code, it should be a simple matter of waiting to see if the wheel is scrolled again the next frame. I actually found this to be a simple and easy and accurate way to determine if the player is scrolling currently or not.

andygfx
23-08-2007, 04:44 PM
If I good understand, you have finished lib for game Input defined by user. OK. Then i don't need implementing it to F3D. But then i need source for including to F3D. When willl be released?

P.S:Solution with timer dont work good on my home PC :((((((( Mouse FreeLook sometimes, jump about big angle (is calculated from Mouse Delta X/Y)

If you have time, plese look on my code, what is wrong in my logic.

http://final3d.intelligentdevelopment.sk/files/F3D_test.zip

In Win32 F3D version i never had this problems, because i used DXInput and DXTimer and latter my Timer class. With correct working timer + input i can't continue :(

My old Timer class:


unit F3D_Timer;

interface

uses Windows, Controls, Messages, SysUtils, Classes, Forms,

dglOpenGL;

type TProcedureEvent = procedure of object;
{ The type of event that is called by the timer. }
Type TF3D_TimerEvent = procedure(Sender: TObject; FrameTime: Single) of object;


Type TF3D_Timer = class(TComponent)
private
{ Private declarations }
FEnabled : Boolean;
FActive : Boolean;
FActiveOnly : Boolean;
FInterval : Cardinal;
FInitialized : Boolean;
FFrequency : Int64;

// Event
FOnTimer : TF3D_TimerEvent;

// Time
FAppStart : Single;
FLastTime : Single;

// Frame information
FFrameTimes : Single;
FFrameCount : Int64;
FFrameRate : Integer;
FFrameRateCounter: Integer;
FFrameRateTime : Single;
FDeltaTime : Single;

function GetCurrentTime: Single;
function GetElapsedTime: Single;


function AppProc(var Message: TMessage): Boolean;
procedure AppIdle(Sender: TObject; var Done: Boolean);

procedure Finalize;
procedure Initialize;
procedure Resume;
procedure Suspend;

procedure SetActiveOnly(Value: Boolean);
procedure SetEnabled (Value: Boolean);
procedure SetInterval (Value: Cardinal);
protected
{@exclude}
procedure Loaded; override;
public
OnBeginFrame :TProcedureEvent;
OnEndFrame :TProcedureEvent;

DeltaTime : Single;
{@exclude}
constructor Create(AOwner: TComponent); override;
{@exclude}
destructor Destroy; override;
function NPXDeltaTime: Single;
{ The current framerate, is weighted over the last 500 ms. }
property FrameRate : Integer read FFrameRate;
{ The number of frames rendered since program start. }
property FrameCount : Int64 read FFrameCount;
{ The time elapsed since program start, in milliseconds. }
property ElapsedTime: Single read GetElapsedTime;
published
{ Determines if the timer shall be active or not. }
property Enabled : Boolean read FEnabled write SetEnabled;
{ The interval of the timer, in milliseconds. If zero then max speed. }
property Interval : Cardinal read FInterval write SetInterval;
{ This tells if the timer shall be disabled when the window loses focus. }
property ActiveOnly : Boolean read FActiveOnly write SetActiveOnly;
{ The main timer event, this is called with the interval in milliseconds. }
property OnTimer : TF3D_TimerEvent read FOnTimer write FOnTimer;
end;



implementation




// Class TGLTimer
//================================================== ============================
constructor TF3D_Timer.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FActiveOnly:= True;
FActive := True;
FEnabled := True;
Interval := 1;
Application.HookMainWindow(AppProc);

QueryPerformanceFrequency(FFrequency);
FAppStart :=GetCurrentTime;
FFramerateTime :=FAppStart;
FLastTime :=FAppStart;
FFrameRate :=0;
FFrameRateCounter :=0;
FFrameCount :=0;
end;

//------------------------------------------------------------------------------
destructor TF3D_Timer.Destroy;
begin
Finalize;
Application.UnHookMainWindow(AppProc);
inherited ;
end;


//------------------------------------------------------------------------------
procedure TF3D_Timer.AppIdle(Sender: TObject; var Done: Boolean);
var FrameTime : Single;
var FrameRateTime: Single;
begin
Done := False;
FrameTime := (GetCurrentTime - FLastTime);
IF (FrameTime >= FInterval) then begin
FLastTime:=GetCurrentTime;

Inc(FFramerateCounter);

FrameRateTime:=(FLastTime - FFrameRateTime);
IF FrameRateTime > 1000 then begin
IF FFramerateCounter = 0 then FFramerateCounter:=1;
FFrameRate := Round(1000/(FrameRateTime/FFramerateCounter));
FFramerateCounter := 0;
FFramerateTime := GetCurrentTime();
end;

FDeltaTime:=(FFrameTimes + FrameTime) * 0.5 ;
DeltaTime:=FDeltaTime * 0.1;
if Assigned(FOnTimer) then OnBeginFrame();
if Assigned(FOnTimer) then FOnTimer(Self, FDeltaTime);

if Assigned(FOnTimer) then OnEndFrame();


FFrameTimes:=FrameTime;

Inc(FFrameCount);
end;
end;

//------------------------------------------------------------------------------
function TF3D_Timer.AppProc(var Message: TMessage): Boolean;
begin
Result:= False;
case Message.Msg of
CM_ACTIVATE : If FInitialized and FActiveOnly then Resume;
CM_DEACTIVATE: If FInitialized and FActiveOnly then Suspend;
end;
end;

//------------------------------------------------------------------------------
procedure TF3D_Timer.Initialize;
begin
Finalize;

if ActiveOnly then begin
if Application.Active then
Resume;
end else
Resume;
FInitialized := True;
end;

//------------------------------------------------------------------------------
procedure TF3D_Timer.Finalize;
begin
if FInitialized then begin
Suspend;
FInitialized := False;
end;
end;

//------------------------------------------------------------------------------
procedure TF3D_Timer.Loaded;
begin
inherited Loaded;
if (not (csDesigning in ComponentState)) and FEnabled then
Initialize;
end;

//------------------------------------------------------------------------------
procedure TF3D_Timer.Resume;
begin
// FAppStart:=FAppStart + (GetCurrentTime-FSuspendTime);
FLastTime:=GetCurrentTime;

Application.OnIdle:= AppIdle;
end;

//------------------------------------------------------------------------------
procedure TF3D_Timer.Suspend;
begin
// FSuspendTime:=GetCurrentTime;
Application.OnIdle:= nil;
end;

//------------------------------------------------------------------------------
procedure TF3D_Timer.SetActiveOnly(Value: Boolean);
begin
if FActiveOnly<>Value then
begin
FActiveOnly := Value;

if Application.Active and FActiveOnly then
if FInitialized and FActiveOnly then Suspend;
end;
end;

//------------------------------------------------------------------------------
procedure TF3D_Timer.SetEnabled(Value: Boolean);
begin
if FEnabled<>Value then
begin
FEnabled := Value;
if ComponentState*[csReading, csLoading]=[] then
if FEnabled then Initialize else Finalize;
end;
end;

//------------------------------------------------------------------------------
procedure TF3D_Timer.SetInterval(Value: Cardinal);
begin
FInterval:= Value;
end;



//------------------------------------------------------------------------------
function TF3D_Timer.GetCurrentTime: Single;
var Time : Int64;
begin
QueryPerformanceCounter(Time);
Result:= (Time / FFrequency) * 1000;
end;

//------------------------------------------------------------------------------
function TF3D_Timer.GetElapsedTime: Single;
begin
Result:=GetCurrentTime - FAppStart;
end;


function TF3D_Timer.NPXDeltaTime: Single;
var Time : Int64;
begin
QueryPerformanceCounter(Time);
Result:=((Time - FAppStart)/(FFrequency*1000))*0.01;
end;


end.


Now i seems as stupid bastard :)

andygfx
23-08-2007, 10:37 PM
new version 0.10 :



- VBO Manager with automatic schiwtch between Vertex buffer object or Vertex Array
- Geometry Class
- Models Data Manager class
- Skybox class
- Startup preloader for textures, materials, events, models defined in external file



- partly fixed problem with mouse control, but for better scene control you must switch VSync ON - i wating for help :(

- all scene items as models, textures, surfaces, events must by added first to precache file definition and the load before are used.

- included demos are only as samples howto work with classes, don't show visual possibility ;)

savage
24-08-2007, 12:13 AM
WHEEL_UP and WHEEL_DOWN return always 1 :(((

That is because SDL does not tell you how many pixels have moved only that the event has occured. If it is always 1 make sure that the SDL_PumpEvents; to update the various structures.

Btw, the SDlInputManger supports hooking events up to things like OnMouseWheel which will fire every time a wheel is moved and it will tell you wether it was up or down.

savage
24-08-2007, 12:14 AM
Btw, have you looked at sdlticks.pas and the TimerClass there in?

andygfx
24-08-2007, 03:28 PM
Btw, have you looked at sdlticks.pas and the TimerClass there in?

NO. I will try this tonight.

andygfx
24-08-2007, 10:03 PM
New release of F3D v0.11

Actual features list:

- WinXP x86/ Vista x64 / Linux (not tested)
- OpenGL 2.0
- SDL lib
- pascal language
- Viewport class
- HUD class
- Texture Factory class (currently is used DevIL lib)
- Font class
- Font Manager class (accept Nitrogen Font Studio 4 file - tga/composit)
- Image Manager class (will be used for GUI)
- SDL Input control class
- Movement control class
- Camera class
- Billboard Manager
- Material manager
- Material Event Manager
- Surface Manager
- GLSL
- Shader Manager
- VBO Manager with automatic schiwtch between Vertex object or Array
- Geometry Class
- Models Data Manager class
- Skybox class
- Startup preloader for textures, materials, events, models defined in external file
- Scene Manager class
- Newton Physics class

ToDo:

- Skined GUI
- GUI Manager
- Sprite3D Manager
- CAL3D Animation class
- fix problem with VBO on Vista
- fix problem with mouse movement
- LUA wrapper for all classes

SRC/BIN from http://final3d.intelligentdevelopment.sk/

arthurprs
25-08-2007, 02:54 PM
Its a framework of openGL + SDL :?:

andygfx
25-08-2007, 03:57 PM
Yes. Download and try. If you have comments write me.

Reiter
25-08-2007, 04:27 PM
Hi andygfx. I love the idea of having a modern 3D engine using opengl + sdl! Will check it out as soon I have the time to do so. Maybe I will use it for an own project then :). So keep on working :D ...

arthurprs
25-08-2007, 04:29 PM
Yes. Download and try. If you have comments write me.

Downloaded and instaled, its suitable for 2d game ? :?

and it runs on Ubuntu ?

andygfx
25-08-2007, 04:39 PM
thx

andygfx
25-08-2007, 10:50 PM
New release 0.12:

new Features:

- LUA Script class
- GLSL Lua wrapper
- CAMERA Lua wrapper
- FONT Lua wrapper
- GUI Lua wrapper
- GUI ITEM window
- GUI ITEM label
- GUI ITEM button
- GUI ITEM checkbox
- GUI ITEM image button
- GUI ITEM options
- GUI ITEM panel
- GUI ITEM vertical slider
- GUI ITEM horizontal slider
- GUI Manager class


ToDo:

- Sprite3D Manager
- CAL3D Animation class
- Terrain class
- Package class
- Light Manager
- Music/Sound Manager class
- Animation Manager
- Postrender screen FX

SRC/BIN: http://final3d.intelligentdevelopment.sk/

andygfx
25-08-2007, 11:19 PM
Yes. Download and try. If you have comments write me.

Downloaded and instaled, its suitable for 2d game ? :?

and it runs on Ubuntu ?

1) Not now, but i have in ToDo to add class for 2D game via Sprite2D Manager.

2) Not tested under Linux :(

savage
26-08-2007, 09:25 AM
It crashes on my machine, which runs HL2 and the beginning of the BioShock demo without any problems.

Could this be the problem ( taken from log file ) :


STATUS INFO : @ 10:22:14 MSG : --------------------------------------------------------------- IN : GUI CLASS

STATUS INFO : @ 10:22:14 MSG : [GUI - THEME] IN : GUI CLASS

STATUS INFO : @ 10:22:14 MSG : --------------------------------------------------------------- IN : GUI CLASS

STATUS INFO : @ 10:22:14 MSG : load GUI theme definition: data/gui/F3Dskin.theme IN : GUI CLASS

STATUS INFO : @ 10:22:14 MSG : Load : data/textures/gui/theme/default/WINDOW_00_a.psd IN : TEXTURE FACTORY

STATUS INFO : @ 10:22:14 MSG : not loaded : -1 IN : TEXTURE FACTORY

STATUS INFO : @ 10:22:14 MSG : loading IN : TEXTURE FACTORY

STATUS INFO : @ 10:22:14 MSG : assigned. IN : TEXTURE FACTORY

STATUS INFO : @ 10:22:14 MSG : - skin_part_ID : 0 IN : GUI CLASS

STATUS INFO : @ 10:22:14 MSG : - skin_part_name : WINDOW_00_a IN : GUI CLASS

STATUS INFO : @ 10:22:14 MSG : - image_file : data/textures/gui/theme/default/WINDOW_00_a.psd IN : GUI CLASS

STATUS INFO : @ 10:22:14 MSG : - image_ID : 0 IN : GUI CLASS

savage
26-08-2007, 09:45 AM
Ok I recompiled the source and it now seems to work. Btw, you have a ton of hints and warnings in your code, most of which seem to stem from not using the "override;" keyword on your Destroy method in you classes. I know this may not be a priority, but cleaning these H&Ws up will help you track down bugs more easily later on.

A bug I noticed when playing with the demo is that on the sound slider, if you change it's position then move the Window, the slider jumps a few pixels in the -Y direction.

Also the depth setting of the spinning logo seems a bit odd as it on top of everything nor is it below everything, but maybe this was intentional.

Well I hope this helps.

andygfx
26-08-2007, 09:54 AM
Btw, you have a ton of hints and warnings in your code, most of which seem to stem from not using the "override;" keyword on your Destroy method in you classes. I know this may not be a priority, but cleaning these H&Ws up will help you track down bugs more easily later on.

- yes. because it's from WIn32 version rewrited, now it's my first priority - clean up code


A bug I noticed when playing with the demo is that on the sound slider, if you change it's position then move the Window, the slider jumps a few pixels in the -Y direction.

- oops. it's a bug.



Also the depth setting of the spinning logo seems a bit odd as it on top of everything nor is it below everything, but maybe this was intentional.


GUI is drawed inside APP_RENDER_2D fnc and Hud is drawed at end of APP_DO_RENDER. That's all. Isn't a bug. If is neede change it so:

procedure APP_RENDER_2D();
begin

F3D.Hud.SetFontColor('fixedsys',SetColor4f(1,1,1,1 ));
F3D.Hud.Print('Impact', 0, 0, 'Final3D® Engine 2007 - ver. 0.09');

F3D.Hud.ImageList.Image[SMALL_LOGO_ID].Angle := F3D.Hud.ImageList.Image[SMALL_LOGO_ID].Angle+(F3D.Timer.GetElapsedTime);


F3D.Viewport.DrawInfo(F3D.Config.r_viewport_width - 272, F3D.Config.r_viewport_height - 128 - 148);
F3D.InputControl.ShowInfo(F3D.Config.r_viewport_wi dth - 272, F3D.Config.r_viewport_height - 128 - 84);
F3D.Cameras.DrawInfo(0, F3D.Config.r_viewport_width - 272, F3D.Config.r_viewport_height - 128);

F3D.Hud.ImageList.Render();
F3D.GUI.Render();

end;


procedure APP_DO_RENDER();
begin

F3D.Timer.Update();

F3D.Viewport.Clear(0.5,0.5,0.5,1);
F3D.Viewport.BeginRender3D();

// .... 3D SCENE code here .................................................. .

APP_RENDER_3D();

// .... 3D SCENE code here ..............................................[END]
F3D.Textures.InActiveLayers();
F3D.Viewport.EndRender3D();
F3D.Viewport.BeginRender2D();
// .... 2D SCENE code here .................................................. .

APP_RENDER_2D();

// .... 2D SCENE code here ..............................................[END]

F3D.Viewport.EndRender2D();
F3D.Viewport.Flip();
end;

detvog
26-08-2007, 11:22 AM
Hi, andygfx

nice to see you.
You work on a new engine. great. (the old a3d ?)

what version of delphi do you use and how do you make a level ?








Sorry for my bad english.
I like the old a3d.

andygfx
26-08-2007, 11:39 AM
1) Is similar to A3D but isn't A3D :)

2) now a haven't plan for how to make LEVEL, for now i have writed exporter to my f3da format from Maya. F3DA file format is very simple:


&#91;+O&#93;<str>&#58;pCubeShape1;
&#91;+CF&#93;<int>&#58;12;
&#91;+CV&#93;<int>&#58;8;
&#91;-O&#93;<str>&#58;Create;
&#91;+F&#93;<int>&#58;0;
&#91;vA&#93;<v3f>&#58;-0.5|-0.5|0.5;
&#91;vB&#93;<v3f>&#58;0.5|-0.5|0.5;
&#91;vC&#93;<v3f>&#58;-0.5|0.5|0.5;
&#91;cA&#93;<c4f>&#58;1|1|1|1;
&#91;cB&#93;<c4f>&#58;1|1|1|1;
&#91;cC&#93;<c4f>&#58;1|1|1|1;
&#91;nA&#93;<v3f>&#58;0|0|1;
&#91;nB&#93;<v3f>&#58;0|0|1;
&#91;nC&#93;<v3f>&#58;0|0|1;
&#91;tA&#93;<v3f>&#58;1|0|0;
&#91;tB&#93;<v3f>&#58;1|0|0;
&#91;tC&#93;<v3f>&#58;1|0|0;
&#91;bA&#93;<v3f>&#58;0|1|0;
&#91;bB&#93;<v3f>&#58;0|1|0;
&#91;bC&#93;<v3f>&#58;0|1|0;
&#91;uv0A&#93;<v2f>&#58;0|0;
&#91;uv0B&#93;<v2f>&#58;1|0;
&#91;uv0C&#93;<v2f>&#58;0|1;
&#91;mat&#93;<str>&#58;mat_cube;
&#91;-F&#93;<str>&#58;Create;
&#91;+F&#93;<int>&#58;1;
&#91;vA&#93;<v3f>&#58;0.5|-0.5|0.5;
&#91;vB&#93;<v3f>&#58;0.5|0.5|0.5;
&#91;vC&#93;<v3f>&#58;-0.5|0.5|0.5;
&#91;cA&#93;<c4f>&#58;1|1|1|1;
&#91;cB&#93;<c4f>&#58;1|1|1|1;
&#91;cC&#93;<c4f>&#58;1|1|1|1;
&#91;nA&#93;<v3f>&#58;0|0|1;
&#91;nB&#93;<v3f>&#58;0|0|1;
&#91;nC&#93;<v3f>&#58;0|0|1;
&#91;tA&#93;<v3f>&#58;1|0|0;
&#91;tB&#93;<v3f>&#58;1|0|0;
&#91;tC&#93;<v3f>&#58;1|0|0;
&#91;bA&#93;<v3f>&#58;0|1|0;
&#91;bB&#93;<v3f>&#58;0|1|0;
&#91;bC&#93;<v3f>&#58;0|1|0;
&#91;uv0A&#93;<v2f>&#58;1|0;
&#91;uv0B&#93;<v2f>&#58;1|1;
&#91;uv0C&#93;<v2f>&#58;0|1;
&#91;mat&#93;<str>&#58;mat_cube;
&#91;-F&#93;<str>&#58;Create;
&#91;+F&#93;<int>&#58;2;
&#91;vA&#93;<v3f>&#58;-0.5|0.5|0.5;
&#91;vB&#93;<v3f>&#58;0.5|0.5|0.5;
&#91;vC&#93;<v3f>&#58;-0.5|0.5|-0.5;
&#91;cA&#93;<c4f>&#58;1|1|1|1;
&#91;cB&#93;<c4f>&#58;1|1|1|1;
&#91;cC&#93;<c4f>&#58;1|1|1|1;
&#91;nA&#93;<v3f>&#58;0|1|0;
&#91;nB&#93;<v3f>&#58;0|1|0;
&#91;nC&#93;<v3f>&#58;0|1|0;
&#91;tA&#93;<v3f>&#58;1|0|0;
&#91;tB&#93;<v3f>&#58;1|0|0;
&#91;tC&#93;<v3f>&#58;1|0|0;
&#91;bA&#93;<v3f>&#58;0|1|0;
&#91;bB&#93;<v3f>&#58;0|1|0;
&#91;bC&#93;<v3f>&#58;0|1|0;
&#91;uv0A&#93;<v2f>&#58;0|1;
&#91;uv0B&#93;<v2f>&#58;1|1;
&#91;uv0C&#93;<v2f>&#58;0|2;
&#91;mat&#93;<str>&#58;mat_cube;
&#91;-F&#93;<str>&#58;Create;
&#91;+F&#93;<int>&#58;3;
&#91;vA&#93;<v3f>&#58;0.5|0.5|0.5;
&#91;vB&#93;<v3f>&#58;0.5|0.5|-0.5;
&#91;vC&#93;<v3f>&#58;-0.5|0.5|-0.5;
&#91;cA&#93;<c4f>&#58;1|1|1|1;
&#91;cB&#93;<c4f>&#58;1|1|1|1;
&#91;cC&#93;<c4f>&#58;1|1|1|1;
&#91;nA&#93;<v3f>&#58;0|1|0;
&#91;nB&#93;<v3f>&#58;0|1|0;
&#91;nC&#93;<v3f>&#58;0|1|0;
&#91;tA&#93;<v3f>&#58;1|0|0;
&#91;tB&#93;<v3f>&#58;1|0|0;
&#91;tC&#93;<v3f>&#58;1|0|0;
&#91;bA&#93;<v3f>&#58;0|1|0;
&#91;bB&#93;<v3f>&#58;0|1|0;
&#91;bC&#93;<v3f>&#58;0|1|0;
&#91;uv0A&#93;<v2f>&#58;1|1;
&#91;uv0B&#93;<v2f>&#58;1|2;
&#91;uv0C&#93;<v2f>&#58;0|2;
&#91;mat&#93;<str>&#58;mat_cube;
&#91;-F&#93;<str>&#58;Create;
&#91;+F&#93;<int>&#58;4;
&#91;vA&#93;<v3f>&#58;-0.5|0.5|-0.5;
&#91;vB&#93;<v3f>&#58;0.5|0.5|-0.5;
&#91;vC&#93;<v3f>&#58;-0.5|-0.5|-0.5;
&#91;cA&#93;<c4f>&#58;1|1|1|1;
&#91;cB&#93;<c4f>&#58;1|1|1|1;
&#91;cC&#93;<c4f>&#58;1|1|1|1;
&#91;nA&#93;<v3f>&#58;0|0|-1;
&#91;nB&#93;<v3f>&#58;0|0|-1;
&#91;nC&#93;<v3f>&#58;0|0|-1;
&#91;tA&#93;<v3f>&#58;1|0|0;
&#91;tB&#93;<v3f>&#58;1|0|0;
&#91;tC&#93;<v3f>&#58;1|0|0;
&#91;bA&#93;<v3f>&#58;0|1|0;
&#91;bB&#93;<v3f>&#58;0|1|0;
&#91;bC&#93;<v3f>&#58;0|0|-1;
&#91;uv0A&#93;<v2f>&#58;0|2;
&#91;uv0B&#93;<v2f>&#58;1|2;
&#91;uv0C&#93;<v2f>&#58;0|3;
&#91;mat&#93;<str>&#58;mat_cube;
&#91;-F&#93;<str>&#58;Create;
&#91;+F&#93;<int>&#58;5;
&#91;vA&#93;<v3f>&#58;0.5|0.5|-0.5;
&#91;vB&#93;<v3f>&#58;0.5|-0.5|-0.5;
&#91;vC&#93;<v3f>&#58;-0.5|-0.5|-0.5;
&#91;cA&#93;<c4f>&#58;1|1|1|1;
&#91;cB&#93;<c4f>&#58;1|1|1|1;
&#91;cC&#93;<c4f>&#58;1|1|1|1;
&#91;nA&#93;<v3f>&#58;0|0|-1;
&#91;nB&#93;<v3f>&#58;0|0|-1;
&#91;nC&#93;<v3f>&#58;0|0|-1;
&#91;tA&#93;<v3f>&#58;1|0|0;
&#91;tB&#93;<v3f>&#58;1|0|0;
&#91;tC&#93;<v3f>&#58;1|0|0;
&#91;bA&#93;<v3f>&#58;0|1|0;
&#91;bB&#93;<v3f>&#58;0|0|-1;
&#91;bC&#93;<v3f>&#58;0|0|-1;
&#91;uv0A&#93;<v2f>&#58;1|2;
&#91;uv0B&#93;<v2f>&#58;1|3;
&#91;uv0C&#93;<v2f>&#58;0|3;
&#91;mat&#93;<str>&#58;mat_cube;
&#91;-F&#93;<str>&#58;Create;
&#91;+F&#93;<int>&#58;6;
&#91;vA&#93;<v3f>&#58;-0.5|-0.5|-0.5;
&#91;vB&#93;<v3f>&#58;0.5|-0.5|-0.5;
&#91;vC&#93;<v3f>&#58;-0.5|-0.5|0.5;
&#91;cA&#93;<c4f>&#58;1|1|1|1;
&#91;cB&#93;<c4f>&#58;1|1|1|1;
&#91;cC&#93;<c4f>&#58;1|1|1|1;
&#91;nA&#93;<v3f>&#58;0|-1|0;
&#91;nB&#93;<v3f>&#58;0|-1|0;
&#91;nC&#93;<v3f>&#58;0|-1|0;
&#91;tA&#93;<v3f>&#58;1|0|0;
&#91;tB&#93;<v3f>&#58;1|0|0;
&#91;tC&#93;<v3f>&#58;1|0|0;
&#91;bA&#93;<v3f>&#58;0|0|-1;
&#91;bB&#93;<v3f>&#58;0|0|-1;
&#91;bC&#93;<v3f>&#58;0|1|0;
&#91;uv0A&#93;<v2f>&#58;0|3;
&#91;uv0B&#93;<v2f>&#58;1|3;
&#91;uv0C&#93;<v2f>&#58;0|4;
&#91;mat&#93;<str>&#58;mat_cube;
&#91;-F&#93;<str>&#58;Create;
&#91;+F&#93;<int>&#58;7;
&#91;vA&#93;<v3f>&#58;0.5|-0.5|-0.5;
&#91;vB&#93;<v3f>&#58;0.5|-0.5|0.5;
&#91;vC&#93;<v3f>&#58;-0.5|-0.5|0.5;
&#91;cA&#93;<c4f>&#58;1|1|1|1;
&#91;cB&#93;<c4f>&#58;1|1|1|1;
&#91;cC&#93;<c4f>&#58;1|1|1|1;
&#91;nA&#93;<v3f>&#58;0|-1|0;
&#91;nB&#93;<v3f>&#58;0|-1|0;
&#91;nC&#93;<v3f>&#58;0|-1|0;
&#91;tA&#93;<v3f>&#58;1|0|0;
&#91;tB&#93;<v3f>&#58;1|0|0;
&#91;tC&#93;<v3f>&#58;1|0|0;
&#91;bA&#93;<v3f>&#58;0|0|-1;
&#91;bB&#93;<v3f>&#58;0|1|0;
&#91;bC&#93;<v3f>&#58;0|1|0;
&#91;uv0A&#93;<v2f>&#58;1|3;
&#91;uv0B&#93;<v2f>&#58;1|4;
&#91;uv0C&#93;<v2f>&#58;0|4;
&#91;mat&#93;<str>&#58;mat_cube;
&#91;-F&#93;<str>&#58;Create;
&#91;+F&#93;<int>&#58;8;
&#91;vA&#93;<v3f>&#58;0.5|-0.5|0.5;
&#91;vB&#93;<v3f>&#58;0.5|-0.5|-0.5;
&#91;vC&#93;<v3f>&#58;0.5|0.5|0.5;
&#91;cA&#93;<c4f>&#58;1|1|1|1;
&#91;cB&#93;<c4f>&#58;1|1|1|1;
&#91;cC&#93;<c4f>&#58;1|1|1|1;
&#91;nA&#93;<v3f>&#58;1|0|0;
&#91;nB&#93;<v3f>&#58;1|0|0;
&#91;nC&#93;<v3f>&#58;1|0|0;
&#91;tA&#93;<v3f>&#58;1|0|0;
&#91;tB&#93;<v3f>&#58;1|0|0;
&#91;tC&#93;<v3f>&#58;1|0|0;
&#91;bA&#93;<v3f>&#58;0|1|0;
&#91;bB&#93;<v3f>&#58;0|0|-1;
&#91;bC&#93;<v3f>&#58;0|1|0;
&#91;uv0A&#93;<v2f>&#58;1|0;
&#91;uv0B&#93;<v2f>&#58;2|0;
&#91;uv0C&#93;<v2f>&#58;1|1;
&#91;mat&#93;<str>&#58;mat_cube;
&#91;-F&#93;<str>&#58;Create;
&#91;+F&#93;<int>&#58;9;
&#91;vA&#93;<v3f>&#58;0.5|-0.5|-0.5;
&#91;vB&#93;<v3f>&#58;0.5|0.5|-0.5;
&#91;vC&#93;<v3f>&#58;0.5|0.5|0.5;
&#91;cA&#93;<c4f>&#58;1|1|1|1;
&#91;cB&#93;<c4f>&#58;1|1|1|1;
&#91;cC&#93;<c4f>&#58;1|1|1|1;
&#91;nA&#93;<v3f>&#58;1|0|0;
&#91;nB&#93;<v3f>&#58;1|0|0;
&#91;nC&#93;<v3f>&#58;1|0|0;
&#91;tA&#93;<v3f>&#58;1|0|0;
&#91;tB&#93;<v3f>&#58;1|0|0;
&#91;tC&#93;<v3f>&#58;1|0|0;
&#91;bA&#93;<v3f>&#58;0|0|-1;
&#91;bB&#93;<v3f>&#58;0|1|0;
&#91;bC&#93;<v3f>&#58;0|1|0;
&#91;uv0A&#93;<v2f>&#58;2|0;
&#91;uv0B&#93;<v2f>&#58;2|1;
&#91;uv0C&#93;<v2f>&#58;1|1;
&#91;mat&#93;<str>&#58;mat_cube;
&#91;-F&#93;<str>&#58;Create;
&#91;+F&#93;<int>&#58;10;
&#91;vA&#93;<v3f>&#58;-0.5|-0.5|-0.5;
&#91;vB&#93;<v3f>&#58;-0.5|-0.5|0.5;
&#91;vC&#93;<v3f>&#58;-0.5|0.5|-0.5;
&#91;cA&#93;<c4f>&#58;1|1|1|1;
&#91;cB&#93;<c4f>&#58;1|1|1|1;
&#91;cC&#93;<c4f>&#58;1|1|1|1;
&#91;nA&#93;<v3f>&#58;-1|0|0;
&#91;nB&#93;<v3f>&#58;-1|0|0;
&#91;nC&#93;<v3f>&#58;-1|0|0;
&#91;tA&#93;<v3f>&#58;1|0|0;
&#91;tB&#93;<v3f>&#58;1|0|0;
&#91;tC&#93;<v3f>&#58;1|0|0;
&#91;bA&#93;<v3f>&#58;0|0|-1;
&#91;bB&#93;<v3f>&#58;0|1|0;
&#91;bC&#93;<v3f>&#58;0|1|0;
&#91;uv0A&#93;<v2f>&#58;-1|0;
&#91;uv0B&#93;<v2f>&#58;0|0;
&#91;uv0C&#93;<v2f>&#58;-1|1;
&#91;mat&#93;<str>&#58;mat_cube;
&#91;-F&#93;<str>&#58;Create;
&#91;+F&#93;<int>&#58;11;
&#91;vA&#93;<v3f>&#58;-0.5|-0.5|0.5;
&#91;vB&#93;<v3f>&#58;-0.5|0.5|0.5;
&#91;vC&#93;<v3f>&#58;-0.5|0.5|-0.5;
&#91;cA&#93;<c4f>&#58;1|1|1|1;
&#91;cB&#93;<c4f>&#58;1|1|1|1;
&#91;cC&#93;<c4f>&#58;1|1|1|1;
&#91;nA&#93;<v3f>&#58;-1|0|0;
&#91;nB&#93;<v3f>&#58;-1|0|0;
&#91;nC&#93;<v3f>&#58;-1|0|0;
&#91;tA&#93;<v3f>&#58;1|0|0;
&#91;tB&#93;<v3f>&#58;1|0|0;
&#91;tC&#93;<v3f>&#58;1|0|0;
&#91;bA&#93;<v3f>&#58;0|1|0;
&#91;bB&#93;<v3f>&#58;0|1|0;
&#91;bC&#93;<v3f>&#58;0|1|0;
&#91;uv0A&#93;<v2f>&#58;0|0;
&#91;uv0B&#93;<v2f>&#58;0|1;
&#91;uv0C&#93;<v2f>&#58;-1|1;
&#91;mat&#93;<str>&#58;mat_cube;
&#91;-F&#93;<str>&#58;Create;


Description:


&#91;+O&#93; object name
&#91;+CF&#93; faces count
&#91;+CV&#93; vertex count
&#91;-O&#93; end of object definition
&#91;+F&#93; start face&#91;n&#93;
&#91;vA&#93; vertex A
&#91;vB&#93; vertex B
&#91;vC&#93; vertex C
&#91;cA&#93; color A
&#91;cB&#93; color B
&#91;cC&#93; color C
&#91;nA&#93; normal A
&#91;nB&#93; normal B
&#91;nC&#93; normal C
&#91;tA&#93; tanget A
&#91;tB&#93; tanget B
&#91;tC&#93; tanget C
&#91;bA&#93; binormal A
&#91;bB&#93; binormal B
&#91;bC&#93; binormal C
&#91;uv0A&#93; uv set 0 A
&#91;uv0B&#93; uv set 0 B
&#91;uv0C&#93; uv set 0 C
&#91;mat&#93; materil name for face
&#91;-F&#93; end face definition

....


3) CodeGear and Delphi7 compilation works good on both.

detvog
26-08-2007, 12:52 PM
On www.delgine.com there is a delphi-loader for
deled files. Deled is a good modeller.
I have import deled in the old A3D and it works with an old
Deled-Editor.



For new files:
http://www.delgine.com/forum/viewtopic.php?t=2428&highlight=delphi

Can you import it ?




Sorry for my bad english

andygfx
26-08-2007, 03:05 PM
On www.delgine.com there is a delphi-loader for
deled files. Deled is a good modeller.
I have import deled in the old A3D and it works with an old
Deled-Editor.



For new files:
http://www.delgine.com/forum/viewtopic.php?t=2428&highlight=delphi

Can you import it ?

Sorry for my bad english



Hmm. Not bad idea. But not as loader. as plugin will be better.

andygfx
28-08-2007, 12:18 AM
Version 0.15 released:

+ Basic Terrain class (no optimalized)
+ screenshots
+ Terrain demo bin/source

SRC/BIN: http://final3d.intelligentdevelopment.sk/

paul_nicholls
28-08-2007, 12:35 AM
Hi andygfx :-)
I went to your site and I noticed that when I clicked on some of the thumbnail pictures in the gallery, the wrong picture opened up...

cheers,
Paul.

andygfx
28-08-2007, 12:58 AM
Hi andygfx :-)
I went to your site and I noticed that when I clicked on some of the thumbnail pictures in the gallery, the wrong picture opened up...

cheers,
Paul.

fixed

paul_nicholls
28-08-2007, 01:02 AM
Hi andygfx :-)
I went to your site and I noticed that when I clicked on some of the thumbnail pictures in the gallery, the wrong picture opened up...

cheers,
Paul.

fixed

That was quick! :)
cheers,
Paul

andygfx
29-08-2007, 01:56 PM
New release Final3D ver 0.17

changes:

+ fixed a few small bugs but critical ;)
+ enable render BBOX (on/off from config file)
+ add Maya 7.0 exporter with source to f3da file format
+ add PERL source for converting from Wavefront OBJ/MTL file to f3da+material
+ add description of MAYA exporter to Tutorial DOC
+ removed OLD engine release from Download page
+ render scene model with glDisplayList (on/off from config) - good for picking object if will by needed


SRC/BIN: http://final3d.intelligentdevelopment.sk/

savage
29-08-2007, 02:27 PM
This latest build does not work for me on my office machine, even after I recompiled it with Delphi 6.

It crashes on this line
ProgramObject := glCreateProgramObjectARB();
in F3D_Shader_GLSL.pas

andygfx
29-08-2007, 02:33 PM
and 0.17 crashes too ?

savage
29-08-2007, 02:57 PM
and 0.17 crashes too ?

I'm talking about v0.17. That's the one that crashed.

andygfx
29-08-2007, 03:06 PM
hmm. Before a few years wasn't problems with delphi. Now on different compilator and on different OS a have different results. It's strange.

I use CodeGear at home PC, because Delphi7 don't work under Vista x64 :(, but tomorrow a will try compile it in office, under WinXP + D7 + ATI

Q: Lazarus IDE + FPC is better solution?

WILL
29-08-2007, 04:30 PM
Well not everyone has updated to Vista. (And some never will. ;)) I'm not sure if Delphi will compile for XP when on a Vista system, will it?

Lazarus will compile to exactly whatever system to tell it to. So long as you set it and it's supported. :) There is some issues compiling to Mac or Linux from Windows. But the other way around is quite easy I'm told. Laz is a VERY good solution if you wanted to go cross-platform. I'd recommend it.

andygfx
29-08-2007, 05:24 PM
Hmm. I tried compile F3D under LAZARUS, but i have problem with SDLInput.pas then, graphics unit, JPEG too. Where i found a missing units?
Or exist place for sharing FPC units?

WILL
30-08-2007, 01:01 AM
Under Lazarus you have to specify this in each Project file. Not a daunting task, but it involves a bit of setup for each new project.

Just go into Project -> Compiler Options...

And you will see in the first upper text field with the label 'Other Unit Files (-Fu)'. That is where you specify all of the folders with the units you need. The '...' buttons on the side will give you a new window which you can better add the paths you need.

Once this is done you just save it and this project will check those paths each time it compiles.

Some units also require that you put in the SDL\Pas\ path into the 'Include Files (-Fi)' field as well. This is due to some of the JEDI conventions with regards to .inc files.

andygfx
30-08-2007, 07:36 AM
and 0.17 crashes too ?

I'm talking about v0.17. That's the one that crashed.

So. I have recompiled version uder Delphi7 + WinXP SP2, and work cool. I think, tha problem is in a shaders, i now updating source to terminate app if one from needed extension is unsuported.

Reload last release, is updated on a server.

savage
30-08-2007, 08:56 AM
Yes this version behaves much nicer and correctly says that my graphics card does not support "GL_ARB_vertex_shader".

I noticed a bug that Delphi 6 does not allow in F3D_Shader_GLSL.pas...

procedure TF3D_PixelShader_GLSL.Uniform2f(Name: string; v0, v1: Single);
begin
glUniform2fARB(FindUniform(Name), v0, v1, );
end;

That last comma will not compile in D6, and I hope it does not compile in later compilers.

WILL
30-08-2007, 09:31 AM
That line of code shouldn't work for ANY Pascal or Object Pascal compiler. :P

Reiter
30-08-2007, 10:53 AM
Q: Lazarus IDE + FPC is better solution?

I prefer this since I don't own Delphi :shock:.

EDIT:
BTW: When trying to run the exe files MSVCR71.DLL is missing. Maybe you should provide it with your distributions.

EDIT2: Ver. 0.17

Final3D_Engine_2007.EXE (log file):


STATUS INFO &#58; @ 13&#58;19&#58;56 MSG &#58; Starting Application IN &#58; Initialization

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_ARB_multitexture&#91;OK&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_ARB_vertex_program&#91;OK&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_ARB_vertex_shader&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_ARB_fragment_shader&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_ARB_shader_objects&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_ARB_shading_language_100&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_ARB_vertex_buffer_object&#91;OK&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_version_1_2&#91;OK&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_version_1_3&#91;OK&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_version_1_4&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_version_1_5&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_version_2_0&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; SHADER "GLSL_GLOW" created IN &#58; GLSL Shader

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; SHADER "GLSL_GLOW loaded IN &#58; GLSL Shader

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; SHADER "GLSL_GLOW BUILD IN &#58; GLSL Shader

Final3D_Engine_2007_D7.EXE (log file)


STATUS INFO &#58; @ 13&#58;21&#58;45 MSG &#58; Starting Application IN &#58; Initialization

STATUS INFO &#58; @ 13&#58;21&#58;45 MSG &#58; GL_ARB_multitexture&#91;OK&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;21&#58;45 MSG &#58; GL_ARB_vertex_program&#91;OK&#93; IN &#58; SDL class

*** ERROR *** &#58; @ 13&#58;21&#58;45 MSG &#58; GL_ARB_vertex_shader&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;21&#58;45 MSG &#58; &#91;SCENE&#93; - destroy IN &#58; SCENE MANAGER

STATUS INFO &#58; @ 13&#58;21&#58;45 MSG &#58; Terminating Application IN &#58; Finalization

WinXP, SP2

detvog
30-08-2007, 12:54 PM
Hi,

i think it's your graphiccard. :roll:

On my Laptop then engine do not work (ATI-Card).
On my PC the engine work (GFORCE-Card).







Sorry for my bad english. :?

andygfx
30-08-2007, 02:02 PM
hmm. I have on my NB ATI too and work good. try load last release again, today (before 1 hour) i updated on a server new ver 0.17

- terrain was integrated to scene loader by terrain file definition (not finished yet) - currently without foliage and grass
- Fixed error with range chceck error in GLSL shader globjectprogramARB
- crash if bbox was enabled in scene
- and many other

andygfx
30-08-2007, 02:11 PM
Q: Lazarus IDE + FPC is better solution?

I prefer this since I don't own Delphi :shock:.

EDIT:
BTW: When trying to run the exe files MSVCR71.DLL is missing. Maybe you should provide it with your distributions.

EDIT2: Ver. 0.17

Final3D_Engine_2007.EXE (log file):


STATUS INFO &#58; @ 13&#58;19&#58;56 MSG &#58; Starting Application IN &#58; Initialization

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_ARB_multitexture&#91;OK&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_ARB_vertex_program&#91;OK&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_ARB_vertex_shader&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_ARB_fragment_shader&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_ARB_shader_objects&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_ARB_shading_language_100&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_ARB_vertex_buffer_object&#91;OK&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_version_1_2&#91;OK&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_version_1_3&#91;OK&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_version_1_4&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_version_1_5&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; GL_version_2_0&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; SHADER "GLSL_GLOW" created IN &#58; GLSL Shader

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; SHADER "GLSL_GLOW loaded IN &#58; GLSL Shader

STATUS INFO &#58; @ 13&#58;19&#58;58 MSG &#58; SHADER "GLSL_GLOW BUILD IN &#58; GLSL Shader

Final3D_Engine_2007_D7.EXE (log file)


STATUS INFO &#58; @ 13&#58;21&#58;45 MSG &#58; Starting Application IN &#58; Initialization

STATUS INFO &#58; @ 13&#58;21&#58;45 MSG &#58; GL_ARB_multitexture&#91;OK&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;21&#58;45 MSG &#58; GL_ARB_vertex_program&#91;OK&#93; IN &#58; SDL class

*** ERROR *** &#58; @ 13&#58;21&#58;45 MSG &#58; GL_ARB_vertex_shader&#91;unsupported&#93; IN &#58; SDL class

STATUS INFO &#58; @ 13&#58;21&#58;45 MSG &#58; &#91;SCENE&#93; - destroy IN &#58; SCENE MANAGER

STATUS INFO &#58; @ 13&#58;21&#58;45 MSG &#58; Terminating Application IN &#58; Finalization

WinXP, SP2


Sorry but D7 vesion is actual now, second exe file is compiled on my home PC under Vista x64 and isn't actual (from yesterday :( ). I fix a problem with unsuported extension today.

If you now try download 0.17 all will be correct if you have good card.

Reiter
01-09-2007, 11:41 PM
i think it's your graphiccard.

On my Laptop then engine do not work (ATI-Card).
On my PC the engine work (GFORCE-Card).

It didn't work on my laptop, too.


If you now try download 0.17 all will be correct if you have good card.

Well, didn't tried out on laptop again but this time at my home machine and it worked fine (ATI Radeon 9600) and I have to say it is an impressive demo. Keep the work going :).

Reiter
07-10-2007, 10:38 AM
Since I stated some time ago that the demo is working for me, now I tried again and it failed to load. Again the .log says:



*** ERROR *** : @ 12:35:31 MSG : GL_ARB_vertex_shader[unsupported] IN : SDL class


I am not sure why it is failing now at my home machine.