Page 2 of 3

Posted: Mon Nov 29, 2010 1:05 am
by trivtn
Thanks christianclavet !
I've tried it !
DX with : 368
Dx without : 128
--
OpenGl with : 268
OpenGl without : 120
I'll install HW in my project ! many thanks !

Posted: Mon Nov 29, 2010 4:29 am
by lazerblade
Am I the only one getting shader compilation errors here? :sad:

Loaded mesh: dwarf.x
Joint Num: 46, current limit is 55 joints.
GLSL shader failed to compile
ERROR: 0:17: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:17: 'assign' : cannot convert from 'int' to 'uniform float'
ERROR: 0:18: '-' : wrong operand types no operation '-' exists that takes a left-hand operand of type 'uniform float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:18: '[]' : integer expression required
ERROR: 0:20: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:20: 'assign' : cannot convert from 'int' to 'uniform float'
ERROR: 0:21: '>' : wrong operand types no operation '>' exists that takes a left-hand operand of type 'uniform float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:22: '-' : wrong operand types no operation '-' exists that takes a left-hand operand of type 'uniform float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:22: '[]' : integer expression required
ERROR: 0:24: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:24: 'assign' : cannot convert from 'int' to 'uniform float'
ERROR: 0:25: '>' : wrong operand types no operation '>' exists that takes a left-hand operand of type 'uniform float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:26: '-' : wrong operand types no operation '-' exists that takes a left-hand operand of type 'uniform float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:26: '[]' : integer expression required
ERROR: 0:28: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:28: 'assign' : cannot convert from 'int' to 'uniform float'
ERROR: 0:29: '>' : wrong operand types no operation '>' exists that takes a left-hand operand of type 'uniform float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:30: '-' : wrong operand types no operation '-' exists that takes a left-hand operand of type 'uniform float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:30: '[]' : integer expression required
ERROR: 0:32: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:34: 'constructor' : constructing matrix from matrix (reserved)
ERROR: 0:34: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:40: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:41: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:42: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:43: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 26 compilation errors. No code generated.



I'm compiling with eclipse using MinGW GCC. Does that make any difference?

If it does, we'll tar and feather you for writing platform dependent code for a cross platform engine. :lol:


Here's the relevant source code if it helps.
Scene = what would normally be 'smgr'
and irrlicht = what would normally be 'device'

Code: Select all


IAnimatedMeshSceneNode* dwarf = Scene->addAnimatedMeshSceneNode(Scene->getMesh("dwarf.x"));
	dwarf->setScale(vector3df(1,1,1));
	dwarf->setMaterialFlag(EMF_LIGHTING, true);
	HWSkinCB::getInstance()->setupNode(irrlicht,dwarf,30);

I'm using christianclavet's latest version.

Posted: Mon Nov 29, 2010 4:38 am
by lazerblade
Aw snap!

I just found that when I run the demo and select to use OGL rendering, I get the same errors unless I disable HW skinning. The payload BTW, is that all the meshes appear dark. Probably because they're unlit.

Here's the full output of the demo:
Dx or Ogl?
1.Dx
2.Ogl
2

Activate the hardware skinning?
1.Yes
2.No
3.Disable skinning
1

Enable Lighting?
1.Yes
2.No
1

Joint Num: 46, current limit is 55 joints.
Irrlicht Engine version 1.7.2
Microsoft Windows XP Professional Service Pack 3 (Build 2600)
Using renderer: OpenGL 2.0.5077
MOBILITY RADEON X300 x86/SSE2: ATI Technologies Inc.
OpenGL driver version is 1.2 or better.
GLSL version: 1.1
Loaded texture: E:/lazerbladegames/Irrlicht/hwSkin/24. Hardware Skinning/axe.jpg
Loaded texture: E:/lazerbladegames/Irrlicht/hwSkin/24. Hardware Skinning/dwarf.jpg
Could not open file of texture: dwarf2.jpg
Loaded mesh: dwarf.x
GLSL shader failed to compile
ERROR: 0:17: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:17: 'assign' : cannot convert from 'int' to 'uniform float'
ERROR: 0:18: '-' : wrong operand types no operation '-' exists that takes a left-hand operand of type 'uniform float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:18: '[]' : integer expression required
ERROR: 0:20: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:20: 'assign' : cannot convert from 'int' to 'uniform float'
ERROR: 0:21: '>' : wrong operand types no operation '>' exists that takes a left-hand operand of type 'uniform float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:22: '-' : wrong operand types no operation '-' exists that takes a left-hand operand of type 'uniform float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:22: '[]' : integer expression required
ERROR: 0:24: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:24: 'assign' : cannot convert from 'int' to 'uniform float'
ERROR: 0:25: '>' : wrong operand types no operation '>' exists that takes a left-hand operand of type 'uniform float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:26: '-' : wrong operand types no operation '-' exists that takes a left-hand operand of type 'uniform float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:26: '[]' : integer expression required
ERROR: 0:28: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:28: 'assign' : cannot convert from 'int' to 'uniform float'
ERROR: 0:29: '>' : wrong operand types no operation '>' exists that takes a left-hand operand of type 'uniform float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:30: '-' : wrong operand types no operation '-' exists that takes a left-hand operand of type 'uniform float' and a right operand of type 'const int' (or there is no acceptable conversion)
ERROR: 0:30: '[]' : integer expression required
ERROR: 0:32: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:34: 'constructor' : constructing matrix from matrix (reserved)
ERROR: 0:34: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:40: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:41: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:42: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 0:43: 'assign' : l-value required "gl_LightSource" (can't modify a uniform)
ERROR: 26 compilation errors. No code generated.


Resizing window (640 480)

Posted: Mon Nov 29, 2010 5:28 am
by vinjn
Super good!Thanks a lot.
Being curios for a hardware skinned shader for a long long time.

Posted: Mon Nov 29, 2010 5:13 pm
by christianclavet
Hi Lazerblade!

I think the OpenGL shader crashed. I've been testing this only on Windows Vista so far.
GLSL shader failed to compile
The shader is mostly unmodified from BlindSide and should work on any platform that support OpenGL & DirectX

Found out what causing this (most probable cause)
Checked your output:
GLSL version: 1.1
Not sure the shader can work on this release of GLSL. Mine report release 4.0 here. Do you have all the updated drivers for your X300? Look like it's running on the barebones opengl windows driver.

Humm the shader for openGL seem to require OpenGL 4.0! I've tried to run it on a openGL 3.3 (Radeon EAH 4350) on XP and it crashed too.

Is there someone that know more about shader that could rewrite the shader for a lesser version of OpenGL?

Since you are on XP, have tried the DX shaders? The DX shaders seem to work well on XP. (Tried with Radeons 4300 and 4600)

Posted: Mon Nov 29, 2010 6:46 pm
by lazerblade
The DX shader works great.
I think I have the latest drivers, I do have an older card though.

Thx! :)

