You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

81

Tuesday, September 8th 2015, 9:39am

WebGL-Hotspots?

Hi Klaus,

great release, as always *smile* Does the 1.19 use WebGL-Hotspots or still CSS3D?

Thanks and best regards,
Nupsi

82

Tuesday, September 8th 2015, 10:01am

Does the 1.19 use WebGL-Hotspots or still CSS3D?
The pre-releases are using CSS3D by default for normal rendering and WebGL when stereo-rendering.

WebGL support for hotspots could be enabled manually for normal rendering this way:

Source code

1
2
3
4
<!-- TEMP PRE-RELEASE STUFF -->
<display hotspotrenderer="webgl" devices="html5" />	<!-- force using WebGL for the hotspots -->
<view continuousupdates="true" devices="html5" />	<!-- constantly update the screen (required for WebGL hotspots for the moment) -->
<!-- TEMP PRE-RELEASE STUFF -->


Note - the hotspot WebGL support is currently not finished in the pre-releases (e.g. clicking the hotspots will be not possible).

But with the final 1.19 release the hotspots will be rendered by WebGL by default.

Best regards,
Klaus

ninerian

Beginner

Posts: 40

Location: Zwickau

Occupation: Softwareentwickler

  • Send private message

83

Tuesday, September 8th 2015, 4:49pm

But with the final 1.19 release the hotspots will be rendered by WebGL by default.


Thats sounds great. Would it be possible to integrate a API to modify the hotspot texture with WebGL as descriped here? http://learningwebgl.com/blog/?p=1786

84

Tuesday, September 8th 2015, 4:56pm

What exactly do you mean or what do you want to do?
An API for using a custom framebuffer as hotspot texture?

85

Wednesday, September 9th 2015, 6:40am

When I enter VR mode on my phone it goes to the rotate phone image, I then rotate phone but it does not go into stereoscopic mode. I then hit "exit VR" then hit "enter VR" again and it then goes to stereoscopic but in vertical orientation. What am I doing wrong? I've tried in both Safari and Chrome, iOS 8.4.1, iPhone6. I would like it to go into stereoscopic mode the first time I hit "enter VR" and in the horizontal view not vertical.

Any help would be appreciated.

This post has been edited 1 times, last edit by "James Hay" (Sep 29th 2015, 10:39pm)


86

Wednesday, September 9th 2015, 6:58am

Try using the vtourskin.xml from 1.19 pre-release 3.

ninerian

Beginner

Posts: 40

Location: Zwickau

Occupation: Softwareentwickler

  • Send private message

87

Wednesday, September 9th 2015, 10:23am

What exactly do you mean or what do you want to do?
An API for using a custom framebuffer as hotspot texture?


Exactly. I want to replace the image of the hotspot with an dynamic texture, which I can control with javascript.

Umalo

Professional

Posts: 1,047

Location: Osijek, Croatia, EU

  • Send private message

88

Wednesday, September 9th 2015, 11:46am

New Style handling

With new parser handling styles we have situation that you have hotspot_1 with style="style_1" if we have loadstyle="style_2" in memory this hotspot is not having style_1 anymore.
Best example is: arrows hotspots with style skin_hotspotstyle, where skin_tooltips is loaded in case user want tooltips. From that moment style of the hotspot is not skin_hotspotstyle but skin_tooltips.

I had to make memory tweaking for this.

Source code

1
2
3
for(set(i,0), i LT hotspot.count, inc(i),	  					
if(hotspot[get(i)].linkedscene,if(hotspot[get(i)].style EQ 'skin_tooltips', set(hotspot[get(i)].style,'skin_hotspotstyle');););									
);


Do you have better proposal as I need to keep initial style of the elements?

Posts: 1,850

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

89

Wednesday, September 9th 2015, 1:30pm

I think you have a bug there, you can't set style, you must .loadstyle(style);

a bit syntactically different. Or did something change?

http://krpano.com/docu/xml/#layer.loadstyle
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

Umalo

Professional

Posts: 1,047

Location: Osijek, Croatia, EU

  • Send private message

