Browser plugin nearing completion

For the record, it looks like you have omitted the authority chain file the Comodo would have provided you–your cert files are claiming to be “self-signed”. If you had provided the authority chain certificates along with your personal certificate, it should have been able to validate the authenticity of your cert, and report it as being published by your email address.

David

In karmic 64 using the runtime ppa, when attempting to run a unsigned or self signed .p3d the window pops up that it is unsigned (even if self signed) and I can only cancel running the p3d file. In windows I am able to run it.

Since I obviously know next to nothing about this certification process- how would one go about providing the authority chain certificates? I just created a “back-up” of my email certificate per the manual’s instructions.

rdb said that openssl should be included in Panda’s bin- can’t find it. Is this 1.7 he’s talking about?

All the win32 builds of openssl I’ve found on the internet are worthless- I can’t create a .cnf file and with that openssl won’t create a certificate for me.

Er, yes, I think openssl.exe is provided in 1.7.0, or the latest buildbot release.

Hm, when I signed my p3d’s with my comodo cert, I didn’t have to use a certificate chain, I think. I just converted my p12 to pem and supplied it as argument to packp3d -S.

Yeah that sounds like the process I used to convert the p12 file to pem then sign the p3d file.

Edit: I just downloaded the BotBuild ver. The new version is very cool but I’m still having the same issues with openssl looking for the config file. Any tips?

Some versions of openssl use that cnf file to pre-supply the parameters that go into the certificate. I don’t know why it’s failing if it can’t find that file, but I don’t have such a file and it runs fine for me. Are you sure you’re running the right version of openssl.exe?

The certificate chain file is usually embedded in the cert file that you get from Comodo, after you convert it from p12, you can see multiple “BEGIN CERTIFICATE” lines in the resulting pem file. One of them is your personal certificate, the rest are the authority certificates that back it up. If you only see one such line, you must have done something wrong in conversion.

David

ok, I cleaned out all the versions of openssl I had on my system.

I justed tried to create a .pem from scratch using the openssl supplied in 1.7’s bin folder.

C:\Panda3D-1.7.0\bin>openssl.exe genrsa 1024 > mycert.pem
Loading 'screen' into random state - done
Generating RSA private key, 1024 bit long modulus
...........++++++
....++++++
unable to write 'random state'
e is 65537 (0x10001)

But as you can see I get a new error.
I’ve looked this up on OpenSSL FAQ and they have a pretty unhelpful answer about how I need to set a HOME but no explanation as to what it is or how to do it.

Maybe they just mean the environment variable HOME should be set and contain the name of a directory you can write to (e.g., your “home” directory).

David

For the record, I’ve just put up 0.9.10 officially:

panda3d.org/download.php?runtime

Features Snow Leopard support and also fixed PPC support, I think.
Can you guys please test this one and report the remaining bugs?

Also, you can use that link to let users download the Panda3D browser plugin.

Karmic people need only add ppa:panda3d/ppa as a software source, it auto installs the key as well, although this may complicate the directions.

My self-signed p3d file is still being incorrectly identified as unsigned in karmic 64 and am only offered a cancel button.

Hm. I’m experiencing some trouble with the browser plugin lately, too. After clearing my ~/.panda3d/certs, I am also getting the “unsigned” error for every .p3d I run, and I don’t seem to get any logfiles to appear in my log dir either.
Unfortunately, I have no idea where to start looking for the problem. All I know is that I recently recompiled OpenSSL statically for the Linux build.

No logfiles? That’s weird, and I don’t know how it could be related to the OpenSSL issues.

As to those, I’d start by trying to run p3dcert in isolation on one of your certificates, see if it can recognize it. Also use multify -tvf on your p3d file, for the same thing.

Both of these fundamentally call into X509_verify_cert() to verify the authenticity of the certificate. If that’s returning a failure indication on otherwise valid certs, something may be wrong with OpenSSL. Check the verify_result error number reported to the log. Error 20 is common, and means that the certificate authority couldn’t be verified; it might mean that the well-known certificates weren’t made available (load_certificates_from_der_ram is supposed to do this).

David

Running p3dcert on my certificate seems to work fine.

Recently I’ve been experiencing occasional crashes though:
pastebin.com/f7262b04b
Sometimes it works, sometimes it crashes.
Tricky to debug, as it’s a crash in p3dpython. It seems to be related to OpenSSL stuff. Have you ever seen something like that?
This is p3dcore.log:
pastebin.com/f589a2c60

Here’s an interesting part:

Assigning 0x162e910->log_pathname = 

Right after that, thats where the SIGPIPE happens in /usr/bin/panda3d according to gdb.
Maybe that’s related to my logging issue earlier? I’m not getting any other logfiles besides p3dcore.log, and none at all with the web plugin.

I recompiled OpenSSL dynamically on Linux and everything seems to work great again. Weird. Hm, I’ll keep this solution now, even though it means that p3dembed has a dependency on libssl0.9.8.

Anyways, can others try and see if the issues are fixed now?

Is this where one can leave problems/feedback on the packp3d.p3d? Well after some help from pro-rsoft I successfully packed my project. File is 60something MB, that’s good.

When I start the whole thing, Panda3D.app launches and then nothing happens. Can quit it normally.

Got some error:

The mcXXX modules are there. The last one is surely related to the problems I reported in the buildbot thread.

There seems to be some rescaling happening:

Why? It worked before. I designed all this so it’s pixel-perfect on my screen. Yeah, makes no sense propably, just wondering.

What does that mean? RGBA to RGB?

What?

When I run the .p3d file “directly” in Terminal I get:

No, these are known bugs in the packager. They are the cause of your application failure - but they will be fixed soon.