Posted: Sun Dec 05, 2010 6:45 pm
by macron12388
Hi! :) good job! However I have to agree that the lighting could use some optimization:

OpenGL with HWS with Lighting: 17 FPS

OpenGL with HWS without Lighting: 340 FPS

:lol:

Posted: Sun Dec 05, 2010 7:33 pm
by devsh
we need this done quickly into irrlicht core :)

Re: Hardware Skinning for Irrlicht 1.7

Posted: Fri Feb 22, 2013 4:16 pm
by ritti
Hiho everybody,
I just wantet to ask if there are some updates or news about Hardwareskinning in Irrlicht.
I tried the code posted by christianclavet and it works on an ATI card (with some modifications in the glsl file because of the #define variables) but now I tried it on my Nvidia GT640 with no success.
The Models just dont appear if I enable HWSkinning.
And there aren't any compile errors.
Here is a part of the Terminal output:

Code: Select all

getting name: : end
CXFileReader: reading animation
CXFileReader: reading animation key
CXFileReader: reading animation key
getting name: : hit
Time to load ascii X file: 93ms
Loaded mesh: dwarf.x
Joint Num: 46, current limit is 55 joints.
 
My System:
Ubuntu 12.10 x64
nvidia gt640
driver: Nvidia 304.48
OpenGL 4.2

What can I do to solve this problem?

Best regards

Ritti

Re: Hardware Skinning for Irrlicht 1.7

Posted: Tue Mar 05, 2013 9:30 pm
by etreum79
hi, I add the HardwareSkinCallback.ccp and HardwareSkinCallback.h in my project, and then I use my Dondo function as follows:

DLL_EXPORT void* DLL_APIENTRY HardwareSkin(const char* FileName)
{
IAnimatedMeshSceneNode* mesh1 = SceneManager->addAnimatedMeshSceneNode(SceneManager->getMesh(FileName));
ISkinnedMesh* mesh = (ISkinnedMesh*)mesh1->getMesh();
mesh->setHardwareSkinning(true);
HWSkinCB::getInstance()->setupNode(device,mesh1,17);
return (void *)mesh;
}

I fail to see the 3d model, this maybe bad my code? I copy the main example.

greetings.

Re: Hardware Skinning for Irrlicht 1.7

Posted: Wed Mar 06, 2013 10:26 pm
by etreum79
ok, ok, this is for anyone that the same thing happens to me or Ritti, the shader opengl does not work only works in DX9.

A greeting.

Re: Hardware Skinning for Irrlicht 1.7

Posted: Thu Mar 07, 2013 11:31 am
by Nadro
For hardware skinning the best idea is to use shader-pipeline branch (OGL 2D rendering in broken, but it'll be fixed soon). With FVF support you can prepare custom vertex attributes.

Re: Hardware Skinning for Irrlicht 1.7

Posted: Thu Mar 07, 2013 12:04 pm
by etreum79
Hi Nandro, although I know that here should not be the issue, but since you mention your shader-pipeline branch, I have several questions,

The version of that branch will irrlicht 2.0 support DirectX 11?

and if so approximate date for publication as a download? :roll:

otherwise it would be nice to explicaras how the skin with that branch hardware. :)

Greetings.

Re: Hardware Skinning for Irrlicht 1.7

Posted: Thu Mar 07, 2013 3:02 pm
by Nadro
Yes, this branch will be part of Irrlicht v2.0 (in v2.0 we'll oficially most of support current drivers + OGL ES drivers from ogl-es branch (those drivers will be available in v1.9) and 2 new drivers - DX11 and OGL3.x Core Profile).

Currently we don't know when v2.0 will be available. Check changes in shader-pipeline branch.

I don't have any samples on hdd, but you can check how to FVF system works in Irrlicht sources/examples (I also explained it on this forum in FVF topic some time ago). You can put vertex data like an indices and weights via attributes (GLSL) and semetics (HLSL).

BTW. I already fixed 2D renderer in OGL. All examples works fine now.

Re: Hardware Skinning for Irrlicht 1.7

Posted: Thu Mar 07, 2013 3:07 pm
by etreum79
Nadro thank you very much, I'm very close to both the trunk (which is now in its 1.9), both the branch-shader pipeline, I'll be waiting for the big news of its release