90

Wednesday, September 9th 2015, 2:52pm

You can still have style as before but the handling is different now. First style attributes are taken in consideration and in case element attribute is same as in style than it is overwritten in memory.
http://krpano.com/docu/xml/#style

But this is not the point. If attribute style is defined on element (hotspot, layer....) and later on you have loadstyle(another style) than in memory attribute style of the element is not as defined at start but the style loaded with loadstyle.
New style handling is ok but question is why loadstyle is overwriting style attribute.

91

Wednesday, September 9th 2015, 3:43pm

Try using the vtourskin.xml from 1.19 pre-release 3.
Klauss, just replaced the vtourskin.xml and the webvr files with the files from 1.19-pr3 and it is now not displaying stereoscopic at all. I'm confused as to what I'm doing wrong here. Thanks for your help.

http://fathomvr.com/hdspano/colorrun.html

Tuur

Sage

Posts: 3,124

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

92

Wednesday, September 9th 2015, 5:42pm

hi,

when i look on a mobile (iphone 6) the webvr is just there.
But on desktop fake device url mobile not.
without fake device in url yes

Tuur *thumbsup*
http://www.virtualtuur.com
Skype:studiotuur

93

Thursday, September 10th 2015, 8:27am

Hi,

but question is why loadstyle is overwriting style attribute.
Hmm... with which version do you compare?

When calling loadstyle() the new 'style' value will be the one that was given in the loadstyle call. But that was the same in the previous versions...


Klauss, just replaced the vtourskin.xml and the webvr files with the files from 1.19-pr3 and it is now not displaying stereoscopic at all. I'm confused as to what I'm doing wrong here. Thanks for your help.
Your colorrun.xml is wrong - you are including there the webvr.xml (and an additionally gyro - why?) and this changes/overwrites the WebVR settings that were made in the vtourskin.xml.

Please don't try adding xml code in an 'experimental way', as you can see this leads to non or wrong working stuff. Either remove the webvr.xml and the gyro from the xml or use the default output xml code.

Best regards,
Klaus

94

Thursday, September 10th 2015, 8:35am

Exactly. I want to replace the image of the hotspot with an dynamic texture, which I can control with javascript.

I haven't tested that case, but that should be already possible. The necessary interfaces (or exposed properties) are already there:

Inside krpano plugins it's possible to access the krpano WebGL context and also the WebGL texture of the hotspots.

The WebGL context could be get via:

Source code

1
2
3
4
5
6
7
if (krpano.webGL)
{
  // have WebGL support
  
  // get the WebGL context
  var gl = krpano.webGL.context;
}


and the WebGL texture of a hotspot via:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/ get the hotspot
var hotspot = krpano.get("hotspot[NAME]");

// get the hotspot WebGL texture (only possible when the texture was at least once rendered via WebGL)
if (hotspot.GL)
{
  var texture = hotspot.GL.tex;
  if (texture)
  {
    // do some stuff with the texture - e.g. bind it to a custom framebuffer:
     gl.bindTexture(gl.TEXTURE_2D, texture);
     gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, your_tex_width, your_tex_height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
			
     gl.bindFramebuffer(gl.FRAMEBUFFER, your_framebuffer);
     gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);

     gl.bindFramebuffer(gl.FRAMEBUFFER, null);
     gl.bindTexture(gl.TEXTURE_2D, null);
  }
}



Btw - when working with WebGL there is one thing to consider - when changing any WebGL state, it's necessary to restore them when the work is done, otherwise the following krpano WebGL code might not work.

For getting even more insight I would recommend looking at the source of this example:
Use three.js (3d objects) inside krpano (with VR support)

Best regards,
Klaus

95

Thursday, September 10th 2015, 7:40pm




Klauss, just replaced the vtourskin.xml and the webvr files with the files from 1.19-pr3 and it is now not displaying stereoscopic at all. I'm confused as to what I'm doing wrong here. Thanks for your help.
Your colorrun.xml is wrong - you are including there the webvr.xml (and an additionally gyro - why?) and this changes/overwrites the WebVR settings that were made in the vtourskin.xml.

