05-05-2012 11:50 AM - edited 05-05-2012 11:55 AM
I made a little 3d room and everything ran fine, then i decided to add a hud.
First i copy-pasted the hello world example of the documentation then i used my own hud prototype made with the composer, in both cases the results are altered, infact they overridde my shader altering the trasparent pixels drawing policy(for testing reasons i want to draw them) and probably the "distance" instruction used to calculate the amount of light that affects a vertex.
this is the game on vita before the hud

this is after

on the pc emulator the light is right but remains the problem with trasparent pixels.
Why the hud interfere with my 3d settings? What can i do?
PS:
the hud makes nothing, i didn't add instructions, i only wanted to try to show it in the game.
on 05-05-2012 12:33 PM
Sometimes the pc emulator renders only walls, the skeleton and the hud.
on 08-05-2012 04:39 PM
on 08-05-2012 04:52 PM
I can test it only on my pc and psvita, sorry.
I have problems only with the ui, without it everything is fine.
on 10-05-2012 02:24 PM
on 11-05-2012 10:02 AM
This is the appmain class where i added the ui code, DEM is the class that makes everything and Hud is the class of my custom interface.
using System;
using System.Collections.Generic;
using Sce.Pss.Core;
using Sce.Pss.Core.Audio;
using Sce.Pss.Core.Environment;
using Sce.Pss.Core.Graphics;
using Sce.Pss.Core.Input;
using Sce.Pss.HighLevel.UI;
using provaui;
using Emalib;
namespace Prova
{
public class AppMain
{
private static GraphicsContext graphics;
private static DEM dem;
private static hud h;
public static void Main (string[] args)
{
Initialize ();
while (true) {
SystemEvents.CheckEvents ();
Update ();
Render ();
}
}
public static void Initialize ()
{
// Set up the graphics system
graphics = new GraphicsContext ();
dem = new DEM(graphics);
// Initialize UI Toolkit
UISystem.Initialize(graphics);
// TODO: Create scenes and call UISystem.SetScene
// Scene myScene = new Sce.Pss.HighLevel.UI.Scene();
// UISystem.SetScene(myScene, null);
// Create scene
h=new hud();
// Set scene
UISystem.SetScene(h, null);
}
public static void Update ()
{
//dem.update2d();
dem.update3d();
// Query touch for current state
List<TouchData> touchDataList = Touch.GetData (0);
// Update UI Toolkit
UISystem.Update(touchDataList);
}
public static void Render ()
{
// Clear the screen
graphics.SetClearColor (0.0f, 0.0f, 0.0f, 0.0f);
graphics.Clear ();
dem.render3d();
// Render UI Toolkit
UISystem.Render ();
// Present the screen
graphics.SwapBuffers ();
}
}
}this is the code of the shader
void main( float4 in a_Position : POSITION,
float4 in a_Color : COLOR,
float2 in a_TexCoord : TEXCOORD0,
float4 out v_Position : POSITION,
float2 out v_TexCoord : TEXCOORD0,
float4 out v_Color : COLOR0,
float4 out prova : COLOR1,
uniform float4x4 WorldViewProj
)
{
v_Position = mul( a_Position, WorldViewProj );
v_TexCoord = a_TexCoord;
v_Color=a_Color;
float4 temp;
temp.x=temp.y=temp.z=temp.w=0;
prova.r=distance(temp,v_Position);
if(prova.r<=3)prova.r=0;
else if(prova.r>5)prova.r=1;
else prova.r=(prova.r-3)/2;
prova.g=prova.b=prova.r;
}
void main(
float2 in v_TexCoord : TEXCOORD0,
float4 in v_Color : COLOR0,
float4 in prova :COLOR1,
float4 out Color : COLOR,
uniform sampler2D Texture0 : TEXUNIT0)
{
Color=tex2D(Texture0, v_TexCoord);
/*if(Color.a == 0.0f)
{
discard;
}
else*/
{
Color-=prova;
}
}
PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.
フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと
PSM DevPortalを一度ログアウトし、再度ログインしてください。


Website ©2013 Sony Computer Entertainment Europe
All content, game titles, trade names and/or trade dress, trademarks, artwork and associated imagery are trademarks and/or copyright material of their respective owners. All rights reserved. [more info]
%%http://community.eu.playstation.com/t5/Announcements/Beta-Trial-Information/td-p/11386362
best_shooter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_driver.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_performer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_footballer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_fighter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_creator.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_action_player.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
dev2.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Producer-and-Developer-Ranks/td-p/18407352
trophy.gif%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/The-Community-Awards-FAQ/td-p/18407096
PSlogoSM.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Online-Support-Coordinator-rank/td-p/18414870