Scolring - Forum

Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology

Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered

You are not logged in.

#76 Re: Openspace3D » rendu de terrain » 6-Sep-2011 16:58:37

Voir la réponse sur le post en anglais, au moins tout le monde en aura connaissance.
http://www.scolring.org/forum/viewtopic.php?id=400

#77 Re: Openspace3D » How to use terrains on OpenSpace3D? » 6-Sep-2011 16:56:53

Hi amigoface,

there's obviously a plan to implement Ogre's terrain system, but no roadmap. Let me remind to everybody that OpenSpace3d is mainly developped in first case in the direction our client ask us to do, and only secondary in the direction the community ask... That's not because we are bad people, the explication is a lot simpler:
We need to do in priority what gives us money to continue, I hope everybody understand that, so, for the functionnalities that are not expressively asked by our current clients, we cannot assume a roadmap.
But that's one reason why we decide to go Open Source with our software: if the people whose likes and use OpenSpace3D want something that is not in it, they can add it (as long as you got the required skills, of course smile ). Depending of what you want, you may need to know a programming langage or even have some skills in 3d graphics... And even when the official team does not have time to develop, they will already be there to help or to give their visions concerning the best way of doing to add the missing functionality smile

As a side note concerning the paged terrain in Ogre, and as I said, I used it in a personnal project, and I can tell you that it's not finished, there's still some bugs in it, the size of the generated data is not optimized yet, and lots of little things that let me to say that it's not stable at this time, so it certainly be a bad idea to implement it know, as is. Furthemore, there was lots of modifications to it during this "google summer of code", I try the fork last month, and it was not stabilized either, but anyway, we do not have the time to develop it now. If anyone want to try to implement it, why not, but it will not be me nor Arkeon, cause we already have more work than we can handle at this time, both yikes

But of course, I'll keep your request in a part of my mind tongue

#78 Re: 3D » Blender 2.57 exporter » 30-Aug-2011 10:51:19

You can upload an image to an free online host like http://imageshack.us/, should be ok.
Your material script is not good at all!!! You only have one pass on the first technique, instead of 2... and the "ambient_ps" shader does not require 3 texture units, but two, it's the "diffuse_ps" shader (which is normally on the second pass) that requires 3!
This script shall be better, I clean it up so there's only minimal stuff for the bump shader (I do not try it, so check in the log if there's syntax errors):

// This is a comment

// Our material had two techniques, one is a shader bump effect, and one "backup" technique with no shader for PC that does not support the shaders used.
material cube_material.018
{
    technique cube_technique_bump   // Technique "name" is optionnal
    {
        pass cube_ambient_pass          // Pass "name" is optionnal
        { 
            vertex_program_ref ambient_vs
            {
            }
           
            fragment_program_ref ambient_ps
            {
            }
           
            texture_unit                        // Texture_unit "name" is optionnal too, automatically generated here
            {
                texture Cube/floor04_diff.png
                filtering liner liner liner
            }
           
            texture_unit
            {
                texture Cube/floor04_spec.png
                filtering liner liner liner
            }
        }

        pass cube_diffuse_pass
        {
            iteration once_per_light
	    scene_blend add
	    illumination_stage per_light

            vertex_program_ref diffuse_vs
	    {
	    }

	    fragment_program_ref diffuse_ps
	    {
	    }

	    texture_unit
	    {
	        texture Cube/floor04_diff.png
                filtering linear linear linear
            }

            texture_unit
            {
                texture Cube/floor04_spec.png
                filtering linear linear linear
            }

            texture_unit
            {
                texture Cube/floor04_normal.png
                filtering liner liner liner
            }
        }
    }

    technique cube_technique_no_shaders
    {
        pass cube_diffuse_pass
        {
            ambient 0.356863 0.356863 0.356863 1
            diffuse 0.603922 0.603922 0.603922 1
            specular 0.898039 0.898039 0.898039 1 80

            texture_unit
            {
                texture Cube/floor04_diff.png
                filtering linear linear linear
            }
        }
    }
}

And also, check that you added the "example\media\program\general.cg" and "examples\media\program\general.program" files to you project resources BEFORE loading your material script (they are where the vertex_program_ref and fragment_program_ref references are defined).

#80 Re: 3D » Blender 2.57 exporter » 29-Aug-2011 14:57:48

Indeed, you should have say: "me neither" tongue

#81 Re: 3D » Blender 2.57 exporter » 29-Aug-2011 13:54:47

If you need more information about the script system, check this page:
http://www.ogre3d.org/docs/manual/manual_14.html#SEC23

If you need a special effect (a material or a shader), you may search on the Ogre forum if someone ever created it:
http://www.ogre3d.org/forums/

I know that we have lots of russian users, but a few comes here... That's a shame, cause we can't help them if they stay on the russian forums. I choose to not respond in English on those forums as I think it shall be unwelcome... And also cause I'm not sure that there's lot of english speakers... I went to Slovakia last summer, and was surprised that the first foreign language they learnt was not english, but russian. People here in western europe often assume that english is the universal language that every people in the world should know, but it's far from being a reality hmm
So, do not hesitate to inform other users of those russian forums to ask their questions here when they can. This way, they can translate our responses and let non-english speaking people to have them too, that's how a community works, giving to other things we know smile

No problem with automatic translation, just check it, as I know russian/english google translate is not very efficient hmm ... I use it often to check what peoples says on some russian site (gcup.ru for example). What I was asking is to have a look at the translation before posting, nothing more  wink

#82 Pub - Café » Problème avec les vidéos sur le forum » 29-Aug-2011 09:52:06

Nodrev
Replies: 4

Salut,

Y'a un problème sur la balise "["video"]" sur le forum! Plus aucune ne fonctionne! Mais que s'est-il donc passé  hmm ?

#83 Re: 3D » Blender 2.57 exporter » 29-Aug-2011 09:44:24

And I know that this exporter supports shader edition, and exports basic shaders like bump, althought i did not manipulate it enought to explain it nor make a tutorial for this part of the exporter. Maybe you could have a look to it and give us your feedback.

#84 Re: 3D » Blender 2.57 exporter » 29-Aug-2011 09:39:23

Hum, OpenSpace3D is a real-time engine, and uses shaders to render this kind of information. Look at the "bump" example, to see how the "fond_piscine_normal.jpg" normal map is used in the material script:

material fond_piscine
{
	lod_distances 0 10
	technique Map#36
	{
	  lod_index 1
		pass Map#37
		{
			ambient 0.356863 0.356863 0.356863 1
			diffuse 0.603922 0.603922 0.603922 1
			specular 0.898039 0.898039 0.898039 1 80

			vertex_program_ref ambient_vs
			{
			}

			fragment_program_ref ambient_ps
			{
			}

			texture_unit Map#38
			{
				texture_alias Map#38
				texture examples/media/bitmap/fond_piscine_diff.jpg
				filtering linear linear linear
			}

			texture_unit Map#304
			{
				texture_alias Map#304
				texture examples/media/bitmap/fond_piscine_spec.jpg
				filtering linear linear linear
			}
		}

		pass Map#305
		{
			iteration once_per_light
			ambient 0.356863 0.356863 0.356863 1
			diffuse 0.603922 0.603922 0.603922 1
			specular 0.898039 0.898039 0.898039 1 80
			scene_blend add
			illumination_stage per_light

			vertex_program_ref diffuse_vs
			{
			}

			fragment_program_ref diffuse_ps
			{
			}

			texture_unit Map#38
			{
				texture_alias Map#38
				texture examples/media/bitmap/fond_piscine_diff.jpg
				filtering linear linear linear
			}

			texture_unit Map#304
			{
				texture_alias Map#304
				texture examples/media/bitmap/fond_piscine_spec.jpg
				filtering linear linear linear
			}

			texture_unit Map#306
			{
				texture_alias Map#306
				texture examples/media/bitmap/fond_piscine_normal.jpg
				filtering linear linear linear
			}
		}

	}

	technique Texture#332
	{
	  lod_index 2
		pass Map#37
		{
			ambient 0.356863 0.356863 0.356863 1
			diffuse 0.603922 0.603922 0.603922 1
			specular 0.898039 0.898039 0.898039 1 80

			texture_unit Map#38
			{
				texture_alias Map#38
				texture examples/media/bitmap/fond_piscine_diff.jpg
				filtering linear linear linear
			}
		}
	}

}

