We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Error #162 CreateCubeRenderTexture

error(#162) Wrong operand types no operation ‘:’ exists that takes a left-hand operand of type ‘highp float’ and a right operand of type ‘const int’ (or there is no acceptable conversion)

Scene scene = new Scene(dataDir + “skybox.obj”);
//create a camera for capturing the cube map
Camera cam = new Camera(ProjectionType.Perspective);
cam.NearPlane = 0.1;
cam.FarPlane = 200;
scene.RootNode.CreateChildNode(cam).Transform.Translation = new Vector3(5, 6, 0);
cam.RotationMode = RotationMode.FixedDirection;

        //create two lights to illuminate the scene
        scene.RootNode.CreateChildNode(new Light() { LightType = LightType.Point }).Transform.Translation = new Vector3(-10, 7, -10);
        scene.RootNode.CreateChildNode(new Light()
        {
            //LightType = LightType.Point,
            //ConstantAttenuation = 0.1,
            Color = new Vector3(Color.CadetBlue)
        }).Transform.Translation = new Vector3(49, 0, 49);

        //create a render target
        using (var renderer = Renderer.CreateRenderer())
        {
            //Create a cube map render target with depth texture, depth is required when rendering a scene.
            IRenderTexture rt = renderer.RenderFactory.CreateCubeRenderTexture(new RenderParameters(false), 512, 512);

@wilsonfalcao,

Kindly send us a ZIP of the OBJ model. We will investigate your scenario in our environment, and share our findings with you.

I see problem when all time use of method renderer.RenderFactory.CreateCubeRenderTexture(). Dont there problem with OBJ MODEL. Did tests with lot of OBJ MODEL.
In time execution on Visual Stuido the line with problem is exactly this:

scene.Render(camera, MyDir + “CastAndReceiveShadow_out.png”, new Size(1024, 1024), ImageFormat.Png, opt);

this is my project:

string MyDir = @“C:\Users\wilson.falcao\Downloads”;

        Scene scene = new Scene();
        Camera camera = new Camera();
        camera.NearPlane = 0.1;
        scene.RootNode.CreateChildNode("camera", camera);
        Light light;
        scene.RootNode.CreateChildNode("light", light = new Light()
        {
            NearPlane = 0.1,
            CastShadows = true,
            Color = new Vector3(Color.White)
        }).Transform.Translation = new Vector3(9.4785, 5, 3.18);
        light.LookAt = Vector3.Origin;
        light.Falloff = 90;

        // Create a plane
        Node plane = scene.RootNode.CreateChildNode("plane", new Plane(20, 20));
        plane.Material = new PhongMaterial() { DiffuseColor = new Vector3(Color.DarkOrange) };
        plane.Transform.Translation = new Vector3(0, 0, 0);

        // Create a torus for casting shadows
        Mesh m = (new Torus("", 1, 0.4, 20, 20, Math.PI * 2)).ToMesh();
        Node torus = scene.RootNode.CreateChildNode("torus", m);
        torus.Material = new PhongMaterial() { DiffuseColor = new Vector3(Color.Cornsilk) };
        torus.Transform.Translation = new Vector3(2, 1, 1);

        {
            // Create a blue box don't cast shadows
            m = (new Box()).ToMesh();
            m.CastShadows = false;
            Node box = scene.RootNode.CreateChildNode("box", m);
            box.Material = new PhongMaterial() { DiffuseColor = new Vector3(Color.Blue) };
            box.Transform.Translation = new Vector3(2, 1, -1);
        }
        {
            // Create a red box that don't receive shadow but cast shadows
            m = (new Box()).ToMesh();
            m.ReceiveShadows = false;
            Node box = scene.RootNode.CreateChildNode("box", m);
            box.Material = new PhongMaterial() { DiffuseColor = new Vector3(Color.Red) };
            box.Transform.Translation = new Vector3(-2, 1, 1);
        }
        camera.ParentNode.Transform.Translation = new Vector3(10, 10, 10);
        camera.LookAt = Vector3.Origin;
        ImageRenderOptions opt = new ImageRenderOptions() { EnableShadows = true };
        scene.Render(camera, MyDir + "CastAndReceiveShadow_out.png", new Size(1024, 1024), ImageFormat.Png, opt);

@wilsonfalcao,

We have tested your source code with the latest version 18.4 of Aspose.3D for .NET API, and unable to replicate this error in our environment. Kindly create a small project application, which reproduces this error in your environment, then send us a ZIP of this project. Your response is awaited.

Hi imran.rafique.

I made project update,

https://drive.google.com/file/d/1GIHkRKwgYihK2b-XaqQp-_-6WBG3B4_B/view?usp=sharing

@wilsonfalcao,

We can run your application project without any error. This is the output PNG: CastAndReceiveShadow_out.jpg (149.5 KB). Kindly list down all steps to replicate this error and also share a snapshot.

May be an incompatibility the Drive Video? Not there possible get snapshot on my computer. I use AMD A8 5500B with video integrated

@wilsonfalcao,

Kindly send us the complete call stack of the error, highlight the problematic line of code with the help of a snapshot, and share all details of the environment, e.g. Operating system (name & edition) and local language settings etc.

HI imran.rafique.

The down my setup:
THE DOWN MY SETUP CPU:

MACHINE HP CORP “HP COMPAQ PRO 6305 SMALL”
WINDOWS 7 6.1 Compilation 7601 SERVICE PACK 1 X64
AMD A8-5500 APU WITH RADEON 3.2GHZ
DIRECTX 11 AMD RADEON HD 7560D DRIVE VERSÃO 8.982.0.6 02/08/2015

VISUAL STUDIO 2012 V.11.0.50727.1 RTMREL
.NET 4.5.50938

COD ERRO TIMELINE DEBUG PROJECT:
ERROR:0:157 ERRO(#162)
WRONG OPERAND TYPES NO OPERATION ‘:’ EXIST THAT TAKES A LEFT-HAND OPERANDO OF TYPE ‘HIGHP FLOAT’ AND A RIGHT OPERAND OF TYPE ‘CONST INT’ (OR THERE IS NO ACCEPTABLE CONVERSION)

Print debug cod in Visual Studio:
https://drive.google.com/file/d/1EAEZ3L2xCsgz8sfdMqCQCap09jdAgLi6/view?usp=sharing

Debug timeline cod (trace file):
https://drive.google.com/file/d/1ciAS6gT8FHj5XKDux8z1K6v7b71BPM7s/view?usp=sharing

@wilsonfalcao,

We are working over your query and will get back to you soon.

@wilsonfalcao,

We are sorry for the delay. We are unable to open the trace file in our environment because of the conflict of Visual Studio edition. Kindly create a small project application which reproduces this error in your environment, and then send us a ZIP of this project. Please paste the call stack of this error in the notepad file and also include in the ZIP file. Your response is awaited.

@wilsonfalcao,

In addition to above reply, what is the model of GPU? The error comes from the OpenGL driver. Your response is awaited.

Hi imran.rafique!

Did the new upload. That file .zip have: Template Project with problem, the project soluction and file execution trace in Visual Studio 2012

https://drive.google.com/file/d/17PtfQWh_KEoil62ecpro3LFsBAi7F7l0/view?usp=sharing

@imran.rafique, i’m available for talk.

@wilsonfalcao,

In the project application, you are using an old version 17.9 of Aspose.3D for .NET API. Please download and try the latest version 18.5 of Aspose.3D for .NET API, and then let us know how that goes into your environment. An investigation has been logged under the ticket ID THREEDNET-395 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates.

@wilsonfalcao,

The linked ticket ID THREEDNET-395 has been resolved, and will be included in the next version 18.6 of Aspose.3D for .NET API. We will notify you once it is published.