Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Di Mai 14, 2024 09:09

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 31 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3  Nächste
Autor Nachricht
 Betreff des Beitrags:
BeitragVerfasst: Mi Sep 29, 2004 15:11 
:) at last. for some wierd reason my dads pc could run the "screwed" versions(yep back on his pc to test it and im too lazy to login)..... he has a Geforce FX. Btw F12 takes screenshots.


Nach oben
  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Sep 29, 2004 15:56 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
After trying some of the maps : Speed is really an issue, it runs far slower than RtCW itself, but on my Radeon it also has several rendering errors. Take a look at that screenshot I've attached. It was taken in a map called "village" (If I remember correct). The console isn't rendered correct, the skybox sometimes disappears and the trees either (depending on where you are) miss some parts or are not visible at all. In other maps, I noticed that some textures were either missing or bound wrong (there was a window, but a texture containing lightmaps was bound to it, instead of the texture that should be there).

P.S. : The maps also are very dark. Don't know if that's also the same case on your gfx-card, but they're sometims so dark that I can't see anything.


Dateianhänge:
helios3.jpg
helios3.jpg [ 27.15 KiB | 5227-mal betrachtet ]

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)
Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Sep 29, 2004 19:38 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Aug 28, 2002 19:27
Beiträge: 568
Wohnort: Chemnitz / Sachsen
now it runs, beside without a map i couldnt say anything more, but the console is rendered in the correct way .... good work

_________________
Aktuelles Projekt :
www.PicPlace.de


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Sep 29, 2004 20:59 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Son of Satan hat geschrieben:
After trying some of the maps : Speed is really an issue, it runs far slower than RtCW itself, but on my Radeon it also has several rendering errors. Take a look at that screenshot I've attached. It was taken in a map called "village" (If I remember correct). The console isn't rendered correct, the skybox sometimes disappears and the trees either (depending on where you are) miss some parts or are not visible at all. In other maps, I noticed that some textures were either missing or bound wrong (there was a window, but a texture containing lightmaps was bound to it, instead of the texture that should be there).

P.S. : The maps also are very dark. Don't know if that's also the same case on your gfx-card, but they're sometims so dark that I can't see anything.


Darkness will b cos Gamma i set to 6, need to make it so user can choose it. Iv never noticed any missing textures, did u extract pak0 and the sp pk3's? I noticed that for some odd reason the sky and entitys can disapear depending on ur view and position in the world...... i don't get why since the entitys render procedure is basically identical to the normal walls.

Iv looked at the same map and for some reason the sky is going over the tree's leafs, i have noticed this happening to other things like snow on windows.... btw the map is forrest.bsp.

Did u extract the ui/assets folder and files? It contains some of the consoles images.(its in sp_pak1.pk3). If u run heliosapp.exe does the internal console look right? Or is it a gray/white image?

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Sep 29, 2004 22:49 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Looking at the image u posted again im 100% sure you havn't extracted all the image files. The RTCW console is made up of 2 shaders, one to do the fancy RTCW W symbol, and one to do the fog/smoke effect. With no images they defult to being white (and with some colour setting/blend/whatever it can go gray).

The reason the Sky and entitys wern't drawn sometimes was due to a stupid mistake:

Code:
  1.  
  2. if numTransparent  > 0 then begin
  3.       if SortFaces then
  4.       begin
  5.         QSort(numTransparent, CompareTransparent, SwapTransparent);
  6.         QSort(numTransparent, CompareTransparent2, SwapTransparent);
  7.       end;
  8.       for l := numTransparent-1 downto 0 do begin
  9.         faceIndex := TransparentFaces[l].FaceIndex;
  10.         shaderId := TextureInfo[Faces[faceIndex].textureID].ShaderId;
  11.  
  12.         if shaderId <> -1 then
  13.         RenderSurfaceShader(faceIndex, shaderId)
  14.         else
  15.         RenderSurface(faceIndex);
  16.         inc(Faces_no);
  17.       end;
  18.    
  19.     //SetDefaults;
  20.     if GetCvarB('Cg_DrawEOs') then
  21.     DrawEntityObjects;
  22.  
  23.     if (skyboxShader <> -1) and GetCvarB('Cg_RenderSky') then begin
  24.       RenderSkybox;
  25.     end;
  26.     end;
  27.  


Id accedentaly placed the drawentityobjects and renderskybox in the if numTransparent > 0 bit...... the renderskybox is now after the solids and before the transparent's so it no longer screws up transparent surfaces. Gamma is now optional, personaly i find 6 to b a fne value and 10 to be way too bright(shadows become non existant) but it depends on ur monitor.

Zitat:
now it runs, beside without a map i couldnt say anything more, but the console is rendered in the correct way .... good work

Btw, you can download free Quake 3 maps made by users, alot have custom textures.

Latest Download:
- Helios Lite 4

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Sep 29, 2004 22:56 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
That may be the caus of the "problem". You're right, I have only extracted the pak0.pak file, and not the others. I'm gonna try it later and tell you if it works.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Sep 30, 2004 02:17 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Iv found another screwup on my part which could screw up images.

- Helios Lite 5

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Sep 30, 2004 23:22 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
It now works, after I extracted all the other pak-files too. I right now don't have the time to take a closer look, but I'll report back later.

P.S. : Great work, it's the first loader for RtCW-Map I've seen. Are there any other, or are you the first one to do such a thing?

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Okt 01, 2004 14:45 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Well, Q3MapView could load RTCW maps if it was modifyed. Currently it rejects RTCW maps cos the header version is 47 and it expects 46.

The major differences between helios and Q3map view are:

More Realistic Gravity(Still not perfect.. well its like being on the moon.... but much better then q3mapview's shove the user against the floor like u got an elephant on ur head)
Less shader bugs/Rendering bugs
Smallconsole mode (Where it looks like a games console compaired to plan text over the whole screen)
Easyer to use(q3map view uses an annoying ini file that you have to manualy setup, you even have to give it the exact location the game files were extracted to)
Entity support, Helios supports a few entitys. Most arn't 100% RTCW like and most arn't fully working(most don't support the spawnflags). Func_breakable for example doesn't break(no weapons in helios or heath for entitys yet)
Zitat:
target_speaker
ambient_generic (Half-Life's version of target_speaker)
trigger_auto
trigger_camera (HL like)
trigger_changelevel (HL like)
target_delay
trigger_multiple
trigger_teleport
misc_model
func_door (HL like & RTCW like depending on game type)
func_timer (Q3 Like)
func_water (HL like)
func_ladder (HL like)
env_fade
env_particle (My particles)
multi_manager (HL like)
func_button (HL like & RTCW like depending on game type)
func_breakable (only displays faces)
func_explosive (only displays faces)
path_corner
func_train
func_child (My own, designed to get round elevators and bad collision detection)
func_static (RTCW like, missing pain spawnflag)



I don't know any other projects that are trying to emulate RTCW(Eventualy id love it to be able to read rtcw menu's, camera's, ai scripts, etc).

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Okt 02, 2004 10:35 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
I just had some time to try out several RtCW maps with helios and so far my observations are (just tested : escape1, boss2, forest) :
  • Performance is bad, sometimes it even dropped (escape1) below 10 fps, which is far slower than the game was
  • Parts of the skydome (I guess it's no skybox) are either still missing (forest) or you get a hard seem (escape1)
  • Turning of shader doubled the performance, at least in parts of the maps where performance was bad (jumped from 10 to >20 FpS), but that maybe because then many things don't get textured
  • Visibility determination for the portals doesn't seem always work as it should. Fire up escape1, and there is a stair (it's the first) to the right that goes straigt up. Depending on where you are on that stair, you should see the room behind that step, but you don't.

Besides that, it's looking great, and it's also great to hear the original RtCW sounds when running through the maps. As far as the bad speed goes, I really can't tell why, cause I don't know how things get done internally. I suggest you to time your functions with a high performance counter to see where the culprit is.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Okt 02, 2004 14:09 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Q3 Map viewer(well the moded Q3Mapview which was gona b helios) has better performance than helios, even when helios has speed improvements(saving bind's, less state changes, etc). The only other real difference is q3mapview uses opengl12, and Helios uses ur one. Even when i comment out the entitys(which should take up most of the processing time), etc it still never gets to the same level as q3mapview.....

The sky has been changed, its now 2 tryangles, flat sky like in rtcw, but u can now see nice blue bits where the sky doesn't cover....(true it doesn't take into account the skyportals, but somemaps don't have any).

I did notice the stairs thing...... and i don't get it, Ill have to test ti without the frustrum, the frustrum seems to like cutting faces it shouldn't (i.e doors, when i used frustrum on doors it cut them when they were nearly out of view which it shouldn't).

Ill post all the render code when im on my pc.

Btw u should try the following in the console:

setmusic m_assault.wav
setmusic m_mission.wav
setmusic l_theme.wav

RTCW has sweet music.

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Okt 03, 2004 02:10 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Render Code:

Code:
  1.  
  2. procedure TQuake3BSP.RenderBSP(const Pos: TVector3f; leafIndex : integer);
  3. var x,xx,i, l, j, k,mx, cluster, faceCount, faceIndex, shaderId{,shaderIdI} : integer;
  4.     Leaf : PBSPLeaf;
  5.     tmp, txt : string;
  6.     st, et : longword;
  7.     allEqual,im,DrawEOs : boolean;
  8. begin
  9.  
  10.   FillChar(FacesDrawn[0], sizeof(boolean)*numOfFaces, 0);
  11.   cluster := Leafs[leafIndex].cluster;
  12.   i := numOfLeafs;
  13.   VisibleTriangles := 0;
  14.   renderedLeaves := 0;
  15.   PVSLeaves :=0;
  16.   frustumLeaves :=0;
  17.   BSPLeaves := numOfLeafs;
  18.  
  19.   Faces_no := 0;
  20.   SavedBindCalls := 0;
  21.   DrawEOs := GetCvarB('Cg_DrawEOs'); // why keep calling it when we can call it once!
  22.  
  23.   if GetCvarB('Cg_SimpleRender') then begin
  24.     while (i > 0) do begin
  25.       dec(i);
  26.       try
  27.       Leaf := @Leafs[i];
  28.  
  29.       if Leaf = nil then
  30.       exit;
  31.       Leaf.cluster := Leaf.cluster;
  32.  
  33.       if IsModelLeaf[i] then
  34.       continue;
  35.  
  36.         //     Leaf.
  37.       //if not IsModelLeaf[i] then
  38.       if (IsClusterVisible(cluster, Leaf.cluster) = 0) then begin
  39.         inc(PVSLeaves);
  40.         continue;
  41.       end;
  42.  
  43.       //if not IsModelLeaf[i] then
  44.       if (not Frust.BoxInFrustum(Leaf.min.x, Leaf.min.y, Leaf.min.z, Leaf.max.x, Leaf.max.y, Leaf.max.z)) then begin
  45.         inc(frustumLeaves);
  46.         continue;
  47.       end;
  48.  
  49.       inc(renderedLeaves);
  50.       faceCount := Leaf.numOfLeafFaces;
  51.       while(faceCount > 0) do begin
  52.         Dec(faceCount);
  53.         faceIndex := LeafFaces[Leaf.leafface + faceCount];
  54.         if (Faces[faceIndex].FaceType  = FACE_BILLBOARD) then continue;
  55.         if (FacesDrawn[faceIndex] = false) then begin
  56.           FacesDrawn[faceIndex] := true;
  57.           RenderSurface(faceIndex);
  58.           inc(Faces_no);
  59.         end;
  60.       end; // while faceCount
  61.       except
  62.       end;
  63.     end;
  64.     //SetDefaults;
  65.     if GetCvarB('Cg_DrawEOs') then
  66.     DrawEntityObjects;
  67.   end
  68.   else begin
  69.     numSolid := 0;
  70.     numTransparent := 0;
  71.     numAdditive := 0;
  72.     while (i > 0) do begin
  73.       dec(i);
  74.       Leaf := @Leafs[i];
  75.  
  76.       if IsModelLeaf[i] then
  77.       continue;
  78.  
  79.       //if not IsModelLeaf[i] then
  80.       if (IsClusterVisible(cluster, Leaf.cluster) = 0) then begin
  81.         inc(PVSLeaves);
  82.         continue;
  83.       end;
  84.  
  85.       //if not IsModelLeaf[i] then
  86.       if (not Frust.BoxInFrustum(Leaf.min.x, Leaf.min.y, Leaf.min.z, Leaf.max.x, Leaf.max.y, Leaf.max.z)) then begin
  87.         inc(frustumLeaves);
  88.         continue;
  89.       end;
  90.  
  91.       inc(renderedLeaves);
  92.       WalkLeaf(i, SortFaces);
  93.     end;
  94.  
  95.     AddEOFaces; //Add visible entity faces to the list
  96.  
  97.     // All faces are associated with the corresponding face arrays
  98.     // now we have to depth sort all transparent
  99.     if numSolid > 0 then begin
  100.       if SortFaces then
  101.       begin
  102.         QSort(numSolid, CompareSolid, SwapSolid);
  103.         QSort(numSolid, CompareSolid2, SwapSolid);
  104.       end;
  105.       for l := 0 to numSolid-1 do begin
  106.         faceIndex := SolidFaces[l].FaceIndex;
  107.  
  108.         If (IsEOFace[FaceIndex] > -1) and DrawEOs then
  109.         DrawEOFace(FaceIndex,IsEOFace[FaceIndex])
  110.         else
  111.         RenderSurface(faceIndex);
  112.         inc(Faces_no);
  113.       end;
  114.     end;
  115.  
  116.     if (skyboxShader <> -1) and GetCvarB('Cg_RenderSky') then begin
  117.       RenderSkybox;
  118.     end;
  119.  
  120.     if numAdditive  > 0 then begin
  121.       if SortFaces then
  122.       begin
  123.         QSort(numAdditive, CompareAdditive, SwapAdditive);
  124.         QSort(numAdditive, CompareAdditive2, SwapAdditive);
  125.       end;
  126.       for l := 0 to numAdditive-1 do begin
  127.         faceIndex := AdditiveFaces[l].FaceIndex;
  128.         shaderId := TextureInfo[Faces[faceIndex].textureID].ShaderId;
  129.  
  130.         If (IsEOFace[FaceIndex] > -1) and DrawEOs then
  131.         DrawEOFace(FaceIndex,IsEOFace[FaceIndex])
  132.         else
  133.         if shaderId <> -1 then
  134.         RenderSurfaceShader(faceIndex, shaderId)
  135.         else
  136.         RenderSurface(faceIndex);
  137.         inc(Faces_no);
  138.       end;
  139.     end;
  140.  
  141.     if numTransparent  > 0 then begin
  142.       if SortFaces then
  143.       begin
  144.         QSort(numTransparent, CompareTransparent, SwapTransparent);
  145.         QSort(numTransparent, CompareTransparent2, SwapTransparent);
  146.       end;
  147.       for l := numTransparent-1 downto 0 do begin
  148.         faceIndex := TransparentFaces[l].FaceIndex;
  149.         shaderId := TextureInfo[Faces[faceIndex].textureID].ShaderId;
  150.  
  151.         If (IsEOFace[FaceIndex] > -1) and DrawEOs then
  152.         DrawEOFace(FaceIndex,IsEOFace[FaceIndex])
  153.         else
  154.         if shaderId <> -1 then
  155.         RenderSurfaceShader(faceIndex, shaderId)
  156.         else
  157.         RenderSurface(faceIndex);
  158.         inc(Faces_no);
  159.       end;
  160.     end;
  161.  
  162.     {if GetCvarB('Cg_DrawEOs') then
  163.     DrawEntityObjects;  }
  164.  
  165.   end;
  166.  
  167.  
  168.  
  169.   if WireFrame then
  170.     glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
  171.   if DumpMsg <> '' then begin
  172.     {$IfDef HELIOS_CONSOLE}Cons.TextOut(45,Cons.Lines, DumpMsg);{$EndIf}
  173.   end;
  174.  
  175.   if WireFrame then
  176.     glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
  177. end;
  178.  
  179. procedure TQuake3BSP.BindTextures(texId, lmId : integer);
  180. begin
  181.  
  182.   if not GetCvarB('Cg_MultiTexture') then begin
  183.     if  WireFrame = false then begin
  184.       {glColor3ub(255,255,255);
  185.       glEnable(GL_TEXTURE_2D); }
  186.       If texId <> LastTexID then
  187.       begin
  188.       glBindTexture(GL_TEXTURE_2D, TextureInfo[texId].TextureId);
  189.       LastTexID := texId;
  190.       end
  191.       else
  192.       Inc(SavedBindCalls);
  193.     end;
  194.   end
  195.   else begin
  196.     if WireFrame = false then begin
  197.       glActiveTexture(GL_TEXTURE1);
  198.       if lmId > -1 then begin
  199.         glEnable(GL_TEXTURE_2D);
  200.         glBindTexture(GL_TEXTURE_2D, Lightmaps[lmId]);
  201.       end
  202.       else begin
  203.         glDisable(GL_TEXTURE_2D);
  204.       end;
  205.       glActiveTexture(GL_TEXTURE0);
  206.       glEnable(GL_TEXTURE_2D);
  207.       If texId <> LastTexID then
  208.       begin
  209.       glBindTexture(GL_TEXTURE_2D, TextureInfo[texId].TextureId);
  210.       LastTexID := texId;
  211.       end
  212.       else
  213.       Inc(SavedBindCalls);
  214.     end;
  215.   end;
  216. end;
  217.  
  218. procedure TQuake3BSP.RenderSkybox;
  219. var shader : TShader;
  220.     i, numOfVerts : integer;
  221.     texId : Cardinal;
  222. begin
  223.  
  224. if skyBoxShader = -1 then exit;
  225.   glCullFace(GL_BACK);
  226.   shader := ShaderManager[skyBoxShader];
  227.  
  228.   if GetCvarB('Cg_MultiTexture') then begin
  229.     glActiveTexture(GL_TEXTURE1);
  230.     glDisable(GL_TEXTURE_2D);
  231.     glActiveTexture(GL_TEXTURE0);
  232.   end;
  233.   glDisable(GL_TEXTURE_2D);
  234.  
  235.   if shader.SkyboxType = 2 then begin
  236.   glEnable(GL_TEXTURE_2D);
  237.     FSkybox.DrawBox(camera.position);
  238.     SetDefaults;
  239.     exit;
  240.   end;
  241.  
  242.   try
  243.   SetDefaults;
  244.   glCullFace(GL_BACK);
  245.   glDisable(GL_CULL_FACE);
  246.   //  FSkyBox.CalcRenderPoints(camera.position); // only visible points
  247.     FSkyBox.CalcRenderPoints(camera.position);
  248.     // prepare data for global deform operations - but texture coordinates must restored for each layer !!!!!
  249.     numOfVerts := FSkyBox.numOfPoints;
  250.     SetVertexCoords2(skyBoxShader, numOfVerts);
  251.  
  252.     if LockArrays then glLockArraysEXT(0, numOfVerts);
  253.     if shader.numOfLayers > 0 then begin
  254.       for i := 0 to shader.numOfLayers-1 do begin
  255.       FSkyBox.CalcRenderPoints(camera.position);
  256.       SetVertexCoords2(skyBoxShader, numOfVerts);
  257.         SetVertexColors2(skyBoxShader, i, numOfVerts);
  258.  
  259.         glDisableClientState(GL_COLOR_ARRAY);
  260.  
  261.         glColor4f(colorBuffer[0,0],colorBuffer[0,1],colorBuffer[0,2],colorBuffer[0,3]);
  262.         SetTextureCoordinatesSkybox(skyBoxShader, i, numOfVerts);
  263.  
  264.         texId := shader.Layers[i].TextureId[shader.Layers[i].curTexture];
  265.  
  266.         glEnable(GL_TEXTURE_2D);
  267.  
  268.         if LastTexID <> texId then
  269.         begin
  270.         glBindTexture(GL_TEXTURE_2D, texId);
  271.         LastTexID := texId;
  272.         end
  273.         else
  274.         Inc(SavedBindCalls);
  275.  
  276.         shaderManager.SetState(skyBoxShader, i );
  277.         FSkyBox.DrawSphere;
  278.       end;
  279.     end;
  280.     if LockArrays then glUnlockArraysEXT();
  281.     glEnable(GL_CULL_FACE);
  282.     SetDefaults;
  283.   except
  284.     lastError := glGetError();
  285.     lastErrorString := gluErrorString(lastError);
  286.     {$IfDef HELIOS_CONSOLE}Cons.AddIfDifferent('RenderSkyBox ' + lastErrorString);{$EndIf}
  287.     ChangeCVar('Cg_RenderSky','FALSE');
  288.   end;
  289. end;
  290.  
  291. procedure TQuake3BSP.RenderSurfaceShader(faceIndex, shaderId: integer);
  292. var shader : TShader;
  293.     i, texId, planeIdx : integer;
  294.     Face : PBSPFace;
  295. begin
  296.   try
  297.   Face := @Faces[faceIndex];
  298.   shader := ShaderManager[shaderId];
  299.   // culling
  300.   if shader.Cull = GL_NONE then
  301.     glDisable(GL_CULL_FACE)
  302.   else begin
  303.     glEnable(GL_CULL_FACE);
  304.     glCullFace(shader.cull);
  305.   end;
  306.  
  307.   if GetCvarB('Cg_MultiTexture') then begin
  308.     glActiveTexture(GL_TEXTURE1);
  309.     glDisable(GL_TEXTURE_2D);
  310.  
  311.     glActiveTexture(GL_TEXTURE0);
  312.   end;
  313.   //glDisable(GL_TEXTURE_2D);
  314.  
  315.    // prepare data for global deform operations - but texture coordinates must restored for each layer !!!!!
  316.  
  317.    for i := 0 to face.numMeshVerts-1 do
  318.     inputBuffer[i] := Vertices[Face.startVertIndex+MeshVertices[face.meshVertIndex+i]];
  319.  
  320.   SetVertexCoords(shaderId, face.numMeshVerts);
  321.   glVertexPointer(3, GL_FLOAT, sizeof(TBSPVertex), @inputBuffer[0].Position);
  322.  
  323.   if LockArrays then glLockArraysEXT(0, Face.numMeshVerts);
  324.  
  325.   if shader.numOfLayers > 0 then begin
  326.     for i := 0 to shader.numOfLayers-1 do begin
  327.       if (ShaderManager[shaderId].Layers[i].numOfrgbGen > 0) or (Face.FaceType = FACE_MESH) then begin
  328.         SetVertexColors(shaderId, i, face.numMeshVerts);
  329.         glColorPointer(4, GL_UNSIGNED_BYTE, 0, @colorBuffer[0]);
  330.         glEnableClientState(GL_COLOR_ARRAY);
  331.       end
  332.       else
  333.         glColor3f(1,1,1);
  334.  
  335.       SetTextureCoordinates(shaderId, i, face.numMeshVerts);
  336.  
  337.       glTexCoordPointer(2, GL_FLOAT, 0,  @texCoordBuffer[0]);
  338.  
  339.       if (shader.Layers[i].UseLightmap) then begin
  340.         if not GetCvarB('Cg_MultiTexture') then begin
  341.           texId := 0;
  342.         end
  343.         else begin
  344.           glTexCoordPointer(2, GL_FLOAT, sizeof(TBSPVERTEX), @inputBuffer[0].LightmapCoord);
  345.           if (face.lightmapId > -1) and (Lightmaps[face.lightmapID] > -1) then
  346.             texId := Lightmaps[face.lightmapID]
  347.           else
  348.             texId := 0;
  349.         end;
  350.       end
  351.       else begin
  352.         texId := shader.Layers[i].TextureId[shader.Layers[i].curTexture];
  353.       end;
  354.       glEnable(GL_TEXTURE_2D);
  355.  
  356.       {if LastTexID <> texId then
  357.       begin   }
  358.       glBindTexture(GL_TEXTURE_2D, texId);
  359.       texId := LastTexID;
  360.       {end
  361.       else
  362.       Inc(SavedBindCalls); }
  363.  
  364.       shaderManager.SetState(shaderId, i );
  365.       glDrawArrays(GL_TRIANGLES, 0, Face.numMeshVerts);
  366.  
  367.       if (ShaderManager[shaderId].Layers[i].numOfrgbGen > 0) or (Face.FaceType = FACE_MESH) then
  368.       glDisableClientState(GL_COLOR_ARRAY)
  369.     end;
  370.   end;
  371.   if LockArrays then glUnlockArraysEXT();
  372.   SetDefaults;
  373.   if (numOfEffects > 0) and (Faces[faceIndex].effect > -1) and (not GetCvarB('Cg_SimpleRender')) and (GetCvarB('Cg_Fog')) then begin
  374.     if (Effects[Faces[faceIndex].effect].visibleside >= 0) then
  375.       planeIdx := BrushSides[Brushes[Effects[Faces[faceIndex].effect].brushIndex].brushside + Effects[Faces[faceIndex].effect].visibleside].plane
  376.     else
  377.       planeIdx :=  -1;
  378.     RenderFog(faceIndex, Effects[Faces[faceIndex].effect].shaderIndex, planeIdx);
  379.     SetDefaults;
  380.   end;
  381.   except
  382.     lastError := glGetError();
  383.     lastErrorString := gluErrorString(lastError);
  384.     {$IfDef HELIOS_CONSOLE}Cons.AddIfDifferent('RenderSurfaceShader ' + lastErrorString + ' ' + IntToStr(faceIndex)); {$EndIf}
  385.   end;
  386.  
  387. end;
  388.  
  389. procedure TQuake3BSP.RenderSurface(faceIndex: integer);
  390. var Face : PBSPFace;
  391.     planeIdx : integer;
  392. begin
  393.   try                                  
  394.     Face := @Faces[faceIndex];
  395.     glVertexPointer(3, GL_FLOAT, sizeof(TBSPVertex), @Vertices[Face.startVertIndex].Position);
  396.  
  397.     if GetCvarB('Cg_MultiTexture') then begin
  398.       glClientActiveTexture(GL_TEXTURE1);
  399.       //glDisableClientState(GL_COLOR_ARRAY);
  400.       glTexCoordPointer(2, GL_FLOAT, sizeof(tBSPVertex), @Vertices[Face.startVertIndex].LightmapCoord);
  401.       glClientActiveTexture(GL_TEXTURE0);
  402.     end;
  403.     glTexCoordPointer(2, GL_FLOAT, sizeof(tBSPVertex), @Vertices[Face.startVertIndex].TextureCoord);
  404.  
  405.     if Face.FaceType = FACE_MESH then begin
  406.       glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(TBSPVertex), @Vertices[Face.startVertIndex].Color);
  407.       glEnableClientState(GL_COLOR_ARRAY);
  408.     end
  409.     else
  410.       glColor3ub(255,255,255);
  411.     if LockArrays then glLockArraysEXT(0, Face.numMeshVerts);
  412.  
  413.     BindTextures(Face.textureID, Face.lightmapID); //Faces[faceIndex].lightmapID);
  414.     glPolygonOffset(0.1,100);
  415.     glDrawElements(GL_TRIANGLES, face.numMeshVerts, GL_UNSIGNED_INT, @MeshVertices[face.meshVertIndex]);
  416.  
  417.     if Face.FaceType = FACE_MESH then
  418.     glDisableClientState(GL_COLOR_ARRAY);
  419.  
  420.     if LockArrays then glUnlockArraysEXT();
  421.     //SetDefaults;
  422.     if (numOfEffects > 0) and (Faces[faceIndex].effect > -1) and (not GetCvarB('Cg_SimpleRender')) and GetCvarB('Cg_Fog') then begin
  423.       if (Effects[Faces[faceIndex].effect].visibleside >= 0) then
  424.         planeIdx := BrushSides[Brushes[Effects[Faces[faceIndex].effect].brushIndex].brushside + Effects[Faces[faceIndex].effect].visibleside].plane
  425.       else
  426.         planeIdx :=  -1;
  427.       RenderFog(faceIndex, Effects[Faces[faceIndex].effect].shaderIndex, planeIdx);
  428.       SetDefaults;
  429.     end;
  430.   except
  431.     lastError := glGetError();
  432.     lastErrorString := gluErrorString(lastError);
  433.     {$IfDef HELIOS_CONSOLE}Cons.AddIfDifferent('RenderSurface ' + lastErrorString + ' ' + IntToStr(faceIndex));{$EndIf}
  434.   end;
  435. end;
  436.  


Iv left out the entity's rendering stuff cos there the same with minor modifications, WalkLeaf is just a thing to sort the faces into the 3 categorys, solid, aditive and transparent.

There is alot more faces that use Rendersurface than rendersurfaceshader.

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Okt 12, 2004 17:19 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
I found the main speed issue and not supprisingly it was me being stupid. The GetcvarB searches the array of cvars and returns the value of the cvar u want. Its used alot in the rendering procedures. Fixed by using varibles to store the current values (updated each frame using the getcvarb)

Version 0.8
- Helios Lite (1MB)
- Helios Full (4MB)

Full's Extras
- Particle Test map + its textures
- Shader Editor
- MD3 Viewer
- Particle Editor
- Vector Particle Editor

Particles
You can view the particles in the engine (with no map running, type closemap in console). You can also add particles to maps tho its best when no map is running.

usage: addparticles <name>

Current Particles:
Smoke
Fire
Drip
Fountain
Shower
Sprinkler
Space

NOTE: The things to save bind calls have been commented out due to JKA maps not displaying any faces that didn't always bind a texture....... its wierd....


Dateianhänge:
Dateikommentar: Area with the worst FPS in Escape1.bsp, use to get 10 fps now 22 fps. (30 fps in the test area which use to get 16-17fps)
ESCAPE1_0024_small.jpg
ESCAPE1_0024_small.jpg [ 202.16 KiB | 5122-mal betrachtet ]

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu
Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Okt 12, 2004 17:32 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Nice job, but performance hasn't improved much on my Radeon 9700. I'm running at 1280x960, 32 Bit and Fullscreen, using no AA and 16xAF. Performance in the same map as you showed (escape1) still sometimes drops down to 15 FpS, and I get some flickering due to overlapping polygons (maybe lightmaps). But besides that it's looking great.

One small note : You use an installer, which is nice, but most people don't like to install things that they just want to quickly try out. So it may be a good idea to also include a download to a zipped version.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Okt 12, 2004 20:04 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Which part of the map do you get 15fps? Lightmaps are drawn over the normal texture with shaders, but faces with no shaders have the lightmap in GL_TEXTURE1 and are only drawn once not every shader layer. Seems a waste to redraw the face for each layer of the shaders.....

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 31 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3  Nächste
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 4 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.076s | 19 Queries | GZIP : On ]