In a nut case, this material contains two technique, one with shaders, the second for graphic cards that does not supports the shader profile (ambient_vs is vs_1_1/arbvp1 shader, so it is supported by almost all the cards, but ambient_ps is ps_2_0/arbfp1 so may not be supported by <very> older cards).
The best technique is automatically selected by the engine, so, let assume that your PC supports the first one. It had two pass, "Map#37" and "Map#305" (as a side note, ugly names generated by 3DS, do not hesitate to rename them), the first pass takes two texture units, diffuse and specular maps, the second takes three maps, diffuse specular and normals, in this order.
Do not forget to add all the needed resources to your project (.material, .program and .cg).
Let me know if you need further informations.
PS: please do not use automatic translation without check it before posting, it makes things very difficult to me to understand what's your problem was really about!

#85 Re: Programing » "empty prototype" error » 29-Aug-2011 09:08:29

Yes, this error at least smile
It was a cb function with proto "fun [JIZEN_AI_OBJECT fun [JIZEN_AI_OBJECT u0 S] u1 u0] JIZEN_AI_OBJECT" declared to use 4 params, instead of 3...

#86 Re: Openspace3D » How to use terrains on OpenSpace3D? » 26-Aug-2011 09:18:53

Hi,

We does not support this feature for the moment, althought it's a planned feature.
As allways, adding terrain loading to SO3Engine is pretty straitforward (I allready use it in a personnal engine I made), but, OS3D must have edition tools too, and that's where it becomes long to develop.
And as a side note, the ogre plugin you mention does not exists anymore, terrain and terrain paging are now "component" features of Ogre:
http://www.ogre3d.org/docs/api/html/group__Terrain.html
http://www.ogre3d.org/docs/api/html/group__Paging.html

So, for the moment, the simpler is to generate a standard mesh for your terrain, check the following pages if you are using blender, it's about 5 minutes of work max wink :
http://en.wikibooks.org/wiki/Blender_3D … heightmaps
http://en.wikibooks.org/wiki/Blender_3D … e_Modeling
http://en.wikibooks.org/wiki/Blender_3D … ic_Terrain
http://en.wikibooks.org/wiki/Blender_3D … Stenciling
http://en.wikibooks.org/wiki/Blender_3D … _Heightmap

For paging, you simply can't do it with this method.

#87 Programing » "empty prototype" error » 25-Aug-2011 16:16:51

Nodrev
Replies: 3

Hey folks,

I'm stuck with a bug in a lib i work on, look at the log:

JizenAiCheckEvents
JizenAiCheckEvents
Dead Scol Machine -10 (0)
empty prototype
EndScolMachine -1 
getSpeechPhonemeCb 
getSpeechVisemeCb
[...]
CRASH!

Does someone ever had "empty prototype" error in the log? What does it means?

#89 Re: Openspace3D » Raycast + GPU » 29-Jul-2011 19:35:04

astrolabio message let me think about a way to do the casting fully on the GPU with shaders, but as we need to render a third time the scene to have the "depth" map, it should not be very efficient with the actual renderer, but feasible with a deferred renderer. A thing to keep in mind. Anyway, sorry to not answer to your problem, I don't really have time to look at it tonight...

