Commit ea8c9669 by Kai Westerkamp

Fixed Normal passthroug at Tesselation Control Shader

Added some models, /changeed Paths to relative Paths
parent a23de70f
Pipeline #83 skipped
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
material
{
technique
{
pass
{
}
}
}
material unity_pilot_head_01
{
technique
{
pass
{
ambient 0.588235 0.588235 0.588235
diffuse 0.588235 0.588235 0.588235
specular 0 0 0 0.015625
emissive 0 0 0
texture_unit
{
texture head01.png
filtering point point point
}
}
}
}
material unity_pilot_body_01
{
technique
{
pass
{
ambient 0.588235 0.588235 0.588235
diffuse 0.588235 0.588235 0.588235
specular 0 0 0 0.015625
emissive 0 0 0
texture_unit
{
texture body01.png
filtering point point point
}
}
}
}
material m4
{
technique
{
pass
{
ambient 1 1 1
diffuse 1 1 1
specular 1 1 1 40
emissive 1 1 1
texture_unit
{
texture m4tex.png
filtering point point point
}
}
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
# Wavefront MTL
# Created by fragMOTION
# http://www.fragmosoft.com
newmtl unity_pilot_head_01
illum 2
d 1
ka 0.588235 0.588235 0.588235
kd 0.588235 0.588235 0.588235
ks 0 0 0
ke 0 0 0
ns 0.015625
map_kd C:\Users\Nathan\Documents\New Project\Assets\Textures\soldier\head01.png
newmtl unity_pilot_body_01
illum 2
d 1
ka 0.588235 0.588235 0.588235
kd 0.588235 0.588235 0.588235
ks 0 0 0
ke 0 0 0
ns 0.015625
map_kd C:\Users\Nathan\Documents\New Project\Assets\Textures\soldier\body01.png
newmtl m4
illum 2
d 1
ka 1 1 1
kd 1 1 1
ks 1 1 1
ke 1 1 1
ns 40
map_kd C:\Users\Nathan\Documents\New Project\Assets\Textures\soldier\m4tex.png
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
21:34:53: Creating resource group General
21:34:53: Creating resource group Internal
21:34:53: Creating resource group Autodetect
21:34:53: Registering ResourceManager for type Mesh
21:34:53: Registering ResourceManager for type Material
21:34:53: Registering ResourceManager for type Skeleton
21:34:53: XMLMeshSerializer reading mesh data from C:\Users\Nathan\Documents\ArmyPilot\ArmyPilot.mesh.xml...
21:34:54: Reading submeshes...
21:34:54: Reading geometry...
21:34:54: Geometry done...
21:34:54: Reading bone assignments...
21:34:54: Bone assignments done.
21:34:54: Reading geometry...
21:34:55: Geometry done...
21:34:55: Reading bone assignments...
21:34:55: Bone assignments done.
21:34:55: Reading geometry...
21:34:55: Geometry done...
21:34:55: Reading bone assignments...
21:34:55: Bone assignments done.
21:34:55: Submeshes done.
21:34:55: Skeleton: Loading ArmyPilot.skeleton
21:34:55: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource ArmyPilot.skeleton in resource group General or any other group. in ResourceGroupManager::openResource at ..\..\..\..\OgreMain\src\OgreResourceGroupManager.cpp (line 753)
21:34:55: Unable to load skeleton ArmyPilot.skeleton for Mesh conversion. This Mesh will not be animated. You can ignore this message if you are using an offline tool.
21:34:55: XMLMeshSerializer import successful.
21:34:55: Reorganising vertex buffers to automatic layout..
21:34:55: MeshSerializer writing mesh data to C:\Users\Nathan\Documents\ArmyPilot\ArmyPilot.mesh...
21:34:55: File header written.
21:34:55: Writing mesh data...
21:34:55: Writing submesh...
21:34:55: Exporting submesh texture aliases...
21:34:55: Submesh texture aliases exported.
21:34:55: Exporting dedicated geometry bone assignments...
21:34:55: Dedicated geometry bone assignments exported.
21:34:55: Submesh exported.
21:34:55: Writing submesh...
21:34:55: Exporting submesh texture aliases...
21:34:55: Submesh texture aliases exported.
21:34:55: Exporting dedicated geometry bone assignments...
21:34:55: Dedicated geometry bone assignments exported.
21:34:55: Submesh exported.
21:34:55: Writing submesh...
21:34:55: Exporting submesh texture aliases...
21:34:55: Submesh texture aliases exported.
21:34:55: Exporting dedicated geometry bone assignments...
21:34:55: Dedicated geometry bone assignments exported.
21:34:55: Submesh exported.
21:34:55: Exporting skeleton link...
21:34:55: Skeleton link exported.
21:34:55: Exporting bounds information....
21:34:55: Bounds information exported.
21:34:55: Exporting submesh name table...
21:34:55: Submesh name table exported.
21:34:55: Exporting edge lists...
21:34:55: Edge lists exported
21:34:55: Mesh data exported.
21:34:55: MeshSerializer export successful.
21:34:55: Unregistering ResourceManager for type Skeleton
21:34:55: Unregistering ResourceManager for type Material
21:34:55: Unregistering ResourceManager for type Mesh
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
# Blender v2.57 (sub 0) OBJ File: ''
# www.blender.org
mtllib box.mtl
o Cube
v 1.000000 -1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v -1.000000 -1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -1.000000
v 0.999999 1.000000 1.000001
v -1.000000 1.000000 1.000000
v -1.000000 1.000000 -1.000000
vt 2.094305 1.396205
vt 1.396205 2.094305
vt 0.698100 1.396205
vt 1.396205 0.698100
vt 5.000000 5.000000
vt 2.792410 5.000000
vt 2.792410 2.792410
vt 5.000000 2.792410
vt 2.792410 2.094305
vt 2.094305 2.792410
vt 0.698100 2.792410
vt 0.000000 2.094305
vt 0.000000 0.698100
vt 0.698100 0.000000
vt 2.792410 0.698100
vt 2.094305 0.000000
usemtl Material
s off
f 1/1 2/2 3/3
f 1/1 3/3 4/4
f 5/5 8/6 7/7
f 5/5 7/7 6/8
f 1/1 5/9 6/10
f 1/1 6/10 2/2
f 2/2 6/11 7/12
f 2/2 7/12 3/3
f 3/3 7/13 8/14
f 3/3 8/14 4/4
f 5/15 1/1 4/4
f 5/15 4/4 8/16
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
hey guys heres all the ranges for the ninja model, 20 ranges and 300 frames....Phew!!
you may need to scale or rotate the model and change animation speeds for various 3D game engines...
Please check the numbers carefully cus they dont follow any order and in between ranges often skip a few frames, this as how I achieved certain moves in Character FX its not a mistake :)
1-14 Walk (normal)
15-30 Stealth Walk
32-44 Punch and swipe sword
45-59 Swipe and spin sword
60-68 Overhead twohanded downswipe
69-72 Up to block position (play backwards to lower sword if you want)
73-83 Forward kick
84-93 Pick up from floor (or down to crouch at frame 87)
94-102 Jump
103-111 Jump without height (for programmer controlled jumps)
112-125 High jump to Sword Kill (Finish em off move??)
126-133 Side Kick
134-145 Spinning Sword attack (might wanna speed this up in game)
146-158 Backflip
159-165 Climb wall
166-173 Death 1 - Fall back onto ground
174-182 Death 2 - Fall forward onto ground
184-205 Idle 1 - Breathe heavily
206-250 Idle 2
251-300 Idle 3
Ok there it is, have fun and maybe drop by my forums hang out, ask questions, post your own work etc
Feel free to use however you like, commercial etc, credits are Appreciated as a LOT of work went into this! ;-)
This source diff could not be displayed because it is too large. You can view the blob instead.
# Blender v2.57 (sub 0) OBJ File: ''
# www.blender.org
o Cube_Cube.001
v -1.000000 1.000000 0.000000
v 1.000000 1.000000 0.000000
v -1.000000 -1.000000 0.000000
v 1.000000 -1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
usemtl (null)
s off
f 4/4 3/3 1/2
f 2/1 4/4 1/2
# Blender v2.57 (sub 0) OBJ File: ''
# www.blender.org
o Cube_Cube.001
v -1.000000 1.000000 0.000000
v 1.000000 1.000000 0.000000
v -1.000000 -1.000000 0.000000
v 1.000000 -1.000000 0.000000
vt 1.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 1.000000
vt 1.000000 1.000000
usemtl (null)
s off
f 4/4 3/3 1/2
f 2/1 4/4 1/2
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -5,8 +5,7 @@ MainWidget::MainWidget(Camera *cam) ...@@ -5,8 +5,7 @@ MainWidget::MainWidget(Camera *cam)
this->cam = cam; this->cam = cam;
startTime = QTime::currentTime(); startTime = QTime::currentTime();
rotTime = QTime::currentTime(); rotTime = QTime::currentTime();
wireframe = true; wireframe = false;
rotation = true; rotation = true;
} }
...@@ -107,18 +106,21 @@ void MainWidget::initializeGL(){ ...@@ -107,18 +106,21 @@ void MainWidget::initializeGL(){
// Shader // Shader
subdevisionShader = initShaderProgram(); subdevisionShader = initShaderProgram();
loadNewMesh( "D:/Projekte/GraPa/A5/Models/jeep.obj"); loadNewMesh( "../Models/demon_head.3ds");
} }
void MainWidget::loadNewMesh(){ void MainWidget::loadNewMesh(){
QString fn = QFileDialog::getOpenFileName(NULL, tr("Open Mesh..."), QString fn = QFileDialog::getOpenFileName(NULL, tr("Open Mesh..."),
QString("D:\\Projekte\\GraPa\\A5\\Models"), QString("..\\Models"),
tr("*.md5mesh *.3ds *.md2 *.obj *.dae *.dxf *.mesh.xml *.blend *.b3d" )); tr("*.md5mesh *.3ds *.md2 *.obj *.dae *.dxf *.mesh.xml *.blend *.b3d" ));
loadNewMesh(fn); loadNewMesh(fn);
} }
void MainWidget::loadNewMesh(QString path){ void MainWidget::loadNewMesh(QString path){
QDir dir(".");
qDebug()<<dir.absolutePath();
if(path.isEmpty()) if(path.isEmpty())
return; return;
......
...@@ -22,6 +22,9 @@ public: ...@@ -22,6 +22,9 @@ public:
QSize minimumSizeHint() const; QSize minimumSizeHint() const;
QSize sizeHint() const; QSize sizeHint() const;
boolean rotation;
boolean wireframe;
public slots: public slots:
void loadNewMesh(); void loadNewMesh();
void loadNewMesh(QString path); void loadNewMesh(QString path);
...@@ -56,8 +59,7 @@ private: ...@@ -56,8 +59,7 @@ private:
QVector3D *lastSpeherePos; QVector3D *lastSpeherePos;
QPointF * lastScreenPos; QPointF * lastScreenPos;
boolean rotation;
boolean wireframe;
Mesh *mesh; Mesh *mesh;
......
...@@ -18,13 +18,13 @@ MainWindow::MainWindow(QWidget *parent) : ...@@ -18,13 +18,13 @@ MainWindow::MainWindow(QWidget *parent) :
switchRotation = new QAction("Rotation",this); switchRotation = new QAction("Rotation",this);
switchRotation->setCheckable(true); switchRotation->setCheckable(true);
switchRotation->setChecked(true); switchRotation->setChecked(m_centralWidget->rotation);
connect(switchRotation, SIGNAL(triggered(bool)), m_centralWidget, SLOT(setRotation(bool))); connect(switchRotation, SIGNAL(triggered(bool)), m_centralWidget, SLOT(setRotation(bool)));
toolBar->addAction(switchRotation); toolBar->addAction(switchRotation);
switchWireframe = new QAction("Wireframe",this); switchWireframe = new QAction("Wireframe",this);
switchWireframe->setCheckable(true); switchWireframe->setCheckable(true);
switchWireframe->setChecked(true); switchWireframe->setChecked(m_centralWidget->wireframe);
connect(switchWireframe, SIGNAL(triggered(bool)), m_centralWidget, SLOT(setWireframe(bool))); connect(switchWireframe, SIGNAL(triggered(bool)), m_centralWidget, SLOT(setWireframe(bool)));
toolBar->addAction(switchWireframe); toolBar->addAction(switchWireframe);
......
...@@ -318,6 +318,8 @@ void Mesh::renderMesh(QOpenGLShaderProgram *shader, int index) ...@@ -318,6 +318,8 @@ void Mesh::renderMesh(QOpenGLShaderProgram *shader, int index)
{ {
int MaterialIndex = entries[index].materialIndex; int MaterialIndex = entries[index].materialIndex;
if (MaterialIndex < materials.size()) { if (MaterialIndex < materials.size()) {
// qDebug()<<materials[MaterialIndex].Diffuse<<materials[MaterialIndex].Specular<<materials[MaterialIndex].Shininess<<materials[MaterialIndex].hasTexture;
shader->setUniformValue("materialInfo.Diffuse",materials[MaterialIndex].Diffuse); shader->setUniformValue("materialInfo.Diffuse",materials[MaterialIndex].Diffuse);
shader->setUniformValue("materialInfo.Specular",materials[MaterialIndex].Specular); shader->setUniformValue("materialInfo.Specular",materials[MaterialIndex].Specular);
shader->setUniformValue("materialInfo.Shininess",materials[MaterialIndex].Shininess); shader->setUniformValue("materialInfo.Shininess",materials[MaterialIndex].Shininess);
......
#version 420 #version 430
layout(location = 0) out vec3 color; layout(location = 0) out vec3 color;
in vec3 gCamPosition; in vec3 gCamPosition;
...@@ -24,11 +24,13 @@ uniform Material materialInfo; ...@@ -24,11 +24,13 @@ uniform Material materialInfo;
vec3 phong(vec3 lightPos){ vec3 phong(vec3 lightPos){
vec3 dcolor = materialInfo.Diffuse; vec3 dcolor = materialInfo.Diffuse;
vec3 dcolor2 = texture2D(colorTexture,gUV).xyz;
vec3 dcolor2 = texture2D(colorTexture,gUV).xyz;
if(materialInfo.hasTexture){ if(materialInfo.hasTexture){
dcolor = dcolor2; dcolor = dcolor2;
} }
vec3 V = normalize(-gCamPosition); vec3 V = normalize(-gCamPosition);
vec3 N = normalize(gCamNormal); vec3 N = normalize(gCamNormal);
vec3 L = normalize(lightPos-gCamPosition); vec3 L = normalize(lightPos-gCamPosition);
...@@ -39,7 +41,7 @@ vec3 phong(vec3 lightPos){ ...@@ -39,7 +41,7 @@ vec3 phong(vec3 lightPos){
//return vec3(diffuse ); //return vec3(diffuse );
//return dcolor; //return dcolor;
return (diffuse*dcolor); //return (diffuse*dcolor);
return (dcolor * diffuse + materialInfo.Specular * specular); return (dcolor * diffuse + materialInfo.Specular * specular);
} }
...@@ -65,6 +67,7 @@ void addWireframe(){ ...@@ -65,6 +67,7 @@ void addWireframe(){
void main() void main()
{ {
color = phong(LightPos); color = phong(LightPos);
// color = abs(normalize(gCamNormal));
addWireframe(); addWireframe();
......
#version 420 #version 430
layout (triangles) in; layout (triangles) in;
layout (triangle_strip, max_vertices = 3) out; layout (triangle_strip, max_vertices = 3) out;
......
#version 420 #version 430
layout(vertices = 3) out; layout(vertices = 3) out;
in vec3 vPosition[]; in vec3 vPosition[];
...@@ -16,6 +16,7 @@ uniform vec3 CamPos; ...@@ -16,6 +16,7 @@ uniform vec3 CamPos;
void main() void main()
{ {
tcPosition[gl_InvocationID] = vPosition[gl_InvocationID]; tcPosition[gl_InvocationID] = vPosition[gl_InvocationID];
tcNormal[gl_InvocationID] = vNormal[gl_InvocationID];
tcUV[gl_InvocationID] = vUV[gl_InvocationID]; tcUV[gl_InvocationID] = vUV[gl_InvocationID];
float tesselation = 1.0; float tesselation = 1.0;
......
#version 420 #version 430
layout(triangles, equal_spacing, cw) in; layout(triangles, equal_spacing, cw) in;
in vec3 tcPosition[]; in vec3 tcPosition[];
......
#version 420 #version 430
layout(location = 0) in vec3 Position; layout(location = 0) in vec3 Position;
layout(location = 1) in vec3 Normal; layout(location = 1) in vec3 Normal;
layout(location = 2) in vec2 UV; layout(location = 2) in vec2 UV;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment