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

Aktuelle Zeit: Di Mai 14, 2024 16:12

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



Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 
Autor Nachricht
BeitragVerfasst: So Nov 21, 2004 00:47 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
The shader editor edits Quake 3 shaders which can be found in:

Quake 3
Return to Castle Wolfenstein
Jedi Knight: Jedi Academy

And alot of other games. The program also has basic(Very) support for Doom 3 Shaders(Materials). The Shaders control how the textures are drawn, what blend effects to apply, if it should be rotated, stretched, etc. You can have layer on layer each with different effects. Quake 3's shaders show off the Q3 shaders the best.


To compile the program you need to install:

SynEdit By Michael Hieke
Url: http://synedit.sourceforge.net

Unihighlighter By Vitaly Nevzorov and Kirill Burtsev
Url: http://www.delphist.com/UniHighlighter.html

Program Limitations:
You can't add new shaders or delete them. You can't create a new shader file(only edit and save).


Dateianhänge:
ShaderTest2.jpg
ShaderTest2.jpg [ 70.97 KiB | 3868-mal betrachtet ]
ShaderTest2.zip [151.84 KiB]
282-mal heruntergeladen

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu
Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Dez 18, 2004 23:06 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Zitat:
1.1
- revisions by Stucuk:
- Added: New, New Shader and Save As feature
- Added: Shader Error logging. All failed texture loads are recorded.
- Added: Environment position can now be changed (effects like glass are effected by this)
- Added: Fake lightmaps can be enabled to give a feel as to what the shader would look like with lightmaps
- Added: You can turn the shaders layers on and off, allowing you to "disect" the shader layer by layer.
- BugFix: Shader changes are fully "saved" (some edits were lost in 1.0)

To Do

Make it so user can see the shader on a 3d cube insted of a flat 2d image. with controls to rotate it (optional user choice)
Bumpmapping (Doom3 Style)
Doom3 Compatibility (I.E allowing things like 1 + time / 5... but would need bumpmapping to make it worthwhile)

Known Issues

Shader files with no actual shader definitions will cause an Access Violation


Below is the source to the program and some images. The images show the different layers of one shader. To show how they work, and how simpel they are. The advantage with "texture shaders" over animations is that there "perfectly animated". Animations with 4 seconds of animation would take about 100 frames (tv quality 25fps), each frame would have to be loaded into the computers memory. With "texture shaders" you would only need a max(iv never seen any reach this ammount) of 10 textures for any animation.

Description of the shader shown in the pics below:
Layer 1 - This base layer scrolls upwards
Layer 2 - This layer rotates and at the same time shrinks then grows (repeates)
Layer 3 - Same as layer 2
Layer 4 - Static

P.S one of the best shaders imo is textures\base_wall\q3tourneyscreen which can be found in Quake 3's base_wall.shader. If anyone improves this program, plz inform me.


Dateianhänge:
Dateikommentar: Layer 1
ShaderEditor1.1_P1.jpg [101.01 KiB]
87-mal heruntergeladen
Dateikommentar: Layer 2,3 & 4
ShaderEditor1.1_P2.jpg [225.67 KiB]
87-mal heruntergeladen
Dateikommentar: Source Code
ShaderEditor2_v1.1.zip [157.96 KiB]
262-mal heruntergeladen

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

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Zitat:
1.2
- revisions by Stucuk:
- Added: 3d Square mode (allows you to see the deformations applied to some shaders)
- Added: Bumpmapping (tho it doesn’t work….)
- Added: When making a new file you can select if it’s a .shader or .mtr
- Changed: Fake lightmaps are on by default and are pure white
- BugFix: New and New Shader fixed.


Warning: For bumpmapping to work(well if someone could fix the programming) you need the 2 shader files from Sascha Willems's simplebump_v2 demo found Here

(bump_fp.txt and bump_vp.txt need to be placed in main\shader\ for bumpmapping to "work")


As said above the bumpmapping doesn't work, the output is always a black square. The tangents don't seem to be right... Included is a doom3 shader (modifyed) which if bumpmapping was working would show bumpmapping, there is also a nonbumpmap verson showing what the diffuse texture looks like. (Load -> Mod: Doom 3, Shader: Charactors)

You can download 1.2 here (1.44mb)

P.S if anyone finds out why bumpmapping doesn't work plz tell me.
Note: If bumpmapping worked you would need a GFX card that supports Fragment programs. for bumpmapping to do anything.

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mo Dez 20, 2004 23:39 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
after looking at the simplebump_v2 i found some differences from my implementation, so i modifyed it to whats seen below..... but it is still black...