These are info messages that are usually suppressed in the SDK build. So the same thing happens when running your application normally, but you just don’t know it unless you set “notify-level” to “info”.
If you don’t want Panda to rescale your texture to the nearest power-of-two size, create a Config.prc file in your game directory with the line:

textures-auto-power-2 #t

Er, yeah, dunno why exactly in this case (I’d need more info to tell). But this happened too when you ran your game normally - the info message was just suppressed.

After updating to 21 (does that matter?) I recompiled the package, but I still get that error when starting my .p3d package in Terminal:

[size=150]Difference between 1.7.0 and Runtime[/size]

I continue to build special effects for my game. I decided that if everything will eventually be on the web, I should try to make my footprint as small as possible, this means moving away from pre-rendered effects and moving toward shaders. It saves footprint size and I think the end result looks better anyway.

During that process I’ve run into a problem. Here is my “plasma explosion” shader in Panda 1.7.0

and here is the result if I run the same thing as a packed p3d file in panda3d.exe

The shader is a little complex- I set a start position in world-space, then move the vertices away from that point in the vertex shader, I apply a plasma and mix it with a gradient that is set up along the distance from the world space origin to the current position of the fragment.
The runtime version appears to be simply ignoring that texture and combine call. That texture is called “agemap” in the code below.

Here’s the code, sorry for it’s length.

//Cg

//This shader is for explosions.  

void vshader(
	 float2 vtx_texcoord0 : TEXCOORD0,
	 out float2 l_texcoord0 : TEXCOORD0,
	 uniform float4x4 trans_model_to_view,
	 uniform float4x4 tpose_view_to_model,
	 uniform float4x4 trans_model_to_world,
	 in float4 vtx_normal : TEXCOORD1,
	 uniform float4 k_startTime,
	 uniform float4 k_time,
	 uniform float4 k_values,
	 out float4 l_normal : TEXCOORD2,
	 out float4 l_pos : TEXCOORD1,
	 out float4 l_explosionVec,
	 float4 vtx_position : POSITION,
	 
	 out float4 l_position : POSITION,
	 uniform float4 wspos_pos,
	 
	 uniform float4x4 mat_modelproj
) {
	 
	 //Calculate world space for vertex and compare to world space start point. 
	 float4 worldSpacePos = mul(trans_model_to_world, vtx_position);
	 l_explosionVec = worldSpacePos-wspos_pos;  //vector from start point to vertex in question.
	 
	 //Calculate time passed since start and re-set vertex. 
	 
	 float time = k_time.x - k_startTime.x;
	 
	 //calculate displacement along the explosion vector.
	 // k_values.x is amplitude
	 // k_values.y is surface roughness
	 // k_values.z is speed of expansion
	 float displace = k_values.x* sin((vtx_position.x+vtx_position.y+vtx_position.z+time*.2)*k_values.y) ;
	 l_explosionVec += l_explosionVec * time*k_values.z+ vtx_normal*displace ; 
	 vtx_position += l_explosionVec ;
	 
	 //Basic vertex functions
	 
	 
	 l_position = mul(mat_modelproj, vtx_position);
	 l_texcoord0 = vtx_texcoord0;
	 l_pos = mul(trans_model_to_view, vtx_position);
	 l_normal.xyz = mul((float3x3)tpose_view_to_model, vtx_normal.xyz);
	 l_normal.w = 0;
	 
}

void fshader(
	 in float4 l_explosionVec: TEXCOORD3,
	 float2 l_texcoord0 : TEXCOORD0,
	 uniform sampler2D tex_0,
	 uniform float4 k_values,
	 
	 uniform sampler2D k_tex1 : TEXUNIT0,
	 uniform sampler2D k_tex2 : TEXUNIT1,
	 uniform sampler2D k_agemap : TEXUNIT2,
	 uniform sampler2D k_firetex : TEXUNIT3,
	 uniform float4 k_time,
	 uniform float4 k_startTime,
	 out float4 o_color : COLOR0,
	 uniform float4 attr_color
) {


//determine how far this fragment is from the worldPos and apply gradient, stretch out that gradient by "size" value.
//This will create a type of spherical 3D texture with the gradient applied.
float size = k_values.w;
float j = length(l_explosionVec)/size;

if( j >= 0.99)  
	j = 0.99;

float4 result = tex2D(k_agemap, float2(j,0));

//generate cycling map
float2 off1 = float2(0.01,0.01) * k_time.x * 3;
float2 off2 = float2(-0.02,-0.03) * k_time.x * 3;
float c1 = tex2D(k_tex1, l_texcoord0 + off1).x;
float c2 = tex2D(k_tex2, l_texcoord0 + off2).x;
float v = saturate(c1+c2-0.2);
float4 move = tex2D(k_firetex, float2(v,0));


//determine time since start of model. 
float time = k_time.x - k_startTime.x;

// combine the spherical 3D volume texture with the cycling map
 float4 combine = lerp(move,result,0.7);
 float alpha = result.a -(time*.2) ; //the explosion should generally become more transparent through time.
 o_color = float4(combine.r,combine.g,combine.b,alpha);
}

What am I doing wrong? and why was the outputs different between the SDK and the runtime?

For the record, there’s no problem with having a large game run in a browser. The browser plugin is designed for large MMORPG’s such as Pirates so I don’t think you really need to worry about making the footprint smaller. Panda has a smart package system to help you with that.

As for the shader problem, I really have no idea what could be different. Panda is compiled with a different optimization option, but I doubt that could have any effect.

Could it be an OpenGL vs. DirectX issue? Try running your app in both API’s interactively to ensure they both look the same (or that at least this isn’t the issue).

Try to look for error messages in the log files when you run it as a p3d file to provide some insight.

David