Please don't try adding xml code in an 'experimental way', as you can see this leads to non or wrong working stuff. Either remove the webvr.xml and the gyro from the xml or use the default output xml code.

Best regards,
Klaus
Klauss,

Sorry for the confusion. I have removed the reference to the webvr.xml file in all my tours. I did remove the <plugin name="gyro" url="gyro.js" keep="true" enabled="true" camroll="false" friction="0.5" velastic="0" /> from the xml file, but then the gyro will not work unless in VR mode. I would like to keep the gyro functionality in the tour when not in VR mode.

My main issue is I can not get my still tours in stereoscopic mode when I enter VR mode. My video tours will give me stereoscopic mode, but only in portrait mode?

This post has been edited 1 times, last edit by "James Hay" (Sep 29th 2015, 10:38pm)


Zephyr

Professional

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

96

Thursday, September 10th 2015, 8:33pm

Hi Klaus,

Ive discovered a possible bug.

Givens this code:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<krpano onstart="loadscene(demo)">
	<scene name="demo">
		<preview type="grid(CUBE,16,16,512,0xCCCCCC,0xFFFFFF,0x999999);" />
		
		<!-- Not showing on flash -->
		<style name="popup_hotspot_style" url="%SWFPATH%/skin/images/info.png" keep="true" />
		<hotspot style="popup_hotspot_style" ath="-30" atv="0" />

		<!-- Showing on flash -->
		<hotspot url="%SWFPATH%/skin/images/info.png" ath="30" atv="0" />
		
		<!-- showing on flash but alpha is not applied -->
		<style name="popup_hotspot_style1" alpha="0.5"  keep="true" />
		<hotspot style="popup_hotspot_style1" ath="-60" atv="0" url="%SWFPATH%/skin/images/info.png" />

		<!-- Works on flash -->
		<hotspot onloaded="loadstyle(popup_hotspot_style1)" ath="-90" atv="0" url="%SWFPATH%/skin/images/info.png" />
	</scene>
</krpano>


On webgl all hotspots are shown. But on the Flash version, it doesnt apply the style. Ive tried adding preload and keep and flipping around where the style is defined, but cant get it to work. Issue on all browsers Running flash 18.0.0.232


Update, when I looped the hotspots and get the 'style' I got null back. But when I named my hotspots, it suddenly started loading the styles. So atleast I can work around this bug.
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

This post has been edited 1 times, last edit by "Zephyr" (Sep 10th 2015, 9:50pm)


VVZen

Beginner

Posts: 26

Occupation: Freelance 2d-3d Artist

  • Send private message

97

Monday, September 14th 2015, 12:46pm

Hi!
Thanks for another great release!

Is there any way at the moment to "zoom" the view of a pano while being in VR? *question*
I was actually able to fake a zoom by lowering the mobilevr_lens_fov, but the image quality degrades quite a lot, even if I'm loading a multires image.
So I guess I must be doing something wrong..

Namastè.
VVZen - 3d generalist getting into the VR world

yaskebasi.it

tittu

Beginner

Posts: 12

Location: France

  • Send private message

98

Monday, September 14th 2015, 2:05pm

Thanks Klaus for this release!

Does anyone know if it is possible to display a hotspot solely in left (or right) part of the screen in VR mode?

@VVZen
Do you want to zoom in a specific object or the image ?

Best regards.

VVZen

Beginner

Posts: 26

Occupation: Freelance 2d-3d Artist

  • Send private message

99

Monday, September 14th 2015, 2:46pm


@VVZen
Do you want to zoom in a specific object or the image ?

I'd like to have the actual pano zoomed!

Thanks. *smile*
VVZen - 3d generalist getting into the VR world

yaskebasi.it

benji33

Intermediate

Posts: 244

Location: France

Occupation: Senior Software engineer

  • Send private message

100

Monday, September 14th 2015, 2:54pm

Don't change the lens_fov ! Act on the <view> fov with zoom buttons displayed as distorted hotspots for instance.