simplebump_v2:
Code:
  1.  
  2. // =============================================================================
  3. //  TGLForm.RenderPath_ARBShader
  4. // =============================================================================
  5. //  Render path for ARB_Vertex_Program and ARB_Vertex_Shader. Needs PS2.0
  6. //  support, but is most likely faster then the glSlang render path.
  7. // =============================================================================
  8. procedure TGLForm.RenderPath_ARBShader;
  9. begin
  10. glBindProgramARB(GL_VERTEX_PROGRAM_ARB, BumpVPARB);
  11. glEnable(GL_VERTEX_PROGRAM_ARB);
  12. glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 0, LightPos.x,LightPos.y,LightPos.z,0);
  13. glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 1, 0,10,10,0);
  14.  
  15. glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, BumpFPARB);
  16. glEnable(GL_FRAGMENT_PROGRAM_ARB);
  17. glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, 1/50,1/50,1/50,1/50); // invRadius
  18. glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, 0,0,0,0);    // ambient
  19.  
  20. // Bind base map to texture unit 0
  21. glActiveTexture(GL_TEXTURE0);
  22. glBindTexture(GL_TEXTURE_2D, DecalTex);
  23. glEnable(GL_TEXTURE_2D);
  24. // Bind normal map to texture unit 1
  25. glActiveTexture(GL_TEXTURE1);
  26. glBindTexture(GL_TEXTURE_2D, NormalMap);
  27. glEnable(GL_TEXTURE_2D);
  28. // Bind specular map to texture unit 2
  29. glActiveTexture(GL_TEXTURE2);
  30. glBindTexture(GL_TEXTURE_2D, SpecularMap);
  31. glEnable(GL_TEXTURE_2D);
  32.  
  33. glClientActiveTexture(GL_TEXTURE0);
  34. glActiveTexture(GL_TEXTURE0);
  35. Primitive[PrimType].Render;
  36.  
  37. // Disable textures
  38. glActiveTextureARB(GL_TEXTURE0_ARB);
  39. glDisable(GL_TEXTURE_2D);
  40. glActiveTextureARB(GL_TEXTURE1_ARB);
  41. glDisable(GL_TEXTURE_2D);
  42. glActiveTextureARB(GL_TEXTURE2_ARB);
  43. glDisable(GL_TEXTURE_2D);
  44.  
  45. glDisable(GL_VERTEX_PROGRAM_ARB);
  46. glDisable(GL_FRAGMENT_PROGRAM_ARB);
  47. end;
  48.  


Shader Editor:
Code:
  1.  
  2. glBindProgramARB(GL_VERTEX_PROGRAM_ARB, BumpVP);
  3. glEnable(GL_VERTEX_PROGRAM_ARB);
  4. glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 0, LightPos.X,LightPos.Y,LightPos.Z,0);
  5. glProgramLocalParameter4fARB(GL_VERTEX_PROGRAM_ARB, 1, 0,0,0,0);
  6.  
  7. glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, BumpFP);
  8. glEnable(GL_FRAGMENT_PROGRAM_ARB);
  9. glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, 1/50,1/50,1/50,1/50); // invRadius
  10. glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 1, 0,0,0,0);    // ambient
  11.  
  12. // Bind base map to texture unit 0
  13. glActiveTexture(GL_TEXTURE0);
  14. glEnable(GL_TEXTURE_2D);
  15. glBindTexture(GL_TEXTURE_2D, Shader.DiffuseMapID);
  16.  
  17. // Bind normal map to texture unit 1
  18. glActiveTexture(GL_TEXTURE1);
  19. glBindTexture(GL_TEXTURE_2D, Shader.BumpMapID);
  20. glEnable(GL_TEXTURE_2D);
  21. // Bind specular map to texture unit 2
  22. glActiveTexture(GL_TEXTURE2);
  23. glBindTexture(GL_TEXTURE_2D, Shader.SpecularMapID);
  24. glEnable(GL_TEXTURE_2D);
  25.  
  26. {Render Code Below}
  27.  
  28. // Disable textures
  29. glActiveTexture(GL_TEXTURE1);
  30. glDisable(GL_TEXTURE_2D);
  31. glActiveTexture(GL_TEXTURE2);
  32. glDisable(GL_TEXTURE_2D);
  33. glActiveTexture(GL_TEXTURE0);
  34. //glDisable(GL_TEXTURE_2D);
  35.  
  36. glDisable(GL_VERTEX_PROGRAM_ARB);
  37. glDisable(GL_FRAGMENT_PROGRAM_ARB);
  38.  


simplebump_v2 Render code:
Code:
  1.  
  2. // Set vertex array
  3. glVertexPointer(3, GL_FLOAT, 0, Vertex);
  4. glEnableClientState(GL_VERTEX_ARRAY);
  5. // Set normal array
  6. glNormalPointer(GL_FLOAT, SizeOf(TglVertexTBN), @Tangent[0].Normal);
  7. glEnableClientState(GL_NORMAL_ARRAY);
  8. // Set texture coords array
  9. glTexCoordPointer(2, GL_FLOAT, sizeof(TglVertexTBN), @Tangent[0].s);
  10. glEnableClientState(GL_TEXTURE_COORD_ARRAY);
  11. // Send sTangent on tex coord 1
  12. glClientActiveTexture(GL_TEXTURE1);
  13. glTexCoordPointer(3, GL_FLOAT, sizeof(TglVertexTBN), @Tangent[0].sTangent);
  14. glEnableClientState(GL_TEXTURE_COORD_ARRAY);
  15. glClientActiveTexture(GL_TEXTURE0);
  16. // Send tTangent on tex coord 2
  17. glClientActiveTexture(GL_TEXTURE2);
  18. glTexCoordPointer(3, GL_FLOAT, sizeof(TglVertexTBN), @Tangent[0].tTangent);
  19. glEnableClientState(GL_TEXTURE_COORD_ARRAY);
  20. glClientActiveTexture(GL_TEXTURE0);
  21. // Send Normaö on tex coord 3
  22. glClientActiveTexture(GL_TEXTURE3);
  23. glTexCoordPointer(3, GL_FLOAT, sizeof(TglVertexTBN), @Tangent[0].Normal);
  24. glEnableClientState(GL_TEXTURE_COORD_ARRAY);
  25. glClientActiveTexture(GL_TEXTURE0);
  26. // Render
  27. case primType of
  28.  TglTorus : glDrawElements(GL_TRIANGLES, Length(Index), GL_UNSIGNED_INT, Index);
  29.  TglPlane : glDrawElements(GL_QUADS, Length(Index), GL_UNSIGNED_INT, Index);
  30. end;
  31.  


Shader Editor Render code:
Code:
  1.  
  2.       glDisable(GL_CULL_FACE);
  3.       glBegin(GL_TRIANGLES);
  4.       For i := 0 to 5 do
  5.       begin
  6. glClientActiveTexture(GL_TEXTURE0);
  7. glActiveTexture(GL_TEXTURE0);
  8.  
  9.       glNormal3f(V[i].Normal.X,V[i].Normal.Y,V[i].Normal.Z);
  10.       glTexCoord2f(V[i].TextureCoord.X,V[i].TextureCoord.Y);
  11.  
  12.       glClientActiveTexture(GL_TEXTURE1);
  13.       glTexCoord3f(Tan[i].sT.X,Tan[i].sT.Y,Tan[i].sT.Z);
  14.       glClientActiveTexture(GL_TEXTURE0);
  15.       // Send tTangent on tex coord 2
  16.       glClientActiveTexture(GL_TEXTURE2);
  17.       glTexCoord3f(Tan[i].tT.X,Tan[i].tT.Y,Tan[i].tT.Z);
  18.       glClientActiveTexture(GL_TEXTURE0);
  19.       // Send Normaö on tex coord 3
  20.       glClientActiveTexture(GL_TEXTURE3);
  21.       glTexCoord3f(V[i].Normal.X,V[i].Normal.Y,V[i].Normal.Z);
  22.  
  23.       glVertex3f(V[i].Position.X,V[i].Position.Y,V[i].Position.Z);
  24.       end;
  25.       glend;
  26.  


It doesn't need to be done with the Arrays does it? (Vertex array, etc)

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


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Dez 22, 2004 23:25 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Zitat:
1.3
- revisions by Stucuk:
- Added: Light position is changable
- Fixed: Bumpmapping now works (using Sascha Willems's shaders)


Warning: For bumpmapping to work you need the 2 shader files from Sascha Willems's simplebump_v2 demo found Here. You also need a GFX card that supports Vertex and Fragment programs

(bump_fp.txt and bump_vp.txt need to be placed in main\shader\ for bumpmapping to "work")

You can download 1.3 here (1.4mb)


Dateianhänge:
ShaderEditor1.3.jpg [163.66 KiB]
21-mal heruntergeladen

_________________
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  [ 5 Beiträge ] 
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:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.018s | 16 Queries | GZIP : On ]