#90 Re: Openspace3D » Raycast + GPU » 29-Jul-2011 13:08:24

Hey,

Indeed, there's a raycast done.
But in fact, we had already boosted it the better way I know, ie with a selector buffer. The principe is very simple, and consist in rendering the scene a second time on a texture, and to set a unique colour by "sub-entity". A sub entity is not a concept that exists in OpenSpace3D, but in two words, it's a subset of an entity (an entity with 3 materials will have 3 sub-entities). So, next, we check which color is under the mouse cursor, get the sub-entity associated with this color, and then we are doing a "raycast to the polygon level" on the sub-entity triangles, to find the exact collision point with the mesh (and also get the uv coordonates and other stuff). And that's this last part that can affect the frame time, ie, if you have too many triangles on the subentity under the mouse, it'll lag...

So, to improve performance, use object with subentities that do not have two much polygons (the total polygon on the scene can stay the same, but, for example, if I have a building mesh, with one sub-entity on it, and 200K polys, it will be less effective than 10 sub-entities of 20K polys...).

You can also disable the rendering of an Entity on the color selector, meanings that the "raycasting to polygon level" will never be done on it. The Scol function is SO3ObjectSetMouseClick ("fun [SO3_OBJECT I] I"), but I don't know if an OpenSpace3D's plugit uses it (maybe "object click" plugit).

I Hope it helps.

<edit>I didn't saw your responses guys, but I think that you will find more infos in my post, let me know if it's still not clear</edit>

#91 Re: 3D » Blender 2.57 exporter » 5-Jul-2011 08:42:26

Hi,

First, the screenshots below were made with Blender2Ogre's last version (v0.4.4), check blender2ogre's website for updates.
You'll just have to overwrite the file named "io_export_ogreDotScene.py" in the good location, nothing more...

The two following images show you where to click to launch OgreMeshy viewer:
50419233.th.png 71366405.th.png

If you do not have those buttons, please check that you do not have an error at Blender start.
To check this, toggle the Blender's console on (you should have something like the image below):
74467789.th.png

@MrMask did you succeed to use the (basic) ogre viewer?

#92 Re: 3D » Blender 2.57 exporter » 4-Jul-2011 15:32:44

Hi,
Sorry for the late response, but I had no web connection last week.
I think that to render the preview, you have to click on a button on the top left of blender's window (as far as I remember).

#93 Re: Openspace3D » Vidéo pour débutant par un débutant :) » 15-Jun-2011 16:14:57

pour la sceonde, il faut s'amuser avec l'instanciante: créer un fichier contenant ton élément et l'interaction voulue (ton déplacement), puis une autre scène dans laquelle tu "instancies" <edit>(et sur laquelle tu définis le "déclencheur" de l'action)</edit> la scene précédente...
Il y a des exemples fournis avec l'install, de même je crois qu'il y a déjà des infos sur le forum, recherche "instanciate".

#94 Re: Openspace3D » Vidéo pour débutant par un débutant :) » 15-Jun-2011 16:12:30

Oui, ctrl-C / ctrl-V fonctionne, même si tu fais un ctrl-C sur une scène, puis un ctrl-V sur une autre scène (après un reset par exemple, le bouton "feuille blanche"), ça marchera!

#95 Re: Openspace3D » Vidéo pour débutant par un débutant :) » 15-Jun-2011 15:30:51

Cool, bien joué smile
Je prend note pour "les outils d'alignement".

#96 Re: 3D » conversion from blender » 14-Jun-2011 20:55:30

Arkeon worked on it, and he succeed to make it work:
moitarzan.png

Here the code you'll need in your resource path:
Fur.material:

material OpenSpace3D/Growing_Fur
{
    technique
    {
        pass base_coat
        {
            ambient 0.698039 0.698039 0.698039 1
            diffuse 0.698039 0.698039 0.698039 1
            specular 0.898039 0.898039 0.898039 1 20

            vertex_program_ref ambient_vs
            {
            }

            fragment_program_ref ambient_ps
            {
            }

            texture_unit
            {
                texture Fur/skin.jpg
                filtering linear linear linear
            }

            texture_unit
            {
                texture white.jpg
                filtering linear linear linear
            }
        }

        pass grow_fur
        {
            iteration 32 per_light
            ambient 0.65098 0.65098 0.65098 1
            diffuse 0.698039 0.698039 0.698039 1
            specular 0.898039 0.898039 0.898039 1 20
            scene_blend alpha_blend
            depth_write off

            vertex_program_ref OpenSpace3D/fur_vs
            {
                param_named UVScale float4 0.8 0.8 0 0
                param_named furHeight float4 0.12 0 0 0
                param_named gravity float4 0 0.06 0 0
                param_named totalPass float4 32 0 0 0
            }

            fragment_program_ref OpenSpace3D/fur_ps
            {
            }

            texture_unit
            {
                texture Fur/Fur.tga
                filtering linear linear linear
            }

            texture_unit
            {
                texture Fur/skin.jpg
                filtering linear linear linear
            }
        }
    }
}

FurV.cg:

struct typInput {
  float4 Position : POSITION;
  float3 Normal   : NORMAL;
  float2 uv0      : TEXCOORD0;
  float4 c        : COLOR0;
};

struct typOutput {
  float4 Position : POSITION;
  float4 light    : COLOR1;
  float2 T0       : TEXCOORD0;
  float2 T1       : TEXCOORD1;
  float2 T2       : TEXCOORD2;
};

typOutput main(typInput inData, 
      uniform float3 gravity,
      uniform float furHeight,
      uniform float totalPass,
      uniform float2 UVScale,
      uniform float4x4 wvpMat,
      uniform float4x4 iwpMat,
      uniform float4x4 wpMat,
      uniform float4 eyePosition,
      uniform float3 ambientColor,
      uniform float4 lightPosition,
      uniform float4 lightAttenuation,
      uniform float3 lightDiffuseColor,
      uniform float3 Ke,
      uniform float3 Ka,
      uniform float3 Kd,
      uniform float3 Ks,
      uniform float shininess,
      uniform float multiPassIter){
  typOutput outData;

  float4 normal = mul(wpMat, float4(inData.Normal, 1.0));
  // light
  float4 tmpcolor = inData.c;
  
  furHeight = furHeight * ((1.0 / (totalPass + 1)) * (multiPassIter + 1));
  float3 vGravity = mul(wpMat, float4(gravity, 0.0)).xyz;
  
  //float pp = 3.14 * 0.5 * Layer; // depth paramete
    //float A = dot(normal, vGravity);  //A is the angle between surface normal and gravity vector
  float k = pow(((1.0 / (totalPass + 1)) * (multiPassIter + 1)), 3); // We use the pow function, so that only the tips of the hairs bend
                             // As layer goes from 0 to 1, so by using pow(..) function is still 
                             // goes form 0 to 1, but it increases faster! exponentially
  
  float3 P = inData.Position.xyz + (inData.Normal * furHeight);
  P = P + vGravity*k;
  
  float4 znormal = 1 - dot(normal, float4(0,0,1,0));
  outData.T0 = inData.uv0 * UVScale;
    outData.T1 = inData.uv0 * UVScale + znormal.xy * 0.0007;
    outData.T2 = inData.uv0;  
  
  lightPosition = mul(iwpMat, lightPosition);
  eyePosition = mul(iwpMat, eyePosition);
  
  float3 N = normalize(inData.Normal);
  float3 emissive = Ke;
  float3 ambient = Ka * ambientColor;
  float3 L = normalize(lightPosition).xyz;
  float diffuseLight = max(dot(L, N), 0);
  float3 diffuse = Kd * lightDiffuseColor * diffuseLight;
  float3 V = normalize(eyePosition).xyz;
  float3 H = normalize(L + V);
  float specularLight = pow(max(dot(H, N), 0), shininess);
  if (diffuseLight <= 0) specularLight = 0;
  float3 specular = Ks * lightDiffuseColor * specularLight;
  tmpcolor.xyz = emissive + ambient + specular + diffuse;  
  
  outData.Position     = mul(wvpMat, float4(P, 1.0));
  outData.light        = tmpcolor;
  return outData;
}

FurF.cg:

struct typOut {
  float4 fragColor : COLOR;
};

struct typIn {
  float4 Position : POSITION;
  float4 light    : COLOR1;
  float2 T0       : TEXCOORD0;
  float2 T1       : TEXCOORD1;
  float2 T2       : TEXCOORD2;
  float2 ambient  : TEXCOORD3;
};


typOut main(typIn             inData,
            uniform float3    vecLightDir,
            uniform sampler2D noiseTexture : register(s0),
            uniform sampler2D colorTexture : register(s1),
            uniform float     spacing,
            uniform float     transparency) {

   typOut outData;

  float4 furcolr        = tex2D(noiseTexture, inData.T0);
    float4 furcolr_offset = tex2D(noiseTexture, inData.T1);
  float4 texcolr        = tex2D(colorTexture, inData.T2);

  float4 color = furcolr_offset - furcolr;
    
    float4 fcolor = color;
  fcolor.a = color.a;
  
  // Y is the luma, and contains most of the information of the image
  
    fcolor = (texcolr * inData.light) + (fcolor * inData.light);
  fcolor.a = color.a;
  
  //float furValue = tex2D(noiseTexture, inData.uv0 * float2(spacing, spacing) ).x * transparency;
  //outData.fragColor = float4(float3(inData.light) * tex2D(colorTexture, inData.uv0).rgb, furValue);
  
  outData.fragColor = fcolor;
  return outData;
}

Fur.program:

// CG simple Fur
vertex_program OpenSpace3D/fur_vs cg
{
source Fur/FurV.cg
profiles vs_1_1 arbvp1
entry_point main

default_params
{
param_named furHeight float 0.15
param_named UVScale float2 1.0 1.0
param_named totalPass float 8
param_named_auto multiPassIter pass_iteration_number
param_named_auto wvpMat worldviewproj_matrix
param_named_auto wpMat world_matrix
param_named_auto iwpMat inverse_world_matrix
param_named_auto eyePosition camera_position
param_named_auto ambientColor ambient_light_colour
    param_named_auto lightPosition light_position 0
    param_named_auto lightDiffuseColor light_diffuse_colour 0
    param_named_auto shininess surface_shininess
    param_named_auto Ka surface_ambient_colour
    param_named_auto Kd surface_diffuse_colour
    param_named_auto Ke surface_emissive_colour
    param_named_auto Ks surface_specular_colour
}
}

fragment_program OpenSpace3D/fur_ps cg
{
source Fur/FurF.cg
profiles ps_2_x arbfp1
entry_point main

default_params
{
param_named spacing float 0.0
param_named transparency float 0.3
}
}

#97 Re: 3D » Blender 2.57 exporter » 10-Jun-2011 15:53:14

You have to extract only the content of "OgreMeshy" directory (in the zip) to "C:\OgreMeshy", not the whole zip to "C:\OgreMeshy".

#98 Re: Openspace3D » texture » 9-Jun-2011 17:12:55

You will have to change your pivot point, object is centered on it.
In Sketchup, I think that the option is named "change axes" or something like that...

#99 Re: Openspace3D » texture » 8-Jun-2011 14:07:29

Ok, I had misread your previous message, missed the "reduce the size" line...
So, the problem is that you forgot to change the objects in the "Hide n" plugIt instances.

#100 Re: Openspace3D » texture » 8-Jun-2011 13:48:59

You have to play with the "Marker size" parameter, augmenting this value will scale down your object size.

Board footer

Powered by